Hello,
I’m trying to define a generic BPMN workflow (“CommandExecutor”) that can be reused in other workflows by invoking it as “call activity”. This generic workflow is supposed to execute a command (basically publish an event), then wait for another event as response → evaluate the response and either complete successfully or with an error. If a response is not received for a specified amount of time - also complete with an error.
I am trying to make the CommandExecutor configurable through input variables - so that any other workflow calling it can set the desired parameters: [name of the event to send, parameters of that event, name of the response event to listen for, timeout duration, expression to evaluate the success/failure of the response event]. So far so good with some of those, but I’m having trouble figuring out the expression that evaluates the response event. How can I pass that expression as input parameter and how can I execute that input parameter as part of my gateway?
Let’s say that the response event I’m waiting for is “EmailDelivery” and it contains a string property/variable “status = Sent”. Ideally my gateway expression would be “#{status == ‘Sent’}”. However that expression is coming in a variable “responseEvaluation” - how do I execute the value of that variable as an expression and what do I set as the value for that variable?
I’m attaching my “CommandExecutor” model and a “Test” model that is supposed to exercise triggering it.
CommandExecutor.bpmn (7.3 KB)
test.bpmn (2.9 KB)
Thank you,
Dimitar