How to Name Sequence Flow and make them visible on generated diagram

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2014 01:26 AM
Hi,
Iam stuck. I need help in naming SequenceFlows. When I use Eclipse Designer Iam able to name Sequence Flows and Also see them in the diagram inside the IDE.
But now the problem is, I have written a small program to generate BPM diagram using Activiti. It works perfectly, but in the generated diagram Iam unable to see the below set sequenceFlow name ( refer below to flow.setName()). I also tried generating the corresponding BPMN
XML, Iam able to see the name inside the XML. But this is not visible in the generated PNG. Can anybody help me out in this.
SequenceFlow flow = new SequenceFlow();
flow.setSourceRef(from);
flow.setTargetRef(to);
flow.setName("X > 10");
Iam stuck. I need help in naming SequenceFlows. When I use Eclipse Designer Iam able to name Sequence Flows and Also see them in the diagram inside the IDE.
But now the problem is, I have written a small program to generate BPM diagram using Activiti. It works perfectly, but in the generated diagram Iam unable to see the below set sequenceFlow name ( refer below to flow.setName()). I also tried generating the corresponding BPMN
XML, Iam able to see the name inside the XML. But this is not visible in the generated PNG. Can anybody help me out in this.
SequenceFlow flow = new SequenceFlow();
flow.setSourceRef(from);
flow.setTargetRef(to);
flow.setName("X > 10");
Labels:
- Labels:
-
Archive
11 REPLIES 11

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2014 06:24 AM
I think that the problem solved (Ruckenhof) is not relevant to your situation. It seems to me that the problem lies in the error Activiti Engine. Indeed, the generated PNG, names sequences are absent.
Indeed, in the case of dynamic (via API) describe the process of creating the names of sequences apparently formed incomplete. And therefore are not shown. I can not say exactly why.
However, in my opinion, the case https://github.com/Activiti/Activiti/pull/331 also not relevant to your situation. There is debate about the show names of sequences in Diagram viewer and corrections are included in the file js.
In org.activiti.image.impl.DefaultProcessDiagramCanvas.java:
If replace snippet
GraphicInfo labelGraphicInfo = bpmnModel.getLabelGraphicInfo(sequenceFlow.getId());
if (labelGraphicInfo != null) {
processDiagramCanvas.drawLabel(sequenceFlow.getName(), labelGraphicInfo, false);
}
with
GraphicInfo labelGraphicInfo = bpmnModel.getLabelGraphicInfo(sequenceFlow.getId());
List<GraphicInfo> gi = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId());
if (labelGraphicInfo != null) {
processDiagramCanvas.drawLabel(sequenceFlow.getName(), labelGraphicInfo, false);
} else if (gi != null && !gi.isEmpty()){
processDiagramCanvas.drawLabel(sequenceFlow.getName(), gi.get(0), false);
}
You view Sequences Names
But I'm not sure that this will be the right decision
Indeed, in the case of dynamic (via API) describe the process of creating the names of sequences apparently formed incomplete. And therefore are not shown. I can not say exactly why.
However, in my opinion, the case https://github.com/Activiti/Activiti/pull/331 also not relevant to your situation. There is debate about the show names of sequences in Diagram viewer and corrections are included in the file js.
In org.activiti.image.impl.DefaultProcessDiagramCanvas.java:
If replace snippet
GraphicInfo labelGraphicInfo = bpmnModel.getLabelGraphicInfo(sequenceFlow.getId());
if (labelGraphicInfo != null) {
processDiagramCanvas.drawLabel(sequenceFlow.getName(), labelGraphicInfo, false);
}
with
GraphicInfo labelGraphicInfo = bpmnModel.getLabelGraphicInfo(sequenceFlow.getId());
List<GraphicInfo> gi = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId());
if (labelGraphicInfo != null) {
processDiagramCanvas.drawLabel(sequenceFlow.getName(), labelGraphicInfo, false);
} else if (gi != null && !gi.isEmpty()){
processDiagramCanvas.drawLabel(sequenceFlow.getName(), gi.get(0), false);
}
You view Sequences Names
But I'm not sure that this will be the right decision
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2014 03:19 AM
shar, thanks for your insight. If one of you could perhaps create a pull-request for this, that would be great

