I have a question regarding Intermediate Message Catching event. Let me explain with an example:
Workflow looks like following:
Start Message Event -> Task 1 -> Intermediate Catching Message Event -> Task2
Task 1 has to happen before Task 2 i.e. Task 2 is dependent on Task 1. However, there is a possibility that “Intermediate Catching Message Event” arrives before Task 1 has completed. We do not have any control over when these events arrive. At the moment, I am using following API to query for the execution required to send the event
val execution = runtimeService.createExecutionQuery()
.messageEventSubscriptionName(“Intermediate Catching Message Event Name”)
runtimeService.messageEventReceived(“Intermediate Catching Message Event Name”, execution.id)
This works fine, if Task1 has completed before the intermediate catching message event arrives. However, I get execution cannot be null error if Task 1 has not completed. I can understand the reason why this error is thrown.
My Question is: How do we model these scenarios with Flowable? Is there a way to effectively “park” the message so that it can be “replayed” at some point in future?