If there is no pool present the newParent is a “bpmn:Process” and it works, with a pool it’s “bpmn:Collaboration” and it doesnt.
This behaviour is already possible with “bpmn:DataStoreReference”. If i create a DataStoreReference the newParent is always a “bpmn:Process”. How can i achieve this with other elements? Do i have to write somehting like DataStoreReferenceBehaviour? If so any tipps how to start, seems quite complex
To make things simpler these elements wont be connected to anything else! They will only be present outside of a pool, bascially my company wants to visually support diagramms.
Btw i already know this is possible with custom elements, as seen in your example. However i want to be able to export these elements like you do with “bpmn:DataStroreReference”.
The answer seems to be rather simple. Instead of using “bpmn:Task” use the superClass “bpmn:DataStoreReference”.
After enabling drop outside of pools for your custom element, you can create it there and it also gets exported per XML.
After my testing it seems like it inherits all the behaviour of “bpmn:DataStoreReference”.
At the beginning of every process there is one “Phase” present. Then the user can drop another phase only on top of this “Phase”.
After that i implemented a simple layout that positiones the elements next to each other. In between them a line is created.
Their purpose is similar to lanes, they are supposed to represent temporal phases of the process. Also the user can resize them only horizontally, he cant move them connect them etc.
After some testing this works okay at best.
I can export und import them. The XML looks like this:
However i can only ex- and import one element. Also as you can see in the picture it calls
the create externalLabel(). Thats the reason why there are two names present. In my customRenderer
i created a renderEmbeddedLabel(). For every other custom element this works. In this case it seems like the dataStoreReference unique behaviour cant be overwritten that easily.
If necessary the Json file:
I would prefer creating this element by “superClass”: [ “bpmn:Task” ], to avoid the sideeffects.
However then i am unable to place the element outside the pool while being able to ex- and import it.
Do you have a suggestion?
Is it possible to place custom elements outside of a pool and still import and export them?
(Given i extended them properly)
Or is the best way to use DataStoreReference and try to implement my own behaviour?
have to report that it actually works just fine. So if anybody wants a custom artifact just extend the dataobject.
Smart as I am I tested modeling.updateProperties in my custom behaviour and set an illegal id.
That was the entire Problem…
To fix the label I just had to adjust 5 lines…
I don’t think using data store references as the superclass makes sense. This is basically a hack. Is the phase arrow supposed to have any BPMN 2.0 semantics? You might be better off using overlays to display the arrow.
I would build this using overlays since the arrows are meant to visualize the phases (which would otherwise be hidden in the XML since they have no visual representation) but aren’t actual elements in the diagram. That would require some effort of course. Inheriting from bpmn:DataStoreReference makes no sense so I’d say don’t do it.