Hi Unable to view in the modler Oops No diagram to Display[Uploading: bpmn-model-api-12153056419966142766.bpmn…]()

Hi ,
Unable to open the downloaded bpmn file .

  BpmnModelInstance modelInstance = Bpmn.createEmptyModel();
    Definitions definitions = modelInstance.newInstance(Definitions.class);
    definitions.setTargetNamespace("http://camunda.org/examples");
    modelInstance.setDefinitions(definitions);
    Process process = createElement(definitions, "process-test", Process.class);

// create elements
StartEvent startEvent = createElement(process, “start”, StartEvent.class);
ParallelGateway fork = createElement(process, “fork”, ParallelGateway.class);
ServiceTask task1 = createElement(process, “task1”, ServiceTask.class);
task1.setName(“Service Task”);
UserTask task2 = createElement(process, “task2”, UserTask.class);
task2.setName(“User Task”);
ParallelGateway join = createElement(process, “join”, ParallelGateway.class);
EndEvent endEvent = createElement(process, “end”, EndEvent.class);

// create flows
createSequenceFlow(process, startEvent, fork);
createSequenceFlow(process, fork, task1);
createSequenceFlow(process, fork, task2);
createSequenceFlow(process, task1, join);
createSequenceFlow(process, task2, join);
createSequenceFlow(process, join, endEvent);

// validate and write model to file
Bpmn.validateModel(modelInstance);
File file = File.createTempFile(“bpmn-model-api-”, “.bpmn”);
System.out.println(“file”+file.getAbsolutePath());
Bpmn.writeModelToFile(file, modelInstance);

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.