How to save custom properties in bpmn2:extensionElements

Hello,

I searched the forum but couldn´t find a solution to my problem.

I expanded the property panel with custom properties for the BPMN SubProcess. The existing example was very useful.

However I also want to change the way my custom properties are saved in the XML, so i had a look into the custom meta-model example.

I want my custom properties to be saved within bpmn2:extensionElements just like it is done in the example, but following the instructions in the example didn´t work and the properties were not saved within bpmn2:extensionElements but as attributes of the sub-process.

I assume something is wrong within my bpmn extension json file:

"types": [
    {
      "name": "BatchRegion",
      "extends": [
        "bpmn:SubProcess"
      ],
      "properties": [
        {
          "name": "isBatch",
          "isAttr": true,
          "type": "Boolean"
        },
        {
          "name": "batchRegion",
          "isMany": false,
          "type": "BatchConfiguration"
        },
      ]
    },
    {
      "name": "BatchConfiguration",
      "superClass": [ "Element" ],
      "properties": [
        {
          "name": "maxCap",
          "isMany": false,
          "type": "MaxCapacity"
        },
        {
          "name": "groupChar",
          "isMany": false,
          "type": "GroupingCharacteristic"
        },
        {
          "name": "actRule",
          "isMany": false,
          "type": "ThresholdRule"
        },
        
      ]
    },
    {
        "name": "ThresholdRule",
         "properties":[
         {
          "name": "threshold",
          "isAttr": true,
          "type": "String"
         },
        {
          "name": "timeout",
          "isAttr": true,
          "type": "String"
        },
        ]
    },
    {
          "name": "MaxCapacity",
          "properties":[
            {
              "name": "text",
              "isBody": true,
              "type": "String"
            },
          ]
    },
    {
          "name": "GroupingCharacteristic",
          "properties":[
            {
              "name": "processVar",
              "isMany": true,
              "type": "ProcessVariable"
            },
          ]
    },
    {
          "name":"ProcessVariable",
          "properties":[
            {
              "name": "text",
              "isBody": true,
              "type": "String"
            },
          ]
    }
  ]

Any ideas what i did wrong?

Best Regards
Jan

What did you try to save your custom properties?

Hey,

I created a BPMN-diagram in the modeler and used the property-panel as input for the custom properties, then I saved the BPMN-diagram as XML via the “download BPMN diagram” button.

The input was saved within the custom properties in the XML however the custom properties did not appear in bpmn extension elements as i wanted.

Regards
Jan

Hi all,

Jan and I are still working on this, but we have no solution for the described issue. Do you have any hint?

Thanks a lot,
Luise

Please provide some source code, preferably a Project on GitHub we can look into to assist you.

Hi,

here the link to our github: https://github.com/LuisePufahl/properties-panel-extension

We adapted the magic.json file in the app.descriptors file.
We want to have these as extensions of the sub-processes, preferably in the following format:

<bpmn2:subProcess id="SubProcess_1jvlipe" name="Batch Region"> <bpmn2:extensionElements> <bpt:batchRegion id="batch1"> <bpt:groupingCharacteristic> <bpt:processVariable id="1">custName</bpt:processVariable> <bpt:processVariable id="1">custAdress</bpt:processVariable> </bpt:groupingCharacteristic> <bpt:maxCapacity>3</bpt:maxCapacity> <bpt:thresholdRule num="2" timeout="PT10S" /> </bpt:batchRegion> </bpmn2:extensionElements>
Currently, it is stored in the attributes of the sub-process.

The visualization of it is defined similar to your proposed project in the SpellProps.js in the app/provider/magic/parts file.

Thanks a lot for your help.

Cheers, Luise

Hello,
is there any update for this topic?
I am at the same situation looking for a solution.
BR Anja