cancel
Showing results for 
Search instead for 
Did you mean: 

Generate diagram without deploying

esseti
Champ in-the-making
Champ in-the-making
Hi all
I'm playing with activiti and i found "strange" that to get the diagram in PNG it takes so many steps.
With the REST api you need to know the ProcessID. and with the java one you need to deploy the project first to get back the diagram.

is there any way to have the png without the need of running the engine?
or the resulting picture also shows the process status and this is why it has to be a process instnaces as parameter?
6 REPLIES 6

frederikherema1
Star Contributor
Star Contributor
You can create a process-diagram based on a BPMNModel. A BpmnModel can be parsed (using activiti-bpmn-converter) from XML. Once you have the BpmnModel POJO, you pass it in the https://github.com/Activiti/Activiti/blob/37b7cbcac2d5a9ab7d7470a4dedd0fb644216d6f/modules/activiti-....

So no need to have a running engine, just the right classes on your classpath…

esseti
Champ in-the-making
Champ in-the-making
I see, this is the info i was looking for. thanks.

esseti
Champ in-the-making
Champ in-the-making
I tried.
but after i modify the process programmatically (if i remove both input output flow, and add two new), when i try to genereate the PNG i got a nullpointerexception.
if i open the edited process in activiti designer everything is fine.
any idea?
here is my code https://github.com/esseti/BPMN4Crowd-Compiler

jbarrez
Star Contributor
Star Contributor
can you provide the stacktrace of the NPE?

esseti
Champ in-the-making
Champ in-the-making
what's NPE?
this is what ti gives me back.

java.lang.NullPointerException
at org.activiti.engine.impl.bpmn.diagram.ProcessDiagramGenerator.initProcessDiagramCanvas(ProcessDiagramGenerator.java:516)
at org.activiti.engine.impl.bpmn.diagram.ProcessDiagramGenerator.generateDiagram(ProcessDiagramGenerator.java:337)
at org.activiti.engine.impl.bpmn.diagram.ProcessDiagramGenerator.generateDiagram(ProcessDiagramGenerator.java:363)
at org.activiti.engine.impl.bpmn.diagram.ProcessDiagramGenerator.generatePngDiagram(ProcessDiagramGenerator.java:321)
at org.crowdcomputer.bpmn.Compiler.generatePNG(Compiler.java:149)
at org.crowdcomputer.bpmn.Compiler.compileMain(Compiler.java:240)
at org.crowdcomputer.bpmn.Compiler.main(Compiler.java:278

frederikherema1
Star Contributor
Star Contributor
There is one or more sequence-flows in your process that has no graphical information set, relevant line in PDgenerator:


     for (SequenceFlow sequenceFlow : flowNode.getOutgoingFlows()) {
        List<GraphicInfo> graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId());
        for (GraphicInfo graphicInfo : graphicInfoList) {

It actually helps looking at the source of an open-source framework if an exception occurs to get you closer to your problem…