I’m using custom overlays to add information to boundary events. Is there a way to choose the position of the overlay so that it does not interfere with the BPMN elements?
The code I use is based on the example shown at bpmn.io github.
var overlays = bpmnViewer.get('overlays');
// attach an overlay to a node
html: '<div>Mixed up the labels?</div>'
Maybe it would already be sufficient, if I could determine the value for “bottom” property. Sometimes my boundary events are positioned at the top of a taks, sometimes they are positioned at the bottom.
Thanks for any help.
We have no built-in functionality covering this use case.
A solution would be to check the position of a boundary event on the task using Math and create / update the boundary events overlay based on that.
Any advice on how to check the position of the boundary event on the task?
I found the function
var elementRegistry = viewer.get('elementRegistry');
and call then
I can retrieve my boundary event element with this. But I do not know how to access the “parent” task object.
host property points you to the element the boundary event is attached to:
var task = boundaryShape.host;
From there on you should be able to compute the
mid(element) with the
height properties of the elements.
If you are fine with using internal API that may change or get removed any time, you can also use
LayoutUtil#getOrientation to do the job for you.