fix(replace-menu): a compensation handler can also be a call-activity

closes #603
This commit is contained in:
hoferch91 2016-08-16 15:42:46 +02:00
parent 681869fb44
commit 13a9d24e84
2 changed files with 2 additions and 10 deletions

View File

@ -203,14 +203,6 @@ ReplaceMenuProvider.prototype.getEntries = function(element) {
if (is(businessObject, 'bpmn:FlowNode')) { if (is(businessObject, 'bpmn:FlowNode')) {
entries = filter(replaceOptions.TASK, differentType); entries = filter(replaceOptions.TASK, differentType);
if (businessObject.isForCompensation) {
// can only replace to compensation activities
entries = filter(entries, function(entry) {
return !/CallActivity/.test(entry.target.type);
});
}
// collapsed SubProcess can not be replaced with itself // collapsed SubProcess can not be replaced with itself
if (is(businessObject, 'bpmn:SubProcess') && !isExpanded(businessObject)) { if (is(businessObject, 'bpmn:SubProcess') && !isExpanded(businessObject)) {
entries = reject(entries, function(entry) { entries = reject(entries, function(entry) {

View File

@ -1068,7 +1068,7 @@ describe('features/popup-menu - replace menu provider', function() {
beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
it('should exclude non-activities from options', inject(function(elementRegistry, popupMenu) { it('options should include subProcesses and callActivity', inject(function(elementRegistry, popupMenu) {
// given // given
var taskElement = elementRegistry.get('Task_1'); var taskElement = elementRegistry.get('Task_1');
@ -1080,7 +1080,7 @@ describe('features/popup-menu - replace menu provider', function() {
subProcessEntry = queryEntry(popupMenu, 'replace-with-collapsed-subprocess'); subProcessEntry = queryEntry(popupMenu, 'replace-with-collapsed-subprocess');
// then // then
expect(callActivityEntry).to.not.exist; expect(callActivityEntry).to.exist;
expect(subProcessEntry).to.exist; expect(subProcessEntry).to.exist;
})); }));