Skip to main content

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.

  1. In Process fields, add amount as decimal and eligible as Boolean.
  2. Insert a Service Task called Check amount between the parallel join and the end event. Select it and set Handler key to check-amount.
  3. Use Add input mapping to select amount and Add output mapping to select eligible. 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.

Terminal window
node run-workflow.ts tutorial service detailed file-first

The 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.