DIGIT CORE
Search…
Adding Workflow Configuration
Workflow configuration should be created based on the business requirements. More details on extracting workflow in the design guide.
For our guide, we will be configuring the following workflow which was the output of the design phase:
Workflow states, actions and actors
We will re-use the workflow service which is deployed in the dev/sandbox environment.
This guide assumes you can call the dev environment workflow service directly with a valid auth token. A sample curl is posted below. Please make sure to replace the server hostname and the username and password in the below statement:
curl --location --request POST 'https://yourserver.digit.org/user/oauth/token' \
--header 'Authorization: Basic ZWdvdi11c2VyLWNsaWVudDo=' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'scope=read' \
--data-urlencode 'username=<mobile_no_of user>' \
--data-urlencode 'password=<pwd_you_created>' \
--data-urlencode 'tenantId=<your_tenant_id>' \
--data-urlencode 'userType=CITIZEN'
In POSTMan, create a new POST request and paste the below content in the body. The URI for the request is http://yourserver.digit.org/egov-workflow-v2/egov-wf/businessservice/_create to create the workflow.
Make sure to replace the authToken field in the body with appropriate auth token in your environment. Login to the server as a CITIZEN or EMPLOYEE user (depending on which one you've created) and obtain the authToken from the response body.
{
"RequestInfo": {
"apiId": "Rainmaker",
"action": "",
"did": 1,
"key": "",
"msgId": "20170310130900|en_IN",
"requesterId": "",
"ts": 1513579888683,
"ver": ".01",
"authToken": "{{devAuth}}"
},
"BusinessServices": [
{
"tenantId": "pb",
"businessService": "BTR",
"business": "birth-registration",
"businessServiceSla": 432000000,
"states": [
{
"sla": null,
"state": null,
"applicationStatus": null,
"docUploadRequired": true,
"isStartState": true,
"isTerminateState": false,
"isStateUpdatable": true,
"actions": [
{
"action": "APPLY",
"nextState": "APPLIED",
"roles": [
"CITIZEN",
"EMPLOYEE"
]
}
]
},
{
"sla": null,
"state": "APPLIED",
"applicationStatus": "APPLIED",
"docUploadRequired": false,
"isStartState": false,
"isTerminateState": true,
"isStateUpdatable": false,
"actions": [
{
"action": "APPROVE",
"nextState": "APPROVED",
"roles": [
"EMPLOYEE"
]
},
{
"action": "REJECT",
"nextState": "REJECTED",
"roles": [
"EMPLOYEE"
]
}
]
},
{
"sla": null,
"state": "APPROVED",
"applicationStatus": "APPROVED",
"docUploadRequired": false,
"isStartState": false,
"isTerminateState": false,
"isStateUpdatable": false,
"actions": [
{
"action": "PAY",
"nextState": "REGISTRATIONCOMPLETED",
"roles": [
"SYSTEM_PAYMENT",
"CITIZEN",
"EMPLOYEE"
]
}
]
},
{
"sla": null,
"state": "REJECTED",
"applicationStatus": "REJECTED",
"docUploadRequired": false,
"isStartState": false,
"isTerminateState": true,
"isStateUpdatable": false,
"actions": null
},
{
"sla": null,
"state": "REGISTRATIONCOMPLETED",
"applicationStatus": "REGISTRATIONCOMPLETED",
"docUploadRequired": false,
"isStartState": false,
"isTerminateState": true,
"isStateUpdatable": false,
"actions": null
}
]
}
]
}
All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.
Copy link