Multiple start events are not authorized.
However how can we model 2 different starts, let’s say one start triggered by a message in a topic (through start message event) and another start triggered programmatically through a controller that receives a message?
I am thinking of calling startProcessInstanceByKey but then it will execute the whole flow and not only part of the flow (see screenshot, I want the second start to start from an intermediate step).
Is it possible?
In other words, I would need something like in Camunda where I can start programmatically at a specific task:
processEngine.getRuntimeService().createProcessInstanceByKey("twitter")
.startBeforeActivity("service_task_publish_on_twitter")
.setVariable("content", "Know how to circumvent the review!")
.execute();
Thanks for your answer. Sorry for the ping… Thought (still think) you are the best
@joram:
Can’t you achieve the behavior you want with an exclusive gateway after the start that goes to the second service task in case some variable is set?
I don’t think I can achieve this with exclusive gateway since there are 2 kinds of starts: either message from Kafka or programmatically when a rest endpoint is called.
I successfully used the API startProcessInstanceByKey() but as you said it goes back to the start event but I want to go back to the middle of the flow.
The flow is like this - 3 possible starts 1.a, 1.b, 1.c:
1.a Get documentID from Kafka topic
2. Call Rest to get document from documentID
3. Call service X
1.b Get documentID from an endpoint in our application (and start process programmatically?)
2. Call Rest to get document from documentID
3. Call service X
1.c Get document itself from an endpoint in our application - so no need for step 2 above (and start process programmatically?)
2. Call service X
You see it as ‘start’, but the way I read it, it looks the same process, where certain steps are skipped with an exclusive gateway, based in data in the instance (e.g. wasStartedFromKafka or something). So not sure why it can’t be done - it’s exactly the purpose of gateways.