It is now working like this.
Please give me a solution.
There is no change in BpmnOrderingProvider,
<CustomRules.js>
function canConnectSequenceFlow(source, target) {
return isSequenceFlowSource(source) &&
isSequenceFlowTarget(target) &&
// isSameScope(source, target) && // deleted
!(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));
}
<CustomReplaceConnectionBehavior.js>
function fixConnection(connection) {
var source = connection.source,
target = connection.target,
parent = connection.parent;
// do not do anything if connection
// is already deleted (may happen due to other
// behaviors plugged-in before)
if (!parent) {
return;
}
var replacementType,
remove;
/**
* Check if incoming or outgoing connections
* can stay or could be substituted with an
* appropriate replacement.
*
* This holds true for SequenceFlow <> MessageFlow.
*/
if (is(connection, 'bpmn:SequenceFlow')) {
if (!customRules.canConnectSequenceFlow(source, target)) {
// remove = true;
}
if (customRules.canConnectMessageFlow(source, target)) {
replacementType = 'bpmn:MessageFlow';
}
}
// transform message flows into sequence flows, if possible
if (is(connection, 'bpmn:MessageFlow')) {
if (!customRules.canConnectMessageFlow(source, target)) {
remove = true;
}
if (customRules.canConnectSequenceFlow(source, target)) {
replacementType = 'bpmn:SequenceFlow';
}
}
if (is(connection, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
remove = true;
}
// remove invalid connection, // deleted
// unless it has been removed already
// if (remove) {
// modeling.removeConnection(connection);
// }
// replace SequenceFlow <> MessageFlow
// if (replacementType) { // deleted
// modeling.connect(source, target, {
// type: replacementType,
// waypoints: connection.waypoints.slice()
// });
// }
}
and, white rectangle is ‘Bpmn:SubProcess’, blue rectangle is ‘Bpmn:Task’.
and connection is ‘Bpmn:SequenceFlow’.
and other source is same