DataInputAssociation Properties Export Order

Hello .
We are using jbpm as workflow engine .
The UserTask in jbpm has DataInput with name TaskName

    <bpmn:dataInput id="UserTask_0cuiapk_TaskName" itemSubjectRef="__UserTask_0cuiapkTaskNameItem" name="TaskName" />

and we can assign value to this input using DataInputAssociation

      <bpmn:dataInputAssociation>
        <bpmn:targetRef>UserTask_0cuiapk_TaskName</bpmn:targetRef>
        <bpmn:assignment>
          <bpmn:from>Some Value</bpmn:from>
          <bpmn:to>UserTask_0cuiapk_TaskName</bpmn:to>
        </bpmn:assignment>
      </bpmn:dataInputAssociation>

What Iā€™m trying to do is creating this association using the following code :

       let dataInputAssociationTag = moddle.create('bpmn:DataInputAssociation');


        let targerRef = moddle.create('bpmn:ItemAwareElement', { id: dataInput.id });
        dataInputAssociationTag.targetRef = targerRef;
    
    
        let assignmentTag = moddle.create('bpmn:Assignment');
        let from = moddle.create('bpmn:Expression', { body: Some Value  });
        let to = moddle.create('bpmn:Expression', { body: dataInput.id });
        assignmentTag.from = from;
        assignmentTag.to = to;
    
        dataInputAssociationTag.get('assignment').push(assignmentTag);
        inputAssociations.push(dataInputAssociationTag) ;

The generated xml is :

<bpmn:dataInputAssociation>
        <bpmn:assignment>
          <bpmn:from>Some Value </bpmn:from>
          <bpmn:to>UserTask_0cuiapk_TaskName</bpmn:to>
        </bpmn:assignment>
        <bpmn:targetRef>UserTask_0cuiapk_TaskName</bpmn:targetRef>
      </bpmn:dataInputAssociation>

The jbpm library cannot parse the xml becuase targetRef tag is after assignment tag

This seems to be an issue with how we serialize diagrams.

Could you open an issue in bpmn-moddle, describe your case and attach a valid diagram with a bpmn:assignment?

Thanks @nikku for your response .

Issue opened in bpmn-moddle Issue Link

Fixed with bpmn-moddle@6.0.2 / bpmn-js@6.2.1.

1 Like

Thanks for the great work @nikku

1 Like