diff --git a/lib/features/rules/BpmnRules.js b/lib/features/rules/BpmnRules.js index d0d4ecde..848b66f5 100644 --- a/lib/features/rules/BpmnRules.js +++ b/lib/features/rules/BpmnRules.js @@ -619,12 +619,12 @@ function canConnectSequenceFlow(source, target) { function canConnectDataAssociation(source, target) { - if (is(source, 'bpmn:DataObjectReference') && + if (isAny(source, [ 'bpmn:DataObjectReference', 'bpmn:DataStoreReference' ]) && isAny(target, [ 'bpmn:Activity', 'bpmn:ThrowEvent' ])) { return { type: 'bpmn:DataInputAssociation' }; } - if (is(target, 'bpmn:DataObjectReference') && + if (isAny(target, [ 'bpmn:DataObjectReference', 'bpmn:DataStoreReference' ]) && isAny(source, [ 'bpmn:Activity', 'bpmn:CatchEvent' ])) { return { type: 'bpmn:DataOutputAssociation' }; } diff --git a/test/spec/features/rules/BpmnRules.process.bpmn b/test/spec/features/rules/BpmnRules.process.bpmn index c7b97fa1..5882a014 100644 --- a/test/spec/features/rules/BpmnRules.process.bpmn +++ b/test/spec/features/rules/BpmnRules.process.bpmn @@ -1,80 +1,88 @@ - + - + - + - + - + - + - + - - - - + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + \ No newline at end of file diff --git a/test/spec/features/rules/BpmnRulesSpec.js b/test/spec/features/rules/BpmnRulesSpec.js index 09b5e49e..981c929d 100644 --- a/test/spec/features/rules/BpmnRulesSpec.js +++ b/test/spec/features/rules/BpmnRulesSpec.js @@ -188,6 +188,95 @@ describe('features/modeling/rules - BpmnRules', function() { dataAssociation: { type: 'bpmn:DataInputAssociation' } }); })); + + + it('connect DataStoreReference -> StartEvent_None', inject(function() { + + expectCanConnect('DataStoreReference', 'StartEvent_None', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: false + }); + })); + + + it('connect StartEvent_None -> DataStoreReference', inject(function() { + + expectCanConnect('StartEvent_None', 'DataStoreReference', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: { type: 'bpmn:DataOutputAssociation' } + }); + })); + + + it('connect DataStoreReference -> EndEvent_None', inject(function() { + + expectCanConnect('DataStoreReference', 'EndEvent_None', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: { type: 'bpmn:DataInputAssociation' } + }); + })); + + + it('connect EndEvent_None -> DataStoreReference', inject(function() { + + expectCanConnect('EndEvent_None', 'DataStoreReference', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: false + }); + })); + + + it('connect Task -> DataStoreReference', inject(function() { + + expectCanConnect('Task', 'DataStoreReference', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: { type: 'bpmn:DataOutputAssociation' } + }); + })); + + + it('connect DataStoreReference -> Task', inject(function() { + + expectCanConnect('DataStoreReference', 'Task', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: { type: 'bpmn:DataInputAssociation' } + }); + })); + + + it('connect SubProcess -> DataStoreReference', inject(function() { + + expectCanConnect('SubProcess', 'DataStoreReference', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: { type: 'bpmn:DataOutputAssociation' } + }); + })); + + + it('connect DataStoreReference -> SubProcess', inject(function() { + + expectCanConnect('DataStoreReference', 'SubProcess', { + sequenceFlow: false, + messageFlow: false, + association: true, + dataAssociation: { type: 'bpmn:DataInputAssociation' } + }); + })); + });