How to know which element is connected (sequenceflow) to a task

You can find this out by accessing the businessObject of an element

var elementRegistry = modeler.get('elementRegistry'),
  task = elementRegistry.get('Task_1ycg1p3'),
  businessObject = task.businessObject;

var outgoingConnections = businessObject.outgoing;
var incoming = businessObject.incoming;

Which will get you the connections for the task. With them, you could then indirectly get the connected elements with the outgoing and incoming properties once again.

1 Like