A simple order process for the Camunda Automation Platform using the camunda-external-task-client-js
- NodeJS >= v10
- Developed and tested against camunda-external-task-client-js v2.1.1 and
- camunda automation platform run v7.16
- start the Camunda engine
- deploy the bpmn/dmn models
- Create a node project:
npm init -y
- Install dependencies:
npm install camunda-external-task-client-js
npm install got
- Start the external task worker
node ./server.js
The example consists of two processes, the order process and the payment process.
The order process creates all order relevant data like order ID, items, item price, item quantity, discount calculation and triggers the payment process via message.
The payment process will acknowledge the payment or will be canceled in case of exceeding a transaction limit if credit card payment is needed.
All service tasks are implemented as external tasks and use the camunda-external-task-client-js to communicate with the engine.
The following topics are covered in this example: external task pattern, error handling with external tasks, message correlation, compensation events, dmn tables.
The happy path of the payment process s tested with a Postman Collection. Proceed the following steps to run the test suit:
- Import the prepared Postman collection into your Postman
- Select the payment.bpmn process model in the deploy request
- Run the collection.