Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.
This repository was archived by the owner on Oct 12, 2021. It is now read-only.

Suggestion: ceContext based on item content in Splitter #9

@antoineco

Description

@antoineco

I'm not suggesting we must do it, but this came up today so before I forget about it, let me describe a possible improvement to the Splitter.


If the list being split contains different types of items, it would be nice to be able to set a different ceContext based on the result of an expression.

Very simple (nonsense) example:

[
    {
        "user": {
            "id": 0,
            "name": "Woodford"
        }
    },
    {
        "animal": {
            "type": "poney",
            "price": 9000
        }
    }
]
  • If the item passes the "user" condition -> type: triggermesh.user (+ extensions, etc.)
  • If the item passes the "animal" condition -> type: zoo.animal (+ extensions, etc.)
  • Else -> some default context.

It's basically a shortcut for a pipeline like split -> data expression filter -> transform context.

Here is an illustration of the pattern (left part of the diagram): https://camel.apache.org/components/latest/eips/composed-message-processor.html

Composed Message Processor

(sorry for the transparent background)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions