fix(rules): allow associations where data associations are allowed, too

Related to https://github.com/camunda/camunda-modeler/issues/1635
This commit is contained in:
Nico Rehwaldt 2019-12-16 14:37:09 +01:00 committed by fake-join[bot]
parent 31b813097b
commit 4a675b3780
2 changed files with 20 additions and 35 deletions

View File

@ -802,7 +802,13 @@ function canConnectAssociation(source, target) {
} }
// allow connection of associations between <!TextAnnotation> and <TextAnnotation> // allow connection of associations between <!TextAnnotation> and <TextAnnotation>
return isOneTextAnnotation(source, target); if (isOneTextAnnotation(source, target)) {
return true;
}
// can connect associations where we can connect
// data associations, too (!)
return !!canConnectDataAssociation(source, target);
} }
function canConnectMessageFlow(source, target) { function canConnectMessageFlow(source, target) {

View File

@ -296,7 +296,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('StartEvent_None', 'DataObjectReference', { expectCanConnect('StartEvent_None', 'DataObjectReference', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataOutputAssociation' } dataAssociation: { type: 'bpmn:DataOutputAssociation' }
}); });
})); }));
@ -307,7 +307,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('DataObjectReference', 'EndEvent_None', { expectCanConnect('DataObjectReference', 'EndEvent_None', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataInputAssociation' } dataAssociation: { type: 'bpmn:DataInputAssociation' }
}); });
})); }));
@ -329,7 +329,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('Task', 'DataObjectReference', { expectCanConnect('Task', 'DataObjectReference', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataOutputAssociation' } dataAssociation: { type: 'bpmn:DataOutputAssociation' }
}); });
})); }));
@ -340,7 +340,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('DataObjectReference', 'Task', { expectCanConnect('DataObjectReference', 'Task', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataInputAssociation' } dataAssociation: { type: 'bpmn:DataInputAssociation' }
}); });
})); }));
@ -351,7 +351,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('SubProcess', 'DataObjectReference', { expectCanConnect('SubProcess', 'DataObjectReference', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataOutputAssociation' } dataAssociation: { type: 'bpmn:DataOutputAssociation' }
}); });
})); }));
@ -362,7 +362,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('DataObjectReference', 'SubProcess', { expectCanConnect('DataObjectReference', 'SubProcess', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataInputAssociation' } dataAssociation: { type: 'bpmn:DataInputAssociation' }
}); });
})); }));
@ -428,7 +428,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('StartEvent_None', 'DataStoreReference', { expectCanConnect('StartEvent_None', 'DataStoreReference', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataOutputAssociation' } dataAssociation: { type: 'bpmn:DataOutputAssociation' }
}); });
})); }));
@ -439,7 +439,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('DataStoreReference', 'EndEvent_None', { expectCanConnect('DataStoreReference', 'EndEvent_None', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataInputAssociation' } dataAssociation: { type: 'bpmn:DataInputAssociation' }
}); });
})); }));
@ -461,7 +461,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('Task', 'DataStoreReference', { expectCanConnect('Task', 'DataStoreReference', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataOutputAssociation' } dataAssociation: { type: 'bpmn:DataOutputAssociation' }
}); });
})); }));
@ -472,7 +472,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('DataStoreReference', 'Task', { expectCanConnect('DataStoreReference', 'Task', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataInputAssociation' } dataAssociation: { type: 'bpmn:DataInputAssociation' }
}); });
})); }));
@ -483,7 +483,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('SubProcess', 'DataStoreReference', { expectCanConnect('SubProcess', 'DataStoreReference', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataOutputAssociation' } dataAssociation: { type: 'bpmn:DataOutputAssociation' }
}); });
})); }));
@ -494,7 +494,7 @@ describe('features/modeling/rules - BpmnRules', function() {
expectCanConnect('DataStoreReference', 'SubProcess', { expectCanConnect('DataStoreReference', 'SubProcess', {
sequenceFlow: false, sequenceFlow: false,
messageFlow: false, messageFlow: false,
association: false, association: true,
dataAssociation: { type: 'bpmn:DataInputAssociation' } dataAssociation: { type: 'bpmn:DataInputAssociation' }
}); });
})); }));
@ -666,17 +666,6 @@ describe('features/modeling/rules - BpmnRules', function() {
})); }));
it('connect EventBasedGateway -> IntermediateCatchEvent_Message', inject(function() {
expectCanConnect('EventBasedGateway', 'IntermediateCatchEvent_Message', {
sequenceFlow: true,
messageFlow: false,
association: false,
dataAssociation: false
});
}));
it('connect EventBasedGateway -> IntermediateCatchEvent_Signal', inject(function() { it('connect EventBasedGateway -> IntermediateCatchEvent_Signal', inject(function() {
expectCanConnect('EventBasedGateway', 'IntermediateCatchEvent_Signal', { expectCanConnect('EventBasedGateway', 'IntermediateCatchEvent_Signal', {
@ -764,17 +753,6 @@ describe('features/modeling/rules - BpmnRules', function() {
}); });
})); }));
it('connect EventBasedGateway -> ParallelGateway', inject(function() {
expectCanConnect('EventBasedGateway', 'ParallelGateway', {
sequenceFlow: false,
messageFlow: false,
association: false,
dataAssociation: false
});
}));
}); });
describe('Task -> EventBasedGateway target with incoming sequence flow', function() { describe('Task -> EventBasedGateway target with incoming sequence flow', function() {
@ -1498,6 +1476,7 @@ describe('features/modeling/rules - BpmnRules', function() {
move: true move: true
}); });
})); }));
}); });