-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$parent undefined #92
Comments
Thanks for reporting! Giving this API for creating moddle elements const bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' }); what would you expect to be the |
I have not even found a way to set the $parent manually, probably because of the way it is implemented bpmn-io/moddle-xml@d5e2e83 |
Doesn't it even work for you to just manually set the property? const bpmnProcess = moddle.create("bpmn:Process", { id: "MyProcess_1" });
bpmnProcess.$parent = definitions;
definitions.get('rootElements').push(bpmnProcess);
These are different things. When reading the process via XML, the But this is one case, there are more complex ones. As far as I understand the |
All right, setting it manually that way works. I didn't expect the behaviour generally but looking at how the element creation is implemented, obviously it can't determine it's parent. |
You have to take care of that yourself right now. It is a limitation you have to be aware of (cf. bpmn-io/moddle#41). |
Describe the Bug
When using bpmn-moddle to create elements and adding them to the definitions, the $parent on them is undefined.
When loading an existing process from XML, $parent works on it's in the XML already existing elements as it should. Newly created bpmn-moddle elements have a $parent of undefined.
Steps to Reproduce
Inspect the Object
definitions
$parent for the newly created Process Element is undefined
Expected Behavior
$parent should be a reference to the parent element
Environment
The text was updated successfully, but these errors were encountered: