cancel
Showing results for 
Search instead for 
Did you mean: 

Process image

franklin
Champ in-the-making
Champ in-the-making
Hi all,

Is it possible to get the process image with current situation of the process?
I mean, get the image process showing the current task with diferent color?

I know that is possible to get the process imagem by this code:

ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
                                                  .processDefinitionKey(processDefinitionName).singleResult();

      String diagramResourceName = processDefinition.getDiagramResourceName();
      InputStream  imageStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), diagramResourceName);

But it always bring me the image without show the current task with diferent color.

Thank you all.
18 REPLIES 18

unknown-user
Champ on-the-rise
Champ on-the-rise
Hi,

I have exactly the same problem like gant.

Any idea, why the process diagram is generated like this?

Thanks,
Markus

frederikherema1
Star Contributor
Star Contributor
Can you attach the process bpmn20.xml and the image so we can have a closer look?

gant
Champ in-the-making
Champ in-the-making
Attached you can find my activiti-project and the generated image.

Thanks
michael

frederikherema1
Star Contributor
Star Contributor

gant
Champ in-the-making
Champ in-the-making
Attached, you can find a patch (and corresponding image), that makes the business rule task rendered. Maybe you could put it to the trunk.

I don't have a solution for the sequence flows. But it's a Designer issue. The coords are already wrong in the generated bpmn20.xml file. I could not find out, why this happens, this might be, because I haven't understood the .activiti file.

I drew both connections that were wrong new. One was then transfered to the xml correctly, the second still has the wrong coords.

Regards michael

frederikherema1
Star Contributor
Star Contributor
Thanks, I'll look at the patch tomorow.

unknown-user
Champ on-the-rise
Champ on-the-rise
Thanks gant, for the patch.

I have similar issues with the wrong layout of sequence flows. As you already stated: must be a Designer issue.

Interestingly, I used this functionality already earlier (Activiti 5.5) and I didn't have any problem (layout was correct).

I wonder, if it would be possible to do the layout on the fly (without using the information the bpmn20.xml).
Since I'm generating and deploying processes programmatically, my bmpn20.xml instances lack of those information, which makes it impossible for me to use the diagram generator in such cases.

Thanks,
Markus

frederikherema1
Star Contributor
Star Contributor
Auto-layouting is a very difficult thing, whole books have been written about it… For simple processes, it's straight-forward, but once the process gets complexer…

martin_grofcik
Confirmed Champ
Confirmed Champ
Hello Nana111,

I saw your comment in different thread. (http://forums.activiti.org/comment/20106#comment-20106)
I am sorry but I do not understand your problem. What do you want to achieve?
You can get input stream from ProcessDiagramGenerator. InputStream can be written to the file.


InputStream imageStream = ProcessDiagramGenerator.generateDiagram((ProcessDefinitionEntity)repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(), "png", runtimeService.getActiveActivityIds(executionId));