diff --git a/lib/features/popup-menu/ReplaceMenuProvider.js b/lib/features/popup-menu/ReplaceMenuProvider.js index 538cf710..2aa238e4 100644 --- a/lib/features/popup-menu/ReplaceMenuProvider.js +++ b/lib/features/popup-menu/ReplaceMenuProvider.js @@ -83,7 +83,7 @@ ReplaceMenuProvider.prototype.getEntries = function(element) { return this._createEntries(element, replaceOptions.DATA_OBJECT_REFERENCE); } - if (is(businessObject, 'bpmn:DataStoreReference')) { + if (is(businessObject, 'bpmn:DataStoreReference') && !is(element.parent, 'bpmn:Collaboration')) { return this._createEntries(element, replaceOptions.DATA_STORE_REFERENCE); } diff --git a/test/fixtures/bpmn/features/replace/data-stores-positioned-against-participant.bpmn b/test/fixtures/bpmn/features/replace/data-stores-positioned-against-participant.bpmn new file mode 100644 index 00000000..1619c95e --- /dev/null +++ b/test/fixtures/bpmn/features/replace/data-stores-positioned-against-participant.bpmn @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js b/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js index 3d41eaf8..328add92 100644 --- a/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js +++ b/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js @@ -30,6 +30,7 @@ describe('features/popup-menu - replace menu provider', function() { var diagramXMLMarkers = require('../../../fixtures/bpmn/draw/activity-markers-simple.bpmn'), diagramXMLReplace = require('../../../fixtures/bpmn/features/replace/01_replace.bpmn'), diagramXMLDataElements = require('../../../fixtures/bpmn/features/replace/data-elements.bpmn'), + diagramXMLDataStoresPositionedAgainstParticipant = require('../../../fixtures/bpmn/features/replace/data-stores-positioned-against-participant.bpmn'), diagramXMLParticipants = require('../../../fixtures/bpmn/features/replace/participants.bpmn'); var testModules = [ @@ -1429,6 +1430,41 @@ describe('features/popup-menu - replace menu provider', function() { }); + + describe('data store positioned against participant', function() { + + beforeEach(bootstrapModeler(diagramXMLDataStoresPositionedAgainstParticipant, { modules: testModules })); + + + it('should only contain data object reference', inject(function(elementRegistry) { + + // given + var dataStoreReferenceWithinParticipant = elementRegistry.get('DataStoreReference_0'); + + // when + openPopup(dataStoreReferenceWithinParticipant); + + // then + expect(queryEntries()).to.have.length(1); + expect(queryEntry('replace-with-data-object-reference')).to.exist; + })); + + + it('should contain no reference', inject(function(elementRegistry) { + + // given + var dataStoreReferenceOutsideParticipant = elementRegistry.get('DataStoreReference_1'); + + // when + openPopup(dataStoreReferenceOutsideParticipant); + + // then + expect(queryEntries()).to.have.length(0); + expect(queryEntry('replace-with-data-object-reference')).to.be.null; + })); + + }); + });