Currently working on finding a mechanism for adding new elements to the businessObject directly. These are not modelling elements so i cannot add or remove them via the modeller itself.
Having issues with finding details on how i can programmatically update the businessObject.
I have created a complex element which i am trying to append onto the businessObject, but cannot seem to find out how this is done.
The properties panel executes commands to apply the changes registered by the entries. So entries do not execute those on their own but retrieving them as descriptors, so the properties panel can execute them in an orderly manner.
cmd: the command to be executed
context: the parameters to be executed with the command.
The command helper is a friendly helper to create such command descriptors for you, especially for commands which are common for the entries inside the properties panel. Most commands are part of diagram-js and bpmn-js, but the properties panel is also defining a couple of them.
However, i have run into another issue which you could perhaps also address here?
I am adding support for editing a deeply nested element via the properties panel, but in the event where the element does not exist then i have to create it and also all of its parent elements.
I have yet to stumble over an example that details how one can initialize deeply nested structures.
Could you perhaps steer me in the right direction ?
We have some examples of creating/maintaining nested properties inside the properties panel. This example shows the creation of an input parameter in the following order, given an element A.
ensure bpmn:extensionElements exist for A
ensure camunda:inputOutput exists inside the extension elements
create the bpmn:inputParameter inside the input output
Many commands get registered via modeling, so you could some available commits via modeling#getHandlers. The commandStack itself has a map containing all handlers, but that’s internal API, so you should be careful when using it.
const modeling = modeler.get('modeling');
// get modeling commands
console.log(modeling.getHandlers());
const commandStack = modeler.get('commandStack');
// dangerous: internal API
console.log(commandStack._handlerMap);