This POC includes Camunda BPMN file to be deployed on a Camunda server, and a node js script to consume topics/events to and from this deployment. Also included is a Postman collection to send messages to Camunda server to "notify" completion of tasks.
Purpose of this illustration is to show a workflow process for insurance claims starting from Claim being filed -> Surveyor Assessment -> Adjustor Approval -> Workshop repair completion -> Payment -> Claim success. The actual code for above is mocked. The node.js script will consume topics from Camunda deployment, and Postman collection has APIs to provide events to Camunda server.
- Camunda Modeler application is installed.
- Camunda server deployed and running on URL http://localhost:8077/
- Node.js runtime installed.
- Postman application installed.
Assuming Camunda server is deployed on URL http://localhost:8077/ . Change subsequent URLs accordingly.
- Open
Claim_Process.bpmn
(incamunda_BPMN
folder) in Camunda Modeler application, and click on deploy button. - Enter Deployment name
Claim_Process
and Camunda server engine URL http://localhost:8077/engine-rest (change as needed) - Check process definition deployment on Camunda server http://localhost:8077/camunda/app/cockpit/default/#/processes as
CLAIM_PROCESS
- Install dependencies:
npm install
- Run following command to start the nodejs app:
node src/claim_process.js
- Go to Postman application and click on Import
- Select file
CLAIMS_POC.postman_collection.json
(inpostman_collection
folder) and import it.
After completing the above steps:
- Go to postman collection and run the
START CLAIM PROCESS
API.- This will initiate the claims workflow.
- Flow will move to the first task:
Notify and assign incident manager, adjustor and surveyor
. This is an external task, the node.js script will receive this topic event and print an output to console signifying processing of this step. It will then mark it as complete. - Flow will now move to next task
Surveyor assess change and upload report
. This is areceive task
i.e. Camunda will wait for an external call.- From postman, call the
SURVEYOR ASSESSMENT
API. - This will mock completion of this task.
- To check failure case, pass the
value
in post body in Postman API as false. This will lead to end of workflow, with an unsuccessful response.
- From postman, call the
- Flow will move to the
Adjustor evaluate claim
task.- From postman, call the
ADJUSTOR ASSESSMENT
API. - This will mock completion of this task.
- From postman, call the
- Now the
Notify User and Workshop amount approved
will be called parallelly (logged in nodejs app console) along with flow moving toWorkshop upload final bill and job sheet after repair
.- From postman, call the
WORKSHOP FINAL UPDATE
API. - This will mock completion of this task.
- From postman, call the
- Similar to previous step,
Notify user with payment details
step will be called parallelly (logged in nodejs app console) and flow will reachCustomer Payment
task, waiting for customer to complete payment.- From postman, call the
CUSTOMER PAYMENT CALLBACK
API. - This will mock successful payment.
- To check failure case, pass the
value
in post body in Postman API as false. This will pass flow toNotify user
task, consumed by the nodejs app, which will log to console and send flow back to theNotify user with payment details
task.
- From postman, call the
- After mocking successful payment, flow will move to the
Vehicle delivered / collected
task.- From postman, call the
WORKSHOP FINAL UPDATE
API. - This will mock completion of this task.
- From postman, call the
- Finally, flow will reach the end event, which will be consumed in the nodejs app. It will display a final console message, and workflow will be completed.