GraphicInfo not available for bpmnModel

I’m trying to show the graphic of the process diagram associated to an active task

Task t = Bpm.engine().getTaskService().createTaskQuery().taskId(request.getParameter(“id”)).singleResult();
BpmnModel model = Bpm.engine().getRepositoryService().getBpmnModel(t.getProcessDefinitionId());
InputStream is = Bpm.engine().getProcessEngineConfiguration().getProcessDiagramGenerator().generateJpgDiagram(model);

I am getting a NPE
Caused by: java.lang.NullPointerException
at org.flowable.image.impl.DefaultProcessDiagramGenerator.initProcessDiagramCanvas(DefaultProcessDiagramGenerator.java:887)

When looking at the sources, it seems that
GraphicInfo flowNodeGraphicInfo = bpmnModel.getGraphicInfo(flowNode.getId());

For the first flowNode found (startprocess1) returns null

Am I missing some configuration so as to save the bmpndi when deploying? Why does it return null?

Hi,

How was the BPMN XML created?
It seems that it’s missing BPMN DI information (at least for this element), and therefore it can’t generate de process diagram.

Best regards,

Tijs

Hello I am getting the same error:

I created the BPMN using the following code (written in Kotlin):

myService?.getRepositoryService()?.getBpmnModel(process?.key)
val bpmnModel: BpmnModel? =myService?.getRepositoryService()?.getBpmnModel(process?.key) //BpmnXMLConverter().convertToBpmnModel(parser)

val diagramGenerator: ProcessDiagramGenerator? = processEngineConfiguration?.processDiagramGenerator

Hello I am getting the same error:

I created the BPMN using the following code (written in Kotlin):

myService?.getRepositoryService()?.getBpmnModel(process?.key)
val bpmnModel: BpmnModel? =myService?.getRepositoryService()?.getBpmnModel(process?.key) //BpmnXMLConverter().convertToBpmnModel(parser)

val diagramGenerator: ProcessDiagramGenerator? = processEngineConfiguration?.processDiagramGenerator