cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessDiagramGenerator error

ahmetkara
Champ in-the-making
Champ in-the-making
Hi guys,

I try to use ProcessDiagramGenerator to generate the png of a process but I couldn't yet.
I am getting the error below.

Caused by: java.awt.image.RasterFormatException: (x + width) is outside raster
at sun.awt.image.IntegerInterleavedRaster.createWritableChild(Unknown Source)
at java.awt.image.BufferedImage.getSubimage(Unknown Source)
at org.activiti.engine.impl.bpmn.deployer.ProcessDiagramCanvas.generateImage(ProcessDiagramCanvas.java:161)
at org.activiti.engine.impl.bpmn.deployer.ProcessDiagramGenerator.generateDiagram(ProcessDiagramGenerator.java:205)
at org.activiti.engine.impl.bpmn.deployer.ProcessDiagramGenerator.generatePngDiagram(ProcessDiagramGenerator.java:184

Do you have any idea, what is the reason?
21 REPLIES 21

frederikherema1
Star Contributor
Star Contributor
Can you post some more code on how you use the generator exactly?

ahmetkara
Champ in-the-making
Champ in-the-making
The way that I try is below, I am casting ProcessDefinition to ProcessDefinitionEntity (because I coludn't find the way to get ProcessDefinitionEntity from query), may it be the reason??

InputStream generatePngDiagram = ProcessDiagramGenerator.generatePngDiagram((ProcessDefinitionEntity) getProcessEngine().getRepositoryService().createProcessDefinitionQuery().processDefinitionId(selecetedProcessInstance.getProcessDefinitionId()).singleResult());

frederikherema1
Star Contributor
Star Contributor
Looks like your diagram goes beyond canvas bounds. Shouldn't happen, since all activities are checked, and the min and max X and Y coördinates are calculated to prevent this error.

Did you create the diagram in the modeler? Is it possible to attach the process?

ahmetkara
Champ in-the-making
Champ in-the-making
Actually, I don't know how to generate the diagram in modeler, I have just seen it in activiti cycle and I have attached  the process and signavio xml.
Thanks for your quick reply by the way.

frederikherema1
Star Contributor
Star Contributor
Hi,

If I import the process using probe, it generates the image successfully. Are you running 5.2?

teinacher
Champ in-the-making
Champ in-the-making
Hi,

I'm also trying to use the ProcessDiagramGenerator and I get the same error as above. I'm invoking the generator like this:

ProcessDefinitionEntity procDef = (ProcessDefinitionEntity) getProcessEngine().getRepositoryService().createProcessDefinitionQuery()
          .processDefinitionKey(processKey).singleResult();
List<String> activeActivities = getProcessEngine().getRuntimeService().getActiveActivityIds(processInstanceId);
ProcessDiagramGenerator.generateDiagram(procDef,"jpg", activeActivities);

When debugging, I noticed that the property "activities" in the ProcessDefinition is empty (not null, but empty list). I don't know if this has anything to do with it, but since I saw the list is being accessed in initProcessDiagramCanvas() (iterating over it in a for-loop) I though it might be worth mentioning it.

Everything in my system is switched to Activiti 5.2 (DB as well as Webapp), and the process was generated with Activiti Designer 0.7.0. I attached the BPMN File.

walterjs
Champ in-the-making
Champ in-the-making
I got the same thing when I used the repository service to get the deployment because the activities list is empty. When I run it with the following code, I get one step further as the activities are set:

ProcessDiagramGenerator.generateDiagram((ProcessDefinitionEntity) execution.getProcessDefinition(), "png", execution.findActiveActivityIds());
Is this intentional?

Thanks
Walter

ahmetkara
Champ in-the-making
Champ in-the-making
Hi,

If I import the process using probe, it generates the image successfully. Are you running 5.2?


Yes, I am using 5.2. And I still have the same problem, couldn't solve it.

h_ter_schuur
Champ in-the-making
Champ in-the-making
The activiti-webapp-rest module uses the following code to get the ProcessDefinitionEntity:
ProcessDefinitionEntity pde = (ProcessDefinitionEntity) ((RepositoryServiceImpl) getRepositoryService())
        .getDeployedProcessDefinition(pi.getProcessDefinitionId());
Such process definition entity seems to have the activities initialized.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.