STP/BPMN Component/Reusing the modeler
Annotating the stp.bpmn domain model
This paragraph explains how to add to the bpmn diagram custom data. It also describes how to display and interact with that custom data.
The reader needs to be familiar with EMF and in some cases to GMF/GEF.
Every element of the domain model of the stp.bpmn modeler is an EMF EModelElement. This means that it can be attached arbitrary annotations.
Here are various techniques to use that ability.
Display the value of the annotation
By default the EAnnotations added to the bpmn objects are displayed in the properties view inside the 'BPMN' tabulation.
EAnnotations are tied to their EModelElement through the source property which is a String. EAnnotations contain a HashMap of Strings to Strings.
The BPMN properties view display a table with two columns: The first column is the source of the EAnnotation concatenated to the key of the Details HashMap.
The second column is the value of the Details HashMap.
Displaying the annotation on the diagram
Once the model has annotations it is possible to display in the diagram that the model element associated to a particular shape or connection has been annotated. In order to do this, you will need to implement a GMF Decorator Provider. Please refer to the documentation of the extension point: org.eclipse.gmf.runtime.diagram.ui.decoratorProviders
We are considering exposing a specialized extension point for associating a figure to an annotation. TODO: Antoine Toulme developed this part and might want to comment further.
Annotate the stp.bpmn: Drag and Drop
It is possible to drag and drop things to attach annotations to the stp.bpmn domain model. Use the extension point: org.eclipse.stp.bpmn.diagram.EAnnotationDragAndDrop The object dragged must be "IAdaptable" to an EAnnotation. The implementation of the extension point will define if the drop can execute and will show feedback in a balloon figure. This extension point is only giving access to the domain model. TODO: Antoine Toulme developed this part and might want to comment further.
The hardcore way to customize the editor consist of making your own BPMN Editor with its own EditPart factory. All you need to do is extend the stp.bpmn Editor and EditPartFactory.
We have made many packages public for now.
Also GMF validation services are very useful when adding extra rules are to analyze the code.
As we identify implementation of those services that are specialized to the stp.bpmn model they will be exposed as extension points.