Read the modeled diagram [message #1138170] |
Mon, 14 October 2013 21:00  |
Eclipse User |
|
|
|
I would like to build a modeling feature to append suggested patterns on the process being modeled. But I don't have any experience building eclipse plugins, and i'm struggling to understand how i can code this in the BPMN2 modeler.
To start, I would like to read the modeled diagram and apply the suggestion algorithm. Im trying differents things but they doesn't seem to be working so well. With the code bellow, i get repeated objects (3 StartEvents for example) even when i got only one in the model.
Diagram diagram = getDiagram();
TreeIterator<EObject> diagContents = diagram.eAllContents();
for (; diagContents.hasNext();) {
Object o = diagContents.next();
if (o instanceof PictogramElement) {
PictogramElement pe = (PictogramElement) o;
Object[] bos = getAllBusinessObjectsForPictogramElement(pe);
for (int i = 0; i < bos.length; i++) {
Object bo = bos[i];
if (bo instanceof BaseElement && bo instanceof Event) {
if (bo instanceof StartEvent) {
StartEvent startEvent = (StartEvent) bo;
.....
I'll be very glad with any suggestion, tips or directions. So far i have been thinkering around the source code, and looks like I need to learn how eclipse plugins are developed, how Graphiti works, ... So any good material to learn this stuffs would be very helpful too.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03214 seconds