Hi I am really new to bpmn but was able to understand a little about moddle and bpmn-js.
I would like to extend bpmn-js-properties-panel with not just custom properties but adding additional child node to a scriptTask. To make my intentions clearer, at the moment a scriptask when exported will look like the following:
I have already read through the moddle docs and found out that you can define descriptors but having a little difficulty understanding how it creates it above. I also search the bpmn-js code library and look for a descriptor that defines the existing elements for example scriptask but I can’t find one.
Can someone point me to the right direction what I should do to achieve the above?
Thanks Niklas. I already had a look at those examples but they are when you add a property to an element. Anyways, I will try to understand the code but to be honest I am struggling to figure it out.
Did you already start to write some code to achieve what you want to? Can you provide us some of this code? E.g. a custom properties provider, which do you have to build for creating properties panel extensions (like its mentioned in the second example repo above).
Furthermore, do you have some examples inside the existing code base which do you not understand? Maybe we can help you in detail if you provide us some specific aspects.
So my only problem now is how to manipulate the descriptor in magic.json to instead of attaching a property it will attach an element within bpmn:ScriptTask similar to my example above.
The extended script at the moment looks like this:
I guess our custom-element-example also explains how to deal with moddle extensions. I think best practice would be to implement them as ExtensionElement (as the example reveals), with which your extension will fit the bpmn specification.
We also have a small explanation inside our walkthrough, which might you’ve already seen.
i’m working on activiti engine,
so i need to get and set for exemple the conditionExpression which is a child node of sequenceFlow,
so i need to bind modelProperty to the conditionExpression when i’m selecting the sequenceFlow,
best Regards
Doesn’t the example I linked given the answers you’re looking for? So given element is a sequence flow element:
// get
const extensionElements = element.businessObject.get('extensionElements');
// [ ... ] do some stuff, e.g. adding properties
// set
modeling.updateProperties(element, { extensionElements: extensionElements });