thank you very much for the great help last time. So far i am making good progress with my project.
Now i want to do the following:
Cycle through all elements used in the diagramm
check if the current element has the extended property “deleteme” and if it is “1”
if both are true delete the element
So the goal is, that at the end of the procedure all elements that have the “deleteme” property equal to “1” are removed.
So far i have found the following code segments form the forum:
From what i understood it is best to work with the elementRegistry as it has a ForEach Function. But i could get it to work. Most likely because i am new to Javascript.
Would be very nice if someone could give me some tipps.
i made some progress and figured out the following:
function deleteProcess2() {
openDiagram(lastDiagramXML);
//Get elements from elementRegistry
var elementRegistry = bpmnModeler.get('elementRegistry');
var elements = elementRegistry.getAll();
//cycle through Elements
elements.forEach(function(element) {
//Here i still have Problems, the alert windows shows an object but how can i get the Value of Property "Eval"?
var extras = element.businessObject.extensionElements.ExtensionElementsHelper.get('eval');
window.alert (extras);
` //if value of property is more than 0 then delete it`
if (extras>0){
elementRegistry.remove(element);
}
});
}
Would be nice if someone could give me an example on how to obtain that value correctly.