Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Read the modeled diagram
Read the modeled diagram [message #1138170] Tue, 15 October 2013 01:00 Go to next message
Guilherme Araujo is currently offline Guilherme AraujoFriend
Messages: 1
Registered: October 2013
Junior Member
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.
Re: Read the modeled diagram [message #1139169 is a reply to message #1138170] Tue, 15 October 2013 15:35 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Guilherme,

I thought this topic was already beaten to death, but somehow it still comes back occasionally...I should really write a blog about this Wink
Anyway, please have a look at this thread:

http://www.eclipse.org/forums/index.php/t/533050/

I think Ken Hall is trying to do something similar.

Cheers!
Bob
Re: Read the modeled diagram [message #1140658 is a reply to message #1139169] Wed, 16 October 2013 14:15 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

FYI, I have created a new example plugin, named org.eclipse.bpmn2.modeler.examples.modelreader which is available from the Git repository here. This is a simple Java class that reads a sample bpmn process file and dumps out the types and names of the contained elements.
Previous Topic:Can't access xxxxRefs from SequenceFlow
Next Topic:BPMN2 Modeler Graduation and 1.0 Release Review
Goto Forum:
  


Current Time: Sat Nov 02 11:54:16 GMT 2024

Powered by FUDForum. Page generated in 0.02966 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top