How to get the parent element of a newly created element

But I need to set the lane as its parent.

Why do you want to do this? Notice that in BPMN lanes contain only references to the elements which belong to the process referred by the participant, e.g.

    <bpmn:laneSet id="LaneSet_0pu4l2q">
      <bpmn:lane id="Lane_1gqnvv1">
        <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_0ctp86q</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_145b0wt</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_168s0hh">
        <bpmn:flowNodeRef>Event_1b3t0fy</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
1 Like