Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » using Bpmn2DiagramEditorInput to change the bp diagram programmatically
using Bpmn2DiagramEditorInput to change the bp diagram programmatically [message #1852393] Fri, 13 May 2022 15:04 Go to next message
Zenith Arnejo is currently offline Zenith ArnejoFriend
Messages: 10
Registered: May 2022
Junior Member
Good day,

Just a question regarding Bpmn2DiagramEditorInput.
I am trying to instantiate a bp diagram using this class, and thankfully I can create a diagram and read a diagram using it.
What I'm trying now is to change the contents of the bp diagram.

I have this to read/create a diagram:
Bpmn2DiagramEditorInput bp_diagram = (!file.exists()) ?
BPMN2DiagramCreator.createDiagram(uri, Bpmn2DiagramType.PROCESS, "www.omg.org/spec/BPMN/2.0/"):
openFileDiagram(uri);

Then, I can load the diagram using this:
BPMN2DiagramCreator.openEditor(bp_diagram);

What I'm trying to do is change the contents of bp_diagram, before it is rendered in the editor.
I've been trying a couple of approaches, but nothing worked so far.
The most recent one I tried is to create a BPMNdiagram and put it in bp_diagram using:
bp_diagram.setBpmnDiagram(diag).
When I load the definition of bp_diagram, I can read the diagram that I added, but when I render it, it's not displayed.

Any suggestions to approach this are greatly appreciated.
Looking forward to some response.

Thanks you in advance,
Zenith


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

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

Report message to a moderator

Re: using Bpmn2DiagramEditorInput to change the bp diagram programmatically [message #1852424 is a reply to message #1852393] Mon, 16 May 2022 07:08 Go to previous messageGo to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 192
Registered: July 2009
Senior Member
The BPMN2 plugin is mainly used on EMF, so you should try to use the EMF Factory classes. See the class Bpmn2FactoryImpl which operates directly on the EMF model created after a .bpmn file was read.

I hope this helps. I have never tried it myself.
Re: using Bpmn2DiagramEditorInput to change the bp diagram programmatically [message #1852603 is a reply to message #1852424] Thu, 26 May 2022 16:37 Go to previous message
Zenith Arnejo is currently offline Zenith ArnejoFriend
Messages: 10
Registered: May 2022
Junior Member
Thank you for your reply.
I'm currently trying to do stuff from scratch.
But, I'm trying to follow your work on open-bpmn and hopefully use it soon :))

Thank you in advance!
Previous Topic:Instantiating and Populating BP diagrams programmatically
Next Topic:Blurry context buttons on subsequent use
Goto Forum:
  


Current Time: Thu Apr 25 12:28:33 GMT 2024

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

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

Back to the top