bpmn-js-properties-panel
Advanced tools
Comparing version 0.11.0 to 0.11.1
@@ -128,9 +128,9 @@ 'use strict'; | ||
var newExecutionListener = createCamundaExecutionListener(newTemplate, bpmnFactory), | ||
oldExecutionsListener; | ||
var newExecutionListeners = createCamundaExecutionListener(newTemplate, bpmnFactory), | ||
oldExecutionsListeners; | ||
if (newExecutionListener) { | ||
if (newExecutionListeners.length) { | ||
var extensionElements = getOrCreateExtensionElements(element); | ||
oldExecutionsListener = findExtensions(extensionElements, [ 'camunda:ExecutionListener' ]); | ||
oldExecutionsListeners = findExtensions(extensionElements, [ 'camunda:ExecutionListener' ]); | ||
@@ -141,4 +141,4 @@ commandStack.execute('properties-panel.update-businessobject-list', { | ||
propertyName: 'values', | ||
objectsToAdd: newExecutionListener, | ||
objectsToRemove: oldExecutionsListener | ||
objectsToAdd: newExecutionListeners, | ||
objectsToRemove: oldExecutionsListeners | ||
}); | ||
@@ -145,0 +145,0 @@ } |
{ | ||
"name": "bpmn-js-properties-panel", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"description": "A simple properties panel for bpmn-js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -368,2 +368,49 @@ 'use strict'; | ||
describe('override behavior', function() { | ||
describe('camunda:executionListener', function() { | ||
var diagramXML = require('./task-execution-listener.bpmn'); | ||
var newTemplate = require('./ws-properties'); | ||
beforeEach(bootstrapModeler(diagramXML, { | ||
container: container, | ||
modules: [ | ||
coreModule, | ||
modelingModule, | ||
propertiesPanelCommandsModule, | ||
elementTemplatesModule | ||
], | ||
moddleExtensions: { | ||
camunda: camundaModdlePackage | ||
} | ||
})); | ||
it('should keep old if unspecified', inject(function(elementRegistry) { | ||
// given | ||
var taskShape = elementRegistry.get('Task_1'); | ||
// when | ||
applyTemplate(taskShape, newTemplate); | ||
var executionListeners = findExtensions(taskShape, [ 'camunda:ExecutionListener' ]); | ||
// then | ||
expect(executionListeners).to.jsonEqual([ | ||
{ | ||
$type: 'camunda:ExecutionListener', | ||
class: 'foo.Bar', | ||
event: 'start' | ||
} | ||
]); | ||
})); | ||
}); | ||
}); | ||
}); | ||
@@ -370,0 +417,0 @@ |
1774089
290
36140