# Create Elements outside Pool like DataStoreReference

**URL:** <https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051>\
**Category:** Developers\
**Created:** [December 22, 2021, 11:20am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051 "2021-12-22T11:20:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axel\_Ruckert](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Axel\_Ruckert](https://forum.bpmn.io/u/Axel_Ruckert)\
**Post date:** [December 22, 2021, 11:20am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/1 "2021-12-22T11:20:24Z")

</div>

Hi,

i have a question regarding BpmnUpdater.

My goal is to create elements outside of a pool.

I believe i already found the reason why this is not working. As stated here, [Process Elements outside of a Pool - #2 by barmac](https://forum.bpmn.io/t/process-elements-outside-of-a-pool/5934/2)  
" To make it easier for our users we clearly distinguish between _process_ and _collaboration_ diagrams."

The error occurs in this line:

> <https://github.com/bpmn-io/bpmn-js/blob/eed6c3b662fa3bad9b49057451fc81de608c7f00/lib/features/modeling/BpmnUpdater.js#L599>

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”.

As always thank you for your help and time!

---

<div class="post-metadata">

**Author:** ![Axel\_Ruckert](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Axel\_Ruckert](https://forum.bpmn.io/u/Axel_Ruckert)\
**Post date:** [January 7, 2022, 7:10am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/2 "2022-01-07T07:10:57Z")

</div>

Nearly fogot that i asked this question.

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”.

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [January 13, 2022, 9:15am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/3 "2022-01-13T09:15:51Z")

</div>

Placing data stores outside of participants (for convenience) is enabled by [DataStoreBehavior](https://github.com/bpmn-io/bpmn-js/blob/develop/lib/features/modeling/behavior/DataStoreBehavior.js). Whenever a data store is created or moved its [semantic parent will be set to a process being referenced by one of the participants](https://github.com/bpmn-io/bpmn-js/blob/695c261709027d595949265b499adf21916971ad/lib/features/modeling/behavior/DataStoreBehavior.js#L39) to ensure valid BPMN 2.0. What is you custom element supposed to represent?

---

<div class="post-metadata">

**Author:** ![Axel\_Ruckert](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Axel\_Ruckert](https://forum.bpmn.io/u/Axel_Ruckert)\
**Post date:** [January 13, 2022, 4:18pm UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/4 "2022-01-13T16:18:54Z")

</div>

Hi philipp,

i inserted a picture to illustrate my use case:  
 ![ForumPhaseFrage](https://forum.bpmn.io/uploads/default/original/2X/b/b9a9a202832b51b4787ce064bdb46d7c1f74acac.png)

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:

> **Export XML**
>
> ```auto
> <bpmn2:process id="Process_0dgcvch">
> <bpmn2:laneSet id="LaneSet_0fs1gr1">
> <bpmn2:lane id="Lane_1dbaffk" name="Start_Lane" />
> </bpmn2:laneSet>
> <cu:phase id="Phase_1v8phpd" isPhase="true" />
> </bpmn2:process>
> 
> ```

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:

> **JSON**
>
> ```auto
> {
> "name": "PhaseLineExample",
> "uri": "http://example/PhaseLineExample",
> "prefix": "cu",
> "xml": {
> "tagAlias": "lowerCase"
> },
> "types": [
> {
> "name": "Phase",
> "superClass": [
> "bpmn:DataStoreReference"
> ],
> "properties": [
> {
> "name": "isPhase",
> "isAttr": true,
> "type": "Boolean"
> }
> ]
> },
> {
> "name": "Line",
> "superClass": [
> "bpmn:Task"
> ],
> "properties": []
> }
> ],
> "emumerations": [],
> "associations": []
> }
> 
> ```

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?

Again Thanks for your help

---

<div class="post-metadata">

**Author:** ![Axel\_Ruckert](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Axel\_Ruckert](https://forum.bpmn.io/u/Axel_Ruckert)\
**Post date:** [January 18, 2022, 6:35am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/5 "2022-01-18T06:35:50Z")

</div>

Hey,

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…

So works great! My own mistake^^

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [January 18, 2022, 8:29am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/6 "2022-01-18T08:29:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Axel\_Ruckert](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Axel\_Ruckert](https://forum.bpmn.io/u/Axel_Ruckert)\
**Post date:** [January 18, 2022, 9:18am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/7 "2022-01-18T09:18:29Z")

</div>

Hi philipp,

thanks for the advice! In terms of execution they dont have any meaning.  
They are basically just a visual aid. However if possible i want to export them just like any other element.

Also the user is supposed to drag them from one spot to another and also resize them.  
For this i need a Layout:  
All Phases together are as wide as their Pool.

Is this possible to do with Overlays?

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [January 19, 2022, 8:43am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/8 "2022-01-19T08:43:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [January 31, 2022, 8:20am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/9 "2022-01-31T08:20:02Z")

</div>

If you want to still go the “it should be a diagram element” route I suggest you to make your elements inherit from `bpmn:Artifact`. An artifact is a “whatever” element; it can be placed anywhere.

---

<div class="post-metadata">

**Author:** ![Axel\_Ruckert](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Axel\_Ruckert](https://forum.bpmn.io/u/Axel_Ruckert)\
**Post date:** [January 31, 2022, 9:56am UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/10 "2022-01-31T09:56:50Z")

</div>

Thank you, tested and works great 👍

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 22, 2025, 3:41pm UTC](https://forum.bpmn.io/t/create-elements-outside-pool-like-datastorereference/7051/11 "2025-07-22T15:41:50Z")

</div>

Closed on July 22, 2025, 3:41pm UTC


