The support for data collections is currently incomplete and/or broken:
- Even if the attribute
isCollection
is set totrue
, the classBpmnRenderer
does not add the corresponding marker to the data object shape. - The attribute
isCollection
is not serialized in the BPMN/XML file. - There is not an icon for data collection that can be used within the modeler palette.
To describe the workaround that I found, let us assume that we set up the modeler’s palette with the following snippet (based on the custom elements example):
'create.data-object-collection': createAction(
'bpmn:DataObjectReference', 'data-object', 'bpmn-icon-data-object',
'Create data object collection', {isCollection: true}
)
With the above, I can create a data object element with the attribute isCollection
set to true. I found that BpmnRenderer
decides whether to add the collection marker to the data object shape or not in lines 144-148:
var semantic = getSemantic(element);
if (isCollection(semantic)) {
renderDataItemCollection(parentGfx, element);
}
Hence, I patched the same lines of code as follows:
var semantic = getSemantic(element);
if (isCollection(semantic) || isCollection(element)) {
renderDataItemCollection(parentGfx, element);
}
which solves the first bullet point in my list of issues above. That said, I could try to write a custom bpmn renderer and get my modeler working as required. However, I also thought the problem is probably a bug you are not aware of, and that it makes sense to fix it in the right place (i.e. BpmnRenderer).
Now, another possibility is that the palette has to be set up in a different way. Maybe, this is also the reason why the attribute isCollection
is not serialized into the XML document.