Events

Message Events

Configuring Message Events

../../_images/throw_message_event.png

Throw Message Event configuration

../../_images/message_start_event.png

Message Catch Event configuration

The Throw Message Event Implementation should be ‘Expression’ and the Expression should be a Python statement that can be evaluated. In this example, we’ll just send the contents of the reason_delayed variable, which contains the response from the ‘Investigate Delay’ Task.

We can provide a name for the result variable, but I have not done that here, as it does not make sense to me for the generator of the event to tell the handler what to call the value. If you do specify a result variable, the message payload (the expression evaluated in the context of the Throwing task) will be added to the handling task’s data in a variable of that name; if you leave it blank, SpiffWorkflow will create a variable of the form <Handling Task Name>_Response.

Running the Model

If you have set up our example repository, this model can be run with the following command:

./camunda-bpmn-runner.py -c order_collaboration \
     -d bpmn/tutorial/product_prices.dmn bpmn/tutorial/shipping_costs.dmn \
     -b bpmn/camunda/events.bpmn bpmn/camunda/call_activity.bpmn