Creating Diagrams programmatically using Open-BPMN : problem with sequence flows #142
Unanswered
zarnejo-exers
asked this question in
Q&A
Replies: 1 comment
-
Hi @zarnejo-exers, thanks for joining the project. Here you can see my test example code I used trying to reproduce your problem: public void testCreateSequenceFlow() {
String out = "src/test/resources/output/process-example-8.bpmn";
String exporter = "demo";
String version = "1.0.0";
String targetNameSpace = "http://org.openbpmn";
BPMNModel model = BPMNModelFactory.createInstance(exporter, version, targetNameSpace);
try {
BPMNProcess process = model.openDefaultProcess();
Event event = process.addEvent("start_1", "Start 1", BPMNTypes.START_EVENT);
Activity task = process.addTask("task_1", "Task 1", BPMNTypes.TASK);
process.addSequenceFlow("seq_1", "start_1", "task_1");
assertNotNull(model);
assertEquals(1, model.getProcesses().size());
assertEquals(1, process.getSequenceFlows().size());
} catch (BPMNModelException e) {
e.printStackTrace();
fail();
}
model.save(out);
logger.info("...model created sucessful: " + out);
} Can you try this out once again? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
Greetings!
Thank you very much for this open-bpmn metamodel.
I'm currently trying to use it for my project.
I have already integrated it with the platform I'm using and I can now create models.
However, when I start working on modifying the models, I am unable to properly add sequence flows programmatically (adding events is working well).
When I try to add sequence flows, I encounter an assertion error resulting from an indexoutofbounds exception.
I can properly read a BPMN diagram with sequence flows created using the GUI.
May I know if there's an extra step needed after I add sequence flows and just before I save the model (model.save(out))?
Thank you in advance for taking the time to read my question.
Hoping for a response.
Yours,
Zenith
Beta Was this translation helpful? Give feedback.
All reactions