Skip to main content



      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 11:04 Go to next message
Eclipse UserFriend
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 14:01] by Moderator

Re: using Bpmn2DiagramEditorInput to change the bp diagram programmatically [message #1852424 is a reply to message #1852393] Mon, 16 May 2022 03:08 Go to previous messageGo to next message
Eclipse UserFriend
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 12:37 Go to previous message
Eclipse UserFriend
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: Fri May 16 23:33:02 EDT 2025

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

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

Back to the top