Extending the BPMN Metamodel [message #1110967] |
Tue, 17 September 2013 11:17  |
Eclipse User |
|
|
|
Hi everyone,
first at all i want to say that i think my question is already answered in this forum, but i think i didn't found it because my english could be better. I'm german and i'm studying computer science. I recently started my bachelorthesis and i could need some help. My Topic is extending the BPMN 2.0 in regard to cross-device-processing. The topic isn't necessary to look at but i have a problem.
I'm at the point that i have to extend the metamodel. That is not the big problem. I have another problem. Where can i get the BPMN 2.0 Metamodel for eclipse and how can i extend it in eclipse and generate the new things afterwards? I have found the source code in the eclipse git but i don't know which branch i have to copy. I copied the master 0.2.0 but i throws so much mistakes.
It would be enough to give me a link where it is described what i have to do or how i can get it.
Excuse my bad english.
Have a nice day everyone.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Extending the BPMN Metamodel [message #1228263 is a reply to message #1228254] |
Mon, 06 January 2014 15:11   |
Eclipse User |
|
|
|
Hmm, I think I asked this once before, but: is there a reason why you need to modify the bpmn2 metamodel classes? Is it possible to do what you want by simply extending the model (either by defining your own namespace, or by using the <extensionElements> mechanism of BPMN2)? In other words, if you wanted to add a new attribute called "required_attribute" to a Task for instance, your XML could look something like this:
<bpmn2:task ns1:required_attribute="some stuff" id="Task_1" name="my task"/>
if you simply defined "required_attribute" within the namespace "ns1". Alternatively it could look like this:
<bpmn2:task id="Task_1" name="my task">
<bpmn2:extensionElements>
<ns1:required_attribute value="some stuff"/>
</bpmn2:extensionElements>
</bpmn2:task>
if you wanted to use the BPMN2 extension mechanism.
Assuming you can't do either of these, it should be enough to just import the bpmn2 metamodel project into your workspace, hack it up as needed, and then add it to your debug configuration (if you used the default configuration, all workspace plugins should already be enabled for debugging).
|
|
|
|
|
|
|
|
|
|
Re: Extending the BPMN Metamodel [message #1232371 is a reply to message #1231866] |
Thu, 16 January 2014 14:47  |
Eclipse User |
|
|
|
Hey Markus,
Graphiti is a lot to try to understand in a couple of hours. Basically, everything is done with "Features" which are invoked by the Graphiti framework in response to some user action. These Features are contained in "Feature Containers", which are provided by the editor's "Feature Provider" when the framework asks for them. The BPMN2 editor's Feature Provider class is called BPMNFeatureProvider, and that's probably a good place to start in trying to understand how the Features are selected.
Here's a brief explanation of the types of Features and their functions:
CreateFeature - creates a "Business Object" that represents the Model piece of the MVC pattern. In the case of the BPMN2 Modeler, this would be one of the BPMN2 model objects. The CreateFeature is responsible for creating the correct Model object, initializing it, hooking it in to the rest of the BPMN2 document, etc. and then adding the graphical representation (if applicable) for the Model. This brings us to...
AddFeature - creates Graphiti visual container objects known as "PictogramElements" (the subclasses Shape, ContainerShape, Connection, Anchor, etc.) and their graphical representations, or "GraphicsAlgorithm" (Rectangles, Ellipses, PolyLines, etc.) PictogramElements (or PE's for short) are also responsible for maintaining the linking information to one or more Business Objects. PE's are tree nodes and may themselves have child PE's allowing for a visual containment hierarchy (boxes within boxes within...etc.)
MoveFeature - responsible for moving the GraphicsAlgorithms (GA's for short) and updating the model to reflect the new coordinates.
ResizeFeature - responsible for changing the size of the GA, and updating the model.
CreateConnectionFeature - same as CreateFeature, but for Connections.
and a whole bunch of other features...
A good place to start in the BPMN2 editor are the following base classes, most of these are abstract so use "F4" (Show Class Hierarchy) liberally in your development workbench 
AbstractBpmn2CreateFeature
AbstractBpmn2CreateConnectionFeature
AbstractBpmn2AddFeature
and so on. I've found that the easiest way for me to find stuff is to use the Java Type Browser and then use wildcard searches, for example *Add*Feature or *Feature*Container. In the Java Perspective main menu, click Navigate -> Open Type, or use the keyboard shortcut CTL+T to open the Type Browser.
HTH,
Bob
|
|
|
Powered by
FUDForum. Page generated in 0.47377 seconds