// create link and wire it
link(connection, addedSequenceFlow);
// add dynamic text decorator for the reference name
ConnectionDecorator textDecorator = peCreateService.createConnectionDecorator(connection, true, 0.5, true);
MultiText text = gaService.createDefaultMultiText(getDiagram(), textDecorator);
text.setStyle(StyleUtil.getStyleForTask((getDiagram())));
text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
if (OSUtil.getOperatingSystem() == OSEnum.Mac) {
text.setFont(gaService.manageFont(getDiagram(), text.getFont().getName(), 11));
}
if(addConContext.getProperty("org.activiti.designer.connectionlabel") != null) {
GraphicInfo labelLocation = (GraphicInfo) addConContext.getProperty("org.activiti.designer.connectionlabel");
gaService.setLocation(text, (int)labelLocation.getX(), (int)labelLocation.getY());
} else {
gaService.setLocation(text, 10, 0);
}
if (StringUtils.isNotEmpty(addedSequenceFlow.getName())) {
TextUtil.setTextSize(addedSequenceFlow.getName(), text);
}
// set reference name in the text decorator
text.setValue(addedSequenceFlow.getName());
// add static graphical decorators (composition and navigable)
ConnectionDecorator cd = peCreateService.createConnectionDecorator(connection, false, 1.0, true);
createArrow(cd);