Change Moddle Definition programmatically

Hello,

I use Moddle Extension of Properties Panel as Camunda Plugin. I want to implement the possibility for user to define new Moddle Properties from UI.

Is it possible to change Moddle Definition programmatically? Can anyone provide an example?

Thanks in advance for any help!

Can you explain a little bit about what you mean by this?

Yes, sure. I want to extend the moddle definitions in the runtime. In the example from above we have magic.json with the moddle definitions. I want to add for the type “BewitchedStartEvent” in the array “properties” a new property on the fly. I added a form in Camunda Modeler, where a user can enter the name, type, and so on of the property (see screen). After click on the “add”-button this property should be added to the moddle definitions.

form

As far as I know moddle schema cannot be updated on runtime. However, maybe you don’t need that feature? camunda:properties can work without adjusting the schema:

image

    <bpmn:serviceTask id="Activity_1ktsv2d">
      <bpmn:extensionElements>
        <camunda:properties>
          <camunda:property name="a" value="b" />
        </camunda:properties>
      </bpmn:extensionElements>
    </bpmn:serviceTask>