Setting Up Workflows
Overview
Each service integrated with the egov-workflow-v2 service needs to first define the workflow configuration which describes the states in the workflow, the action that can be taken on these states, who all can perform those actions, SLA etc. This configuration is created using APIs and is stored in DB. The configuration can be created at either the state level or the tenant level based on the requirements.
Pre-requisites
Before you proceed with the configuration, make sure the following pre-requisites are met -
egov-workflow-v2 service is up and running
Role Action mapping is added for the BusinessService APIs
Key Functionalities
Create and modify workflow configuration
Configure State level as well BusinessService level SLA
Control access to workflow actions from the configuration
Validates if the flow defined in the configuration is complete during the creation
Deployment Details
Deploy the latest version of egov-workflow-v2 service
Add Role-Action mapping for BusinessService APIs (preferably add _create and update only for SUPERUSER. search can be added for CITIZEN and required employee roles like TL__CEMP etc. )
Overwrite the egov.wf.statelevel flag ( true for state level and false for tenant level)
Add businessService persister yaml path in persister configuration
Configuration Details
Create the businessService JSON based on product requirements. Following is a sample json of a simple 2-step workflow where an application can be applied by a citizen or counter employees and then can be either rejected or approved by the approver.
Once the businessService json is created add it in the request body of _create API of workflow and call the API to create the workflow.
To update the workflow first search the workflow object using _search API and then make changes in the businessService object and then call _update using the modified search result. (States cannot be removed using _update API as it will leave applications in that state in an invalid state. In such cases first, all the applications in that state should be moved forward or backward state and then the state should be disabled through DB directly)
Integration Details
Integration Scope
The workflow configuration can be used by any module which performs a sequence of operations on an application/Entity. It can be used to simulate and track processes within organisations to increase efficiency and accountability.
Integration Benefits
Integrating with workflow service provides a way to have a dynamic workflow configuration which can be easily modified according to the changing requirements. The modules don’t have to deal with any validations regarding workflows such as authorisation of the user to take an action. If documents are required to be uploaded at a certain stage etc. as they are automatically handled by the egov-workflow-v2 service based on the configuration defined. It also automatically keeps updating SLA for all applications and provides a way to track the processing time of an application.
Steps to Integration
To integrate, host of egov-workflow-v2 should be overwritten in the helm chart
/egov-workflow-v2/egov-wf/businessservice/_search should be added as the endpoint for searching workflow configuration. (Other endpoints are not required once workflow configuration is created)
The configuration can be fetched by calling _search API
Reference Docs
Doc Links
Description | Link |
---|---|
Workflow Service Documentation |
API List
Description | Link |
---|---|
_create | |
_update | |
_search |
(Note: All the APIs are in the same postman collection therefore the same link is added in each row)
__
Last updated