feat(core/BpmnRegistry): api accepts element#id
This commit is contained in:
parent
418003a916
commit
a842ee80a6
|
@ -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];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue