Whenever the implementation has to trigger something in the state machine (e.g. a task is finished or an event occurs), the related signal has to be send. All signals have one identical attribute called message, but use their own corresponding message type class (e.g. SendApproveAmountDone). This class contains the process id and can optionally be used to transport additional data to the persistent state object (e.g. a result of a task, see also Starting the BPMN process).

An example of such an implementation is shown below. Port type operation sendApproveAmountDone sends the signal ApproveAmountDone to communicate to the process state machine that the approve amount task is completed. The signal conveys the result of the task by the message object.
In the pictures below, changes with respect to the generated activities are marked in red. The message flow from message to the persistent state signal was added to pass the approved attribute to the signal handler.

The signal ApproveAmountDone invokes its handler. This handler is located in the read-only module and does nothing else than invoking the overridable operation approveAmountEnd. By default, the operation performs a simple logging to the bridgeserver log. The default logging behavior is now overwritten by the overwriting operation, to set the result of task approve amount to the persistent state object.

  • No labels