Hi nikku,
may you can help me understanding this? I want to do the same thing as the topic writer…
I do it your way and it works very fine.
But here is my problem. I want to read the input/output parameters after setting them.
var elementRegistry = modeler.get('elementRegistry');
var elementRegistryEntry = elementRegistry.get(pElement.element.id);
var elementRegistryEntryBO = elementRegistryEntry.businessObject;
elementRegistryEntryBO.extensionElements.values[1].$children
all fine…
but if I save my xml and load it new, $children is undefined. then i need to access this way:
So first I can access them via $children and after reloading the xml i need to do it via values…
That causes another problem. I additional save an attribute “type” to my inputParameter. If I reloaded my existing xml into the modeler, the “type” is lost.
its very annoying to have always a different structure of my businessobject, just cause i recently added my parameters or loaded an xml where i added the parameters before…
The $children property is exposed for generic elements for which bpmn-js does not know the internal structure.
The fact that you don’t have $children but rather actual typed elements is due to the fact that you made bpmn-js aware of it (most likely by including camunda-bpmn-moddle). In that case you must not create an AnyType but rather the camunda:InputOutput element directly:
var inputOutput = moddle.create('camunda:InputOutput', { ... });
// use similar to any type
// recognize that it has actual instance properties