Ok, I execute this javascript function (selededElement is a callActivity):
modeling.updateProperties(selectedElement,
{
calledElementBinding : 'version',
calledElementVersion : '${activeVersion_'+selectedElement.id+'}'
});
The idea is to create a variable named like the activity to provide the version dynamically.
I create the modeler as shown in the examples:
bpmnDiagram = new BpmnJS({
container: options.container_id,
moddleExtensions: {
camunda: options.camundaModelDescriptor
}
});
bpmnDiagram.importXML(options.xml, function(err) {
if (err) {
return console.error('could not import BPMN 2.0 diagram', err);
}
else {
if (options.callback)
options.callback();
loadProperties(options);
}
});
After executing the update function, I check the elementRegistry (bpmnDiagram.get(‘elementRegistry’) and everything has the value it should.
MyCallActivity.businessObject.calledElementVersion: “${activeVersion_MyCallActivity}”
But after saving the xml and loading it back. The elementRegistry looks like this:
MyCallActivity.businessObject.calledElementVersion: NaN
This is how the final xml looks like, which is the correct configuration.
<bpmn:callActivity id="Task_1ybkxsb" name="process documents" calledElement="dummy_value" camunda:calledElementBinding="version" camunda:calledElementVersion="${activeVersion:Task_1ybkxsb}">
I think I just found the problem, the camunda modeling extension (the json file with the definitions of camunda elements) defines the property “calledElementVersion” for call activities like this:
{
"name": "calledElementVersion",
"isAttr": true,
"type": "Integer"
},
But the documentation says it accepts expressions.
So it seems the modeler is working fine, but either the definition or the documentation are wrong. Should I report it in the camunda forum?
Cheers,
Gonzalo