I want to connect custom element to custom element

i want to connect custom element to custom element by bpmn:SequenceFlow or bpmn:MessageFlow.

00

There is an error like that when i implement like that.

function canConnect(source, target) {

    // only judge about custom elements
    if (!isCustom(source) && !isCustom(target)) {
      return;
    }

    // allow connection between custom shape and task
    if (isCustom(source)) {
      if (is(target, 'bpmn:Task')) {
        return { type: 'bpmn:SequenceFlow' };
      } else {
        return false;
      }
    } else if (isCustom(target)) {
      if (is(source, 'bpmn:Task')) {
        return { type: 'custom:connection' };
      } else {
        return false;
      }
    }
  }

How do I implement what I want??

Can you please provide a test case for your problem?

1 Like