mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-26 04:32:44 +08:00
chore(group-behavior): move category creation to util
This commit is contained in:

committed by
merge-me[bot]
![merge-me[bot]](/assets/img/avatar_default.png)
parent
bc4b6cbfd8
commit
57f516ef32
@ -12,6 +12,9 @@ import {
|
||||
is
|
||||
} from '../../../util/ModelUtil';
|
||||
|
||||
import {
|
||||
createCategoryValue
|
||||
} from './util/CategoryUtil';
|
||||
|
||||
/**
|
||||
* BPMN specific Group behavior
|
||||
@ -146,17 +149,8 @@ export default function GroupBehavior(eventBus, bpmnFactory, canvas, elementRegi
|
||||
|
||||
if (is(businessObject, 'bpmn:Group') && !businessObject.categoryValueRef) {
|
||||
|
||||
var definitions = getDefinitions();
|
||||
|
||||
var categoryValue = bpmnFactory.create('bpmn:CategoryValue'),
|
||||
category = bpmnFactory.create('bpmn:Category', {
|
||||
categoryValue: [ categoryValue ]
|
||||
});
|
||||
|
||||
// add to correct place
|
||||
collectionAdd(definitions.get('rootElements'), category);
|
||||
getBusinessObject(category).$parent = definitions;
|
||||
getBusinessObject(categoryValue).$parent = category;
|
||||
var definitions = getDefinitions(),
|
||||
categoryValue = createCategoryValue(definitions, bpmnFactory);
|
||||
|
||||
// link the reference to the Group
|
||||
businessObject.categoryValueRef = categoryValue;
|
||||
|
Reference in New Issue
Block a user