Marama Code 125 ~ Detect shape updated info
Did you know that you capture or be aware of the changes made in the diagram? For instance when user change a shape name or delete a shape? Yes you can. You just need this codes:
EventPropertyUpdateInfo info = this.propertyUpdated(notification); // get the update info
if (info == null) { return; } // ignore if no update
then,
MaramaDiagram diagram = info.getMaramaDiagram(); // get the diagram
if (diagram == null) { return; } // ignore if diagram doesn’t exist
or
MaramaShape shape = info.getMaramaShape(); // get the shape
if (shape == null) { return; } // ignore if shape doesn’t exist
Once you have captured the diagram/shape, you retrieve the new value that would like to minitor:
String testCategories = mu.getShapeString(sh, “testCategories”); // get the shape value
or, you can filter the shape to make sure you obtain the right shape
if (!sh.getShapeType().equals(“TestInfoShape”)) { return; } // ignore if not info shape