Adding workflow configuration
Workflow configuration should be created based on the business requirements. The configuration can be inserted using the /businessservice/_create API. To create the workflow configuration refer the following documentation: Configuring Workflows For New Product/Entity
Configuration Details
The Workflow configuration has 3 level of hierarchy:
a. BusinessService
b. State
c. Action
The top level object is BusinessService, it contains fields describing the workflow and list of States that are part of the workflow. The businessService can be defined at tenant level like pb.amritsar or at state level like pb. All objects maintains an audit sub object which keeps track of who is creating and updating and the time of it{ "tenantId": "pb.amritsar", "businessService": "PGR", "business": "pgr-services", "businessServiceSla": 432000000, "states": [...] }
Each State object is a valid status for the application. The State object contains the information of the state and what actions can be performed on it.
{ "sla": 36000000, "state": "PENDINGFORASSIGNMENT", "applicationStatus": "PENDINGFORASSIGNMENT", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": false, "actions": [...] }
The action object is the last object in hierarchy, it defines the name of the action and the roles that can perform the action.
{ "action": "ASSIGN", "roles": [ "GRO", "DGRO" ], "nextState": "PENDINGATLME", }
The workflow should always start from null state as the service treats new applications as having null as the initial state. eg:
In action object whatever nextState is defined, the application will be sent to that state. It can be to another forward state or even some backward state from where the application have already passed
( generally such actions are named SENDBACK)SENDBACKTOCITIZEN is a special keyword for action name. This action sends back the application to citizen’s inbox for him to take action. A new State should be created on which Citizen can take action and should be the nextState of this action. While calling this action from module assignes should be enriched by the module with the uuids of the owners of the application
For our guide, we will be configuring the following workflow -
We will be using the workflow service which is deployed on the sandbox environment. Readers can port-forward workflow service from their sandbox environment to port 8282 using the following command -
Workflow configuration create request for the sample voter-registration service that we are creating in this guide: