I have to implement additional tree viewer into the modeler, which will actually show the computed RPST( Refined Process Structure Tree) of the process model created previously in the designer.
I added simple tree viewer as extension in org.eclipse.bpmn2.modeler.runtime.example.
But now I'm stacked because I don't know how to access the process model programmatically and use as a source in the Tree Viewer?
Robert Brodt Messages: 343 Registered: August 2010 Location: Colorado Springs, CO
Senior Member
Hi Ivan,
Have a look at the Outline viewer in BPMN2EditorOutlinePage. This uses an EditPartFactory for the ContentOutlinePage tree viewer, but the concepts should be similar to using a tree content provider.
You may also want to have a look at the default tree editor generated by EMF for the bpmn2 metamodel. This plugin is in the eclipse bpmn2 project, named org.eclipse.bpmn2.editor.
Starting with the EMF Resource loaded from a bpmn2 file, its contents is a DocumentRoot object (defined in the Bpmn2Package) and from that you can get the <bpmn2:definitions> element. See ModelUtil.getDefinitions(Resource) for example. <bpmn2:definitions> is the root of the BPMN2 document and contains both the business logic model (Definitions.rootElements) as well as the Diagram Interchange model (Definitions.diagrams).