How to Dynamically Get Task ID After Applying Element Template in BPMN.io?

Hi BPMN.io community,

I’m working on a workflow implementation where I need to create a link between tasks and workflow IDs after applying element templates.

Current Scenario:

  • I’m using @bpmn-io/element-template-chooser to apply templates to tasks

  • I need to capture the task ID after a template is applied

  • This ID needs to be linked with a workflow ID in my application

Specific Questions:

  1. Is there an event or callback that triggers after a template is applied to a task?

  2. How can I dynamically get the task ID after applying a template?

  3. What’s the best way to listen for template application events?

1 Like

To summarize your issue: You’d like to know when an element template got applied, because you want to trigger a follow-up action.

Two things to consider:

  • Should the follow-up action be part of the same action, then you want to hook into the apply template command
  • Or do you want to be notified after the template is applied, to perform an asynchronous action?