I am newbie to camunda by using NodeJS External Task and rest call (http://localhost:8080/engine-rest/process-definition/key/create-user/start) I need to execute and complete task one after the another could you please guide me on the same.
So are you asking how you would build an external task client that can complete work on more than one topic?
Do you have a model you can show?
Yes Correct, Pls find the attached model.Ticket.bpmn (3.8 KB)
This code should work.
const { Client, logger } = require("camunda-external-task-client-js");
const config = { baseUrl: "http://localhost:8080/engine-rest", use: logger };
const client = new Client(config);
client.subscribe("NumberOfPerson", async function({ task, taskService }) {
console.log("Started");
await taskService.complete(task);
console.log("finisehd");
});
client.subscribe("SelectDate", async function({ task, taskService }) {
console.log("Started");
await taskService.complete(task);
console.log("finisehd");
});
client.subscribe("SelectRoom", async function({ task, taskService }) {
console.log("Started");
await taskService.complete(task);
console.log("finisehd");
});
Hey @Niall Thanks for your promt reply.
To start process I am using http://localhost:8080/engine-rest/process-definition/key/TicketBooking/start and that is working fine.
but now I wanted to know how to complete NumberOfPerson then SelectDate and SelectRoom one after another using API call means which API I should refer ?
If you’re using the Camunda Platform Run distro you should be able to go to
http://localhost:8080/swaggerui/#/
Looks for the External Task section for more details
Alternatively you can go to docs.camunda.org and take a look at the external task rest docs.