The demo workflow, transition by transition
| Start state | Event | End state | Actions |
|---|---|---|---|
| NEW | APPLY (citizen, agent) | PAYMENT_PENDING | Breaking BILL_ID_GENERATION. endStateTwo PENDING_ASSIGN_OFFICE when free |
| PAYMENT_PENDING | PAY (system) | PENDING_ASSIGN_OFFICE | nextEvent ASSIGN_OFFICE, "submitted" notification |
| PAYMENT_PENDING | EXPIRE_PAYMENT (system) | PAYMENT_EXPIRED | |
| PAYMENT_EXPIRED | PAY (system) | PENDING_ASSIGN_OFFICE | A late payment still counts |
| PENDING_ASSIGN_OFFICE | ASSIGN_OFFICE (system) | PENDING_OFFICER_PROCESSING | Breaking OFFICE_ASSIGNMENT, fixed office |
| PENDING_OFFICER_PROCESSING | APPROVE (officer) | APPROVED | Breaking GENERATE_CERTIFICATE + notification with the certificate |
| PENDING_OFFICER_PROCESSING | REJECT (officer) | REJECTED | Notification with the officer comment |
| PENDING_OFFICER_PROCESSING | REQUEST_FOR_ACTION (officer) | PENDING_RESUBMISSION | Notification |
| PENDING_RESUBMISSION | SUBMIT_RFA (citizen, agent) | PENDING_OFFICER_PROCESSING |

5. Workflow: an empty workflow

The visual editor
Gotcha · some warnings are expected
The editor warns System event "PAY" from "PAYMENT_PENDING" is never triggered on system events such as PAY or EXPIRE_PAYMENT: nothing in the workflow fires them, because IremboPay and the scheduler do. That warning is expected. Read the others: a transition to a state that does not exist is not blocked on save (lesson D4).

Click a state: its panel

Click a transition: who can fire it

The OFFICE_ASSIGNMENT action on ASSIGN_OFFICE

The workflow wizard walks through the settings one page at a time

Wizard: expected processing time (the demo: 1 day)

Wizard: office assignment

Wizard: validation before saving

Wizard: next steps shown to the applicant
Gotcha · the Condition field is code, not a label
We typed "After submission" in Condition: the step never showed. The field is a JavaScript expression evaluated in the browser over the form data and the application (for example
model => model.price > 0). Plain text throwsSyntaxErrorin the browser console and hides the step silently. Leave it empty to always show the step. We fixed it with a Service Improvement (lesson D3).

Code view: the whole workflow as JSON
One transition of the demo workflow
{
"startState": "PENDING_ASSIGN_OFFICE",
"event": "ASSIGN_OFFICE",
"systemAuthorised": true,
"endStateOne": {
"stateCode": "PENDING_OFFICER_PROCESSING",
"breakingAction": {
"actionType": "OFFICE_ASSIGNMENT",
"args": {
"officeAssignmentType": "CODE_FIXED_OFFICE",
"officeLevel": "LEVEL_1",
"officeId": "bf863562-a69e-4670-9baf-2b904b2e805d"
}
}
}
}
Tip · reference
Workflow overview · Events · Actions · Workflow templates · Next steps.
After PAY, the demo application must reach an officer with no human action. How?
B. The nextEvent fires ASSIGN_OFFICE as soon as the state is reached. If OFFICE_ASSIGNMENT fails, the application stays in PENDING_ASSIGN_OFFICE and no officer ever sees it.
← A8 · Workflow fundamentals · A10 · Officer form: data the officer adds →