Add data and a Service Task
Use your parallel model or the completed parallel model as your starting point, or open the completed service model.
Give a handler typed data
Section titled “Give a handler typed data”- In Process fields, add
amountas decimal andeligibleas Boolean. - Insert a Service Task called Check amount between the parallel join
and the end event. Select it and set Handler key to
check-amount. - Use Add input mapping to select
amountand Add output mapping to selecteligible. Check the model against the server. The demo server already has this handler registered with those input and output names.
The process sends exact decimal values as strings. For an input of
"125.50", the handler returns eligible: true. It accepts positive
amounts up to 10,000. The result is written to process data before the
workflow reaches the end event.
Deploy your service model or the completed file, then run the helper.
node run-workflow.ts tutorial service detailed file-firstThe run finishes the full review and both parallel tasks. The automatic
check never appears on the reviewer’s worklist. The final output includes
eligible: true in the process data. Look at the service work contract
for task attempts and the conditions for accepting a result.
You can export any of the four models and reopen it independently. When finished, stop the Modeler and the in-memory demo server with Ctrl+C in their respective terminals.