Hi - new to bpmn-js and using it from Angular.
I’m wanting to create a basic workflow diagram with limited user interaction. Users will be able to move elements but not create new ones or connections (I’ll do this programmatically).
A few questions:
- How can I disable the command palette when a user clicks on an element?
- I’ve hidden the main palette (which prevents users from adding new items) through a display: none in my css. Is there a better way?
- If I retained the main command palette, how do I remove standard items from it? I’ve seen examples to add new custom items, but haven’t figured out how to remove the standard ones.
- When users move items, I want to capture the coordinates of the element so I can record those for use when I next render the element. How can I do that?
- I’ve seen an example of some form of auto layout using the code below. There can I find documentation for this and are there other options? (e.g. can I make connections route via the shortest path?)
const connections = elementRegistry.filter((element) => element.waypoints);
connections.forEach((connection) => {
modeling.updateWaypoints(connection, [getMid(connection.source), getMid(connection.target)]);
modeling.layoutConnection(connection, {
connectionStart: getMid(connection.source),
connectionEnd: getMid(connection.target),
});
});
Thanks in advance!
Craig