calledElementVersion tag values

Hi, I’m getting some unexpected behaviour with the modeler and the calledElementVersion attribute.

When I use the method modeling.updateProperties(someCallActivity, {calledElementVersion : “${myExpression}”}); the value is updated properly, I can see it the element registry. But when I save the diagram and reload it, I see “calledElementVersion: NaN”.

The generated xml is fine though.

Hi,

could you provide us with a little bit more context and show us some code? How do you instantiate the Modeler. Please also provide the generated XML.

Thanks!

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.
https://docs.camunda.org/manual/7.5/reference/bpmn20/custom-extensions/extension-attributes/#calledelementversion

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

I looked for the last version of this file (I downloaded mine a few months ago) and it is already fixed. The last change on the file is to change this exact property.

Sorry for the trouble.

Great you could figure it out. :slight_smile: