Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Extending the BPMN Metamodel
Extending the BPMN Metamodel [message #1110967] Tue, 17 September 2013 15:17 Go to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
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 #1111221 is a reply to message #1110967] Wed, 18 September 2013 00:23 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Markus,

I think I've had this conversation before but here we go again Wink ...
First: why do you need to extend the BPMN2 metamodel itself? Does your particular usecase not allow for extension elements as defined in the BPMN 2.0 specification?
Second: the BPMN2 metamodel project is available on eclipse git, here: http://git.eclipse.org/c/bpmn2/
You will want to use the "master" branch, which is compatible with the BPMN2 Modeler.

Bob
Re: Extending the BPMN Metamodel [message #1112191 is a reply to message #1110967] Thu, 19 September 2013 08:26 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi Bob,

first at all thanks for your answer. If you don't mind i have some follow up questions. I have cloned the metamodel and i also cloned the modeler source code from http://git.eclipse.org/c/bpmn2-modeler/org.eclipse.bpmn2-modeler.git

There are so many branches i have chosen the "master" branch. Was that correct? Is there any kind of documentation that helps me find the right way?

I am a little lost out here and have problems to find the start to edit everything. For example in my thesis i am analysing some scenarios and look if there are limitations to cross-device-processes. One of them is that if you change the device in the processmodel you have to specify your devices before. I have to edit or extend the model so that you have a class which specifies the devices. The extra class or to extend the model is easy for me. The only problem is that i don't understand where i have to start in eclipse. Can you help me get on the right track?

Thanks.
Re: Extending the BPMN Metamodel [message #1112203 is a reply to message #1110967] Thu, 19 September 2013 08:42 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
What i forgot to mention. I installed the modeler as it is described in the tutorial how to add a custom task. And everything has errors in it.
Re: Extending the BPMN Metamodel [message #1112373 is a reply to message #1112203] Thu, 19 September 2013 14:03 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Yes, "master" is the correct branch for Kepler development, "juno" is for, well, Juno...
I was using a "develop" branch at one point, but since I'm the only one doing any work on this project I decided to skip the extra step.

I'm assuming you found the tutorial screencast and you're trying to follow with the video. Please let me know if you are you having problems with this.

You said "everything has errors in it" - can you be a bit more specific? What kinds of errors and which "everything" are you talking about?

Bob
Re: Extending the BPMN Metamodel [message #1227986 is a reply to message #1110967] Mon, 06 January 2014 06:27 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi Bob,

i stopped working on the editor since last time and put my effort in some other things. Now it's time to modify the editor and i could need some help.

Just some quick questions. I just want to modify the plugin-editor in Eclipse. I don't need any jboss process engines. Which of the packages do i need just for the editor?

Next question: I want to test the Editor. Do i really have to create a custom plugin like you do in the tutorial? I need a fast way to see my changes in the source code. Is there a way to compile everything and see it in an eclipse plugin? I hope you understand my question.

Thanks for the help!
Re: Extending the BPMN Metamodel [message #1228221 is a reply to message #1227986] Mon, 06 January 2014 17:53 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Markus,

All you really need are the bpmn2 model plugins (org.eclipse.bpmn2, org.eclipse.bpmn2.edit and org.eclipse.bpmn2.editor) and the modeler Core and UI plugins (org.eclipse.bpmn2.modeler.core and org.eclipse.bpmn2.modeler.ui)

By "I want to test the Editor" I assume you mean you want to be able to debug the code? Everything is available from eclipse Git, just clone the bpmn2-modeler repository like this:

git clone http://git.eclipse.org/gitroot/www.eclipse.org/bpmn2-modeler.git

then, assuming you already have EGit installed in your eclipse workbench, add the local repository to your EGit Repositories view and Import them. I think this is covered in the first part of the video tutorial.

Let me know if you still have questions.

Cheers,
Bob
Re: Extending the BPMN Metamodel [message #1228223 is a reply to message #1228221] Mon, 06 January 2014 17:56 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Oops! The git repository URL in my previous post points to the project website. I meant to say this:

git clone http://git.eclipse.org/gitroot/bpmn2-modeler/org.eclipse.bpmn2-modeler.git

Smile
Re: Extending the BPMN Metamodel [message #1228243 is a reply to message #1110967] Mon, 06 January 2014 19:07 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi Bob,

okay i have done the checkout of the 5 packages. Now there's a follow up question Smile How do i start the Editor out of the source code i have got? Do i have to do a maven install oder isn't that necessary and i have to start it in an new eclipse application?
And where do i have to modify something, so that the modeler uses my org.eclipse.bpmn2 metamodel and not the one which is loaded?

I'm sorry to bother you with my questions but my work with eclipse java maven and so on isn't on a very high level. I'm also very sorry for my bad english Smile On my work i use PHP Frameworks and so on.

Best Regards,

Markus

[Updated on: Mon, 06 January 2014 19:20]

Report message to a moderator

Re: Extending the BPMN Metamodel [message #1228250 is a reply to message #1228243] Mon, 06 January 2014 19:31 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Markus,

No worries - there's plenty of help available for getting started with debugging eclipse plugins Smile
I assume you have all of the plugins imported into your workspace. If not, open the Git Repositories view in your workbench, right-click the "Working Directory" node and then "Import Projects..." This will open the import wizard - just accept all of the defaults and finish the wizard.

Next open the Debug perspective (main menu Window -> Open Perspective -> Debug) and create a new Debug Configuration (main menu Run -> Debug Configurations...) and give it a name (like "BPMN2 Modeler" or something) then make sure you have the following VM arguments set (in the "(x)= Arguments" tab):

-Xms40m -Xmx512m -XX:MaxPermSize=512m

Then just set a breakpoint somewhere in the code (BPMN2Editor.setInput() is a good place to start, depending on what you want to do) and let 'er rip!

It would help if I had a better idea of what, exactly, you're trying to do or test or build...

Bob
Re: Extending the BPMN Metamodel [message #1228254 is a reply to message #1228250] Mon, 06 January 2014 19:44 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi Bob,

just for example. I modified the Metamodel and now there are some Modifications in the Activityclass and there is a Class named required_Attribute. Now i want to get the Information out of the Activityclass and the required_Attribute has some values also which i want to see in the Editor everytime i create a new Activity.

That means i have to modify the org.eclipse.bpmn2 metamodel and create the jar. After that i need to modify the org.eclipse.bpmn2.modeler.core and create the jar also. Afterwards i would like to see my changes which i did in the source code in a new Eclipse. I hope this makes the whole thing a little bit more specific.

I just don't know how to build the jars. Do i have to do it with maven or do i have to just do what you wrote in the last comment? Can you understand my questions or are they too crappy?

Greetings,

Markus
Re: Extending the BPMN Metamodel [message #1228263 is a reply to message #1228254] Mon, 06 January 2014 20:11 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

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 #1228266 is a reply to message #1228263] Mon, 06 January 2014 20:21 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi,

no it isn't possible to just use this mechanism. There are many changes which have to take a modification in the metamodel. But i understood everything what you said.

I have another question and then i will try to get it to run by myself and otherwise i would like to ask you again. When you run a build or create the updatesite what do you use? Do you build it with maven, ant or with eclipse itself?

Thank you very much for your help Bob!!!!

Re: Extending the BPMN Metamodel [message #1228325 is a reply to message #1228266] Tue, 07 January 2014 00:28 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I usually build the project from the command-line (a git bash will do fine) like this:

mvn clean install -P platform-luna

You can also use the "platform-kepler" target, but the generated artifacts will be the same because there are no differences in the two versions of eclipse as far as the BPMN2 Modeler is concerned.

You will have to modify the pom.xml to grab your bpmn2 metamodel jars instead of the ones from the bpmn2 update site. The bpmn2 metamodel is built simply with:

mvn clean install

Re: Extending the BPMN Metamodel [message #1228601 is a reply to message #1110967] Tue, 07 January 2014 15:38 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi Bob,

in the last 8 hours i've been trying to do the mvn clean install on the bpmn2 metamodel. I want to get the jar. I've tried mvn clean install, mvn package and some other combinations. I also tried to edit the pom. I updated the pluginRepository but nothing seems to work. Maybe you can help me. This is the Error:

[ERROR] Failed to execute goal org.eclipse.cbi.maven.plugins:eclipse-jarsigner-plugin:1.0.1:sign (sign) on project org.eclipse.bpmn2: Could not sign artifact org.eclipse.bpmn2:org.eclipse.bpmn2:eclipse-plugin:0.7.0-SNAPSHOT: Connection to http://build.eclipse.org:31338 refused: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.eclipse.bpmn2


Another question popped up. You said i only need these 5 packages for the modeler. I think the others are for the process engine and so forth. Do i have to delete the other ones out of the workspace and the pom or is that a problem?

[Updated on: Tue, 07 January 2014 17:12]

Report message to a moderator

Re: Extending the BPMN Metamodel [message #1228657 is a reply to message #1228601] Tue, 07 January 2014 18:28 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Markus,

From the error message, it looks like maven is trying to "sign" the plugins. This can only be done on an eclipse machine because they own the certificates. To get around this, simply remove all of the crap that has to do with signing from the root pom.xml. So, that means this stuff:


       ...
       <pluginRepositories>
               <pluginRepository>
                       <!-- need maven-findbugs-2.3.2-SNAPSHOT, see http://jira.codehaus.org/browse/MFINDBUGS-122
                               remove this when this version is released -->
                       <id>codehaus.snapshots</id>
                       <url>http://snapshots.repository.codehaus.org/</url>
               </pluginRepository>
<!-- get rid of this -->
               <pluginRepository>
                       <!--  needed for plugin signing -->
                       <id>m2e-cbi</id>
                       <url>http://download.eclipse.org/technology/m2e/maven/</url>
               </pluginRepository>
<!-- to here -->
       </pluginRepositories>
       ...
<!-- and get rid of this plugin -->
                        <plugin>
                                <groupId>org.eclipse.cbi.maven.plugins</groupId>
                                <artifactId>eclipse-jarsigner-plugin</artifactId>
                                <version>1.0.1</version>
                                <executions>
                                        <execution>
                                                <id>sign</id>
                                                <goals>
                                                        <goal>sign</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>


That should do it.

As far as the additional plugins are concerned, you could delete them, but then you'd have to fix up all of the feature.xml files and possibly other stuff to get it to build. I would just leave them in there - it certainly doesn't hurt.

Bob
Re: Extending the BPMN Metamodel [message #1228885 is a reply to message #1228657] Wed, 08 January 2014 09:20 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi Bob,

me again Smile First at all i want to thank you. I successfully build the two projects. I Also changed something in the sourcecode and wanted to see my changes. So i opened the debug perspective as you said and when i want to create a new BPMN2 diagram there is an error:

The selected wizard could not be started.
Plug-in org.eclipse.bpmn2.modeler.ui was unable to load class org.eclipse.bpmn2.modeler.ui.wizards.BPMN2DiagramWizard.
org.eclipse.bpmn2.modeler.ui.wizards.BPMN2DiagramWizard cannot be found by org.eclipse.bpmn2.modeler.ui_1.0.2.qualifier

!ENTRY org.eclipse.osgi 2 0 2014-01-08 10:16:32.409
!MESSAGE The activator org.eclipse.bpmn2.modeler.ui.Activator for bundle org.eclipse.bpmn2.modeler.ui is invalid
!STACK 0
org.osgi.framework.BundleException: The activator org.eclipse.bpmn2.modeler.ui.Activator for bundle org.eclipse.bpmn2.modeler.ui is invalid



Best Regards
Re: Extending the BPMN Metamodel [message #1228993 is a reply to message #1228885] Wed, 08 January 2014 13:51 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hmm, never saw that one before Sad
Make sure your Debug Configuration has "all workspace and enabled target plug-ins" selected in the "Plug-ins" tab.
Also make sure your installed JRE is at least Java 1.6 or higher.
Maybe this discussion on Stack Overflow will help.
Also, try a google search for "org.osgi.framework.BundleException: The activator x for bundle y is invalid"

Just an afterthought: you do know that you don't have to build the plugins (with maven) each time you make a change to your sources, right? Just launch from your debug workbench...

[Updated on: Wed, 08 January 2014 14:00]

Report message to a moderator

Re: Extending the BPMN Metamodel [message #1231866 is a reply to message #1228993] Wed, 15 January 2014 15:44 Go to previous messageGo to next message
Markus Kuhn is currently offline Markus Kuhn
Messages: 11
Registered: September 2013
Junior Member
Hi Bob,

i want to thank you. You helped a lot. With your help i found a way so start. I understand maven, emf and the plugins in eclipse. It's nice to have that knowledge.

I already modified the metamodel and generated the new source code. But i have a Problem and you could help me if you like to. I'm trying to modify the Editor and its created with help of the Graphiti framework right?

I did read some graphiti tutorials and a little bit of the documentation. But i don't figure out, how i get the perspective for the graphical editor? I don't know how to modify the BPMN2 Modeler. I tried to modify it in the source code but it seemed a little bit too much. Is there any Documentation or Help? I hope you can understand my question.

Thanks a lot again for the help until now.

Best Regards,

Markus
Re: Extending the BPMN Metamodel [message #1232371 is a reply to message #1231866] Thu, 16 January 2014 19:47 Go to previous message
Robert Brodt is currently offline Robert Brodt
Messages: 603
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

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 Wink

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

Previous Topic:What is "di:waypoint " in BPMN?
Next Topic:Manipulate model when MessageStartEvent is created
Goto Forum:
  


Current Time: Mon Sep 22 04:29:25 GMT 2014

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

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