I have the following workflow design around tracking a package that is moved via non-human process(es) through a building:
Once started, it can take a while before a package arrives “onsite” at which point, I expect one or both signals to be thrown.
It is possible for the package to arrive on-site without being at the destination.
I also expect to be able to update the process instance variables using the service task connected to the intermediate message catching event.
I’d just like an opinion on whether is is a valid BPMN design and also have the following questions:
1 - Is it valid to loop back to the event gateway as I’ve modelled in the picture?
2 - How do I retrieve the process variables (that are stored when the process started) in the service task?
- exexution.getVariable on the execution you get in from the JavaDelegate interface
One thing I don’t understand from this model: in the comment tex you say the signal will be thrown? But those signals are after the service task. Will they be thrown externally?
I intend for the first service task to throw either signals. Also rather than use a flowable delegate, I’m actually using a flowable expression to pass delegation to a spring bean method.
The workflow only has one start event, so it is always started by that. The intention is, after started, I want to be able to update the process variables through the message catching event (The intermediate message catching event is connected to the same service task as the message starting event) but at the moment I am unable to do so.
I retrieve the execution through:
afterwards I throw a message event:
runtimeService.messageEventReceived("updateMessage", execution.getId(), variables);
but this results in an error:
Execution with id '77' does not have a subscription to a message event with name 'updateMessage'
On inspection in the debugger, it shows that there are 0 active subscriptions for the execution.
Any pointers as to what I am doing wrong?