cancel
Showing results for 
Search instead for 
Did you mean: 

Flow image generated by Activiti doesn't match the coordinates in flow definition with the presence of exclusive gateway.

xjshangguan
Champ in-the-making
Champ in-the-making
Hi,

We keep track of flow running status by making the flow component in different color.  The code used is C++, which reads the coordinates specified in the bpmn and matches the flow image generated by Activiti.  But we noticed that with Exclusive Gateway in a flow, the image generated by Activiti does not match the coordinates specified in flow definition.    All components in the flow are off and the degrees are not the same.

This situation may appy to other gateways but we are not sure yet.

Any suggestion ?
7 REPLIES 7

jbarrez
Star Contributor
Star Contributor
Do you have two images that do a side by side comparison?

Afaik, we don't do anything special transformation on those coordinates

xjshangguan
Champ in-the-making
Champ in-the-making
Hi,
Thanks for replying.   Here is more information regarding the problem of the layout coordinates.   I am attaching a file with my test results.  The comparisons between the flow definition (extract from DB using API call) and the DiagramLayout were carried out for two identical flows with and without an exclusive gateway.  The API calls are

// To get the flow definition
ByteArrayInputStream is = (ByteArrayInputStream) commandExecutorBean
    .execute(new GetDeploymentProcessModelCmd(flowDefId));

// Get flow DisgramLayout
DiagramLayout layoutLocal = ProcessEngines.getDefaultProcessEngine().getRepositoryService().getProcessDiagramLayout(flowDefId);

The diagram is generated by using
ProcessDiagramGenerator.generatePngDiagram(ProcessDefinitionEntity pde);

The results are attached. 
It seems to me the diagram is generated using the coordinates defined in flow definition but the diagram layout is different from both flow definition and the diagram.

Any suggestions?   Do we have any better API calls? 

Thanks a lot.

Sean

jbarrez
Star Contributor
Star Contributor
Could it be that the auto layout mechanism is being executed? The thing is, that shouldn't happen when diagram interchange information is present …

How are you deploying the process. Is the process xml exactly the same as the which is in the first part of your attachment above?

xjshangguan
Champ in-the-making
Champ in-the-making
Hi Joram,

I am not aware of the auto layout mechanism at all and am looking at it.  The processes are deployed in two means either by auto deploy in the Activiti configuration (will be the only method when going to production) or by repositoryService.createDeployment().addClasspathResource(String resourcePath).   But the test flows used above were deployed using the later one.  The process XML original created (by Desinger with DI information) were found to be same as the one extracted later using the API.  BTW, I am still using Activiti 5.11 and also haven't updated the Designer to the latest version yet.

Thanks again for the advice.

All the best,

Sean

xjshangguan
Champ in-the-making
Champ in-the-making
Hi Joram,

Here is the update. We finally found out this is because of the flow names defined for sequence flows.  With the names of sequence flows defined, some BPMN Labels are generated by Activiti Designer.  These labels are those that created the problem, altering the cordinates of other components defined in the flow.  The reason why we feel it is because of the presence of exclusive gateways is that we normally don't give names to  sequence flows unless we would show flow logic with exclusive gateways. 

<bpmndi:BPMNLabel>
          <omgdc:Bounds height="14" width="100" x="-10" y="0"></omgdc:Bounds>
</bpmndi:BPMNLabel>


Therefore, not giving any names to sequence flows fixes the problem.  But there must be some bug in Activiti.

Thanks
Sean



trademak
Star Contributor
Star Contributor
Hi Sean,

I tried to reproduce this issue, but it's working fine for me.
I've created a simple process definition with an exclusive gateway and sequence flow labels.
But the image generated by Activiti is just looking fine, so the coordinates in the BPMN DI must be fine as well then.
Can you share your process definition and an image showing the issue?

Best regards,