SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(connection, SequenceFlow.class);
SequenceFlow defaultFlow = getDefaultFlow(flow.getSourceRef());
boolean isDefault = defaultFlow == null ? false : defaultFlow.equals(flow);
Tuple<ConnectionDecorator, ConnectionDecorator> decorators = getConnectionDecorators(connection);
ConnectionDecorator def = decorators.getFirst();
ConnectionDecorator cond = decorators.getSecond();
if (isDefault) {
if (cond != null) {
peService.deletePictogramElement(cond);
}
def = createDefaultConnectionDecorator(connection);
GraphicsAlgorithm ga = def.getGraphicsAlgorithm();
ga.setForeground(manageColor(connection,StyleUtil.CLASS_FOREGROUND));
} else {
if (def != null) {
peService.deletePictogramElement(def);
}
if (flow.getConditionExpression() != null && flow.getSourceRef() instanceof Activity) {
cond = createConditionalConnectionDecorator(connection);
GraphicsAlgorithm ga = cond.getGraphicsAlgorithm();
ga.setFilled(true);
ga.setForeground(manageColor(connection,StyleUtil.CLASS_FOREGROUND));
ga.setBackground(manageColor(connection,IColorConstant.WHITE));
}
}