Error: <bpmn:Association id="Association_13uet5m" />#target Ref not specified

In my projet, I add “text annotation” to “task” with the following code :

var textAnnotation = elementFactory.createShape({
            type: 'bpmn:TextAnnotation',
            businessObject: moddle.create('bpmn:TextAnnotation', {
              text: data['chemicalBedWashing']+' '+data['quantityBedWashing']+' '+data['unitBedWashing']
            })
          });

          // append the new text annotation to our shape
          modeling.appendShape(element, textAnnotation, {
            x: element.x + 90 + element.width,
            y: element.y + element.height/2
          });

The problem is when I save the bpmn and reopen it, I have the following error :

Error: <bpmn:Association id=“Association_13uet5m” />#target Ref not specified

How can I fix that?

Thank you.

For further assistance, please share a CodeSandbox that reproduces your issue in a way that we can inspect it. This way we can see your functionality live in action and can better inspect, what went wrong.

Sorry, I forgot to answer but the problem was solved by replacing moddle.create by bpmnFactory.create.

1 Like