04-19-2018 06:21 AM
new BpmnAutoLayout(model).execute();
this create a flowchart of horizontal layout,How to dynamically generate a flowchart of vertical layout?
04-20-2018 08:33 AM
Not sure if I understood the question, could you please explain the use case/question a little bit more so that we can help?
04-21-2018 06:37 AM
process.addFlowElement(createStartEvent());
process.addFlowElement(createUserTask("task1", "node01", "candidateGroup1"));
process.addFlowElement(createUserTask("task2", "node02", "candidateGroup2"));
process.addFlowElement(createEndEvent());
process.addFlowElement(createSequenceFlow("startEvent", "task1", "", ""));
process.addFlowElement(createSequenceFlow("task1", "task2", "", ""));
process.addFlowElement(createSequenceFlow("task2", "endEvent", "", ""));
// 2. Generate graphical information
new BpmnAutoLayout(model).execute();
// 3. Deploy the process to the engine
Deployment deployment = repositoryService.createDeployment()
.addBpmnModel(PROCESS_ID+".bpmn", model).name(PROCESS_ID+"_deployment").deploy();
// 4. Start a process instance
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(PROCESS_ID);
// 5. Check if task is available
List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
Assert.assertEquals(1, tasks.size());
// 6. Save process diagram to a file
InputStream processDiagram = repositoryService
.getProcessDiagram(processInstance.getProcessDefinitionId());
FileUtils.copyInputStreamToFile(processDiagram, new File("/deployments/"+PROCESS_ID+".png"));
the code, png show horizontal
i like this
I don't know how to do it
04-23-2018 06:21 AM
So you probably need to hack your own version of
new BpmnAutoLayout(model)
And probably check this: Activiti/BpmnAutoLayout.java at develop · Activiti/Activiti · GitHub
Explore our Alfresco products with the links below. Use labels to filter content by product module.