diff --git a/lib/core/BpmnRegistry.js b/lib/core/BpmnRegistry.js index acd5133c..7fdb6fa1 100644 --- a/lib/core/BpmnRegistry.js +++ b/lib/core/BpmnRegistry.js @@ -1,12 +1,13 @@ -var bpmnModule = require('../di').defaultModule; +var _ = require('lodash'); +var bpmnModule = require('../di').defaultModule; /** * @class * * A registry that keeps track of bpmn semantic / di elements and the * corresponding shapes. - * + * * @param {EventBus} events * @param {ElementRegistry} elementRegistry */ @@ -39,8 +40,8 @@ function BpmnRegistry(events, elementRegistry) { function get(type) { var collection = elements[type]; - return function(id) { - return collection[id]; + return function(element) { + return collection[_.isObject(element) ? element.id : element]; }; }