How to use the camunda-external-task-client-js.File function in camunda-external-task-client-js

To help you get started, we’ve selected a few camunda-external-task-client-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github camunda / camunda-external-task-client-js / examples / order / index.js View on Github external
client.subscribe("invoiceCreator", async function({ task, taskService }) {
  // Put your business logic
  // complete the task
  const date = new Date();
  const invoice = await new File({ localPath: "./assets/invoice.txt" }).load();
  const minute = date.getMinutes();
  const variables = new Variables().setAll({ invoice, date });

  // check if minute is even
  if (minute % 2 === 0) {
    // for even minutes, store variables in the process scope
    await taskService.complete(task, variables);
  } else {
    // for odd minutes, store variables in the task local scope
    await taskService.complete(task, null, variables);
  }
});

camunda-external-task-client-js

Implement your [BPMN Service Task](https://docs.camunda.org/manual/latest/user-guide/process-engine/external-tasks/) in NodeJS.

Apache-2.0
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis

Similar packages