Properties-panel-extension descriptor to add child element

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:

<bpmn:scriptTask id="ScriptTask_01m7cij" name="get verticalOpeningArea">

I would like it to look like the following:

<bpmn:scriptTask id="ScriptTask_01m7cij" name="get verticalOpeningArea">
      <bpmn:script><![CDATA[ -- add script here-- ]]></bpmn:script>

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?

Kind Regards,


Hi @sktzoootech,

So what you want to achieve is adding custom element attributes to a ServiceTask, right? Therefore you can have a look inside, and also to get a guideline how to add custom attributes and extensions for the properties panel.

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.

Ok I refactored the to render what I need in terms of UI. screenshot

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:

    <bpmn:scriptTask id="Task_102okuj" magic:spell="input script">

But would like it to look like this:

    <bpmn:scriptTask id="Task_102okuj">
       <bpmn:script><![CDATA[ -- input script -- ]]></bpmn:script>

So I’ve solved the UI problem, I only need to understand how bpmn-moddle works. Is there a guideline on how to create descriptors (magic.json)?

Kind Regards,


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.

hi ,
can you please share the example of accessing to the bpmn:script tag form propertiesPanel in the when bpmn:sriptTask is selected ?
best regards

hi niklas ,
there is an exemple how to set and get the extensionElement from properties panel ??
best regards

Not from the properties panel, but from the element’s business object. See this for help.

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 });

i’m trying to edit the condition expression using the properties panel of an imported diagram


i solved the issue,
thank you for your support

Good news! Maybe you can share your solution so other people can benefit from in the future?

1 Like

i used the getter to get the value of the property
this example is for the sender in a mail task with activiti wich is my case
the xml:

    <serviceTask id="mailtask1" name="Mail" activiti:async="true" activiti:type="mail">
        <activiti:field name="subject">
        <activiti:field name="from">
        <activiti:field name="to">
        <activiti:field name="charset">
        <activiti:field name="html">
        <activiti:field name="cc">

my code :

                 id: 'sender',
                 label: this.translate('sender'),
                 modelProperty: 'sender' ,
                 get: function() {
                   return {
                     sender: element.businessObject.extensionElements.values[1].$children[0].$body
1 Like