Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Instantiating and Populating BP diagrams programmatically
Instantiating and Populating BP diagrams programmatically [message #1852228] Thu, 05 May 2022 12:46 Go to next message
Zenith Arnejo is currently offline Zenith ArnejoFriend
Messages: 10
Registered: May 2022
Junior Member
Good day everyone,

I have been trying to use BPMN2 MDT eclipse inside another eclipse project. So far, I am able to open and access the elements of an existing BP diagram. However, I'm having quite a hard time figuring out how to create a new BP diagram and populate it with elements programmatically. I saw a similar thread here: https://www.eclipse.org/forums/index.php/m/1775421/?srch=create+elements+programmatically#msg_1775421. However, it seems like what it tries to do is change programmatically the bp diagram that is loaded in the editor. I'm wondering if I can do the changes without having to load the editor (meaning, directly change the bpmn2 file).

In any case, I would also have to load bpmn2 modeler via another eclipse project (I set this aside for the moment since I'm having a validation error whenever I add the org.eclipse.bpmn2.modeler in the project contents).

I hope someone could help.
In any case, thank you in advance, everyone!
Re: Instantiating and Populating BP diagrams programmatically [message #1852237 is a reply to message #1852228] Thu, 05 May 2022 15:36 Go to previous messageGo to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 192
Registered: July 2009
Senior Member
Hi,
the BPMN2 MDT project just provides you with a EMF meta model for BPMN2. With this meta model you can build BPMN 2.0 models. There are some code examples showing how to load a .bpmn file.
Unfortunately, the code base is not very up-to-date and it may be difficult to use the project without version conflicts in the current Eclipse EMF version.
Transferring a BPMN model into EMF in general is not so easy as it sounds. For that reason I started a view weeks ago a new project to provide a BPMN meta model based on the XML dom tree. The Idea is to provide a more flexible way to control different versions form BPMN files generated with different generators without EMF based on XML. But this project is in a very early phase and not ready for development: https://github.com/imixs/open-bpmn/tree/master/open-bpmn.metamodel

===
Ralph
Re: Instantiating and Populating BP diagrams programmatically [message #1852240 is a reply to message #1852237] Thu, 05 May 2022 16:26 Go to previous messageGo to next message
Zenith Arnejo is currently offline Zenith ArnejoFriend
Messages: 10
Registered: May 2022
Junior Member
Good day, Ralph!

Thank you for such a prompt response.

Oh. This is noted. It seems to me that what you are planning to do is exactly what I need.
Just a question, is it then possible to execute and use the entire BPMN2 Modeler inside another eclipse project?
If yes, it would be of great help if you could refer to some resources I could use.
I've been trying to look for resources this week but I don't seem to be able to find something that I can really use and follow (or maybe my google search needs more refinement).

With much gratitude,
Zenith
Re: Instantiating and Populating BP diagrams programmatically [message #1852244 is a reply to message #1852240] Thu, 05 May 2022 17:42 Go to previous messageGo to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 192
Registered: July 2009
Senior Member
Ok, let sort things out...

The OpenBPMN-Meta Model I mentioned is just to create, read and update BPMN models programmatically.
Such models can be opened and edited with the Eclipse BPMN2 Modeler Plugin

The Eclipse BPMN2 Modeler Plugin is 'just' a Plugin and can of course be used in any Eclipse environment. If you have a Eclipse Project you can add the BPMN2 plugin as a dependency into your own project. We from Imixs Workflow are doing exactly this by extending the Eclipse BPMN2 Plugin . In the Developer Tutorials you will find examples how you can do this. But these Tutorials are focusing on the BPMN2 extension mechanism. If you plan to build a Eclipse RCP application you can simple add any kind of Eclipse Plugins into your application. There is no need to extend a Plugin.

The Eclipse BPMN2 plugin is powerful but also has become a bit old over the years. For that reason I started a new project to build a open BPMN modeling plattform based on Eclipse-GLSP. But this is still work in progress and you can not yet use it for you own project. .

So for the moment you should be fine just adding the Eclipse BPMN2 Plugin into your own Eclipse project.


===
Ralph
Re: Instantiating and Populating BP diagrams programmatically [message #1852260 is a reply to message #1852244] Fri, 06 May 2022 11:50 Go to previous messageGo to next message
Zenith Arnejo is currently offline Zenith ArnejoFriend
Messages: 10
Registered: May 2022
Junior Member
Ohh...
I'll try to "digest" what you said, Sir.

Thank you for your response.
And, thank you for the resources!

Zenith
Re: Instantiating and Populating BP diagrams programmatically [message #1852298 is a reply to message #1852260] Mon, 09 May 2022 11:34 Go to previous messageGo to next message
Zenith Arnejo is currently offline Zenith ArnejoFriend
Messages: 10
Registered: May 2022
Junior Member
No Message Body

[Updated on: Mon, 09 May 2022 17:21]

Report message to a moderator

Re: Instantiating and Populating BP diagrams programmatically [message #1852348 is a reply to message #1852298] Wed, 11 May 2022 13:10 Go to previous message
Zenith Arnejo is currently offline Zenith ArnejoFriend
Messages: 10
Registered: May 2022
Junior Member
Hi,

After some tries, I can now open the plugin and create/read/open a diagram from inside another eclipse project.
I'm trying to change the elements programmatically.
I'm currently trying to change the diagram similar to the approach presented here: https://stackoverflow.com/questions/38114267/emf-write-transaction (but the changes aren't reflected. ).

Is there a step I need to do before I can change the contents of a diagram?
Is there like a "redraw" function in bpmn2modeler?

Update:
Currently trying this: https://www.eclipse.org/forums/index.php/bm/msg/1110677/1/on/0/?SQ=fae7e9590b8512288c0769214b437e5e

Any help is really appreciated.
Thanks in advance!

UPDATE:
It can now reflect the changes on the diagram, thank God :)

[Updated on: Fri, 13 May 2022 18:30]

Report message to a moderator

Previous Topic:Moving JBPM componentes into separate Extension project
Next Topic:using Bpmn2DiagramEditorInput to change the bp diagram programmatically
Goto Forum:
  


Current Time: Tue Apr 23 10:29:16 GMT 2024

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

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

Back to the top