if (coordinate.getRoleList().size() == 0) {
String viewOption = (String) options.get(ViewerOptions.SWIMLANE);
options.put(viewOption, viewOption);
} else {
SwimlaneViewer viewer = new SwimlaneViewer();
sb.append(viewer.render(graph, coordinate, instance, options));
sb.append("</div>");
sb.append(getScriptSourceForBegin(drawLinerNamespace));
sb = coordinate.appendCoordinateFunctionScript(instance , sb, options);
sb.append(getScriptSourceForEnd(drawLinerNamespace));
return sb;
}
} catch (Exception e) {
e.printStackTrace();
return sb;
}
} else if (options.containsKey("ganttchart")) {
GanttActivityViewer Viewer = new GanttActivityViewer();
sb.append(Viewer.render(activity, instance, options));
sb.append("</div>");
return sb;
}
if (options.containsKey("viewOnlyScopeTracingTag")) {
String viewOnlyScopeTracingTag = (String)options.get("viewOnlyScopeTracingTag");
activity = ((ProcessDefinition)activity).getActivity(viewOnlyScopeTracingTag);
}
if (instance != null && options.containsKey("total cost")) {
try {
long totalCost = CostDeterminationFilter.getTotalCost(instance);
sb.append("<b>Total Cost: </b>" + totalCost);
} catch(Exception e) { }
}
boolean isVertical = options.containsKey("vertical");
// if (isFlowChartCenter) sb.append("<center>"); //flowchart center
sb.append("<table border=0 cellpadding=0 cellspacing=0 style=\"margin:0 auto;\"><tr>");
sb.append("<td align=center><img src="+imagePathRoot+"images/start"+(isVertical? "_vertical":"")+".gif></td>");
if(isVertical) sb.append("</tr><tr>");
sb.append("<td>");
sb.append("<table border='0' cellpadding='0' cellspacing='1'><tr>");
ComplexActivity cActivity = (ComplexActivity)activity;
//System.out.println("ProcessDefinitionViewer::render : number of child activities: " + cActivity.getChildActivities().size());
for(Enumeration enumeration = cActivity.getChildActivities().elements(); enumeration.hasMoreElements(); ){
Activity child = (Activity)enumeration.nextElement();
ActivityUtil activityUtil = new ActivityUtil();
if (child instanceof ScopeActivity) indexOfScopeActivity++;
if (viewOnlyScopeIndex > -1 && indexOfScopeActivity != viewOnlyScopeIndex) continue;
if (!activityUtil.isVisible(child, options)) {
boolean isGrayArrow = false;
if (!definitionView)
try{
isGrayArrow = Activity.STATUS_READY.equals(child.getStatus(instance));
}catch(Exception e){}
if (isVertical) sb.append("<tr>");
sb.append("<td align=center><img src="+imagePathRoot+"images/arrow" + (isVertical ? "_vertical":"") +".gif" + (isGrayArrow ? " style='filter:alpha(opacity="+unfocusedOpacity+")'":"") +" /></td>");
if(isVertical){
sb.append("</tr><tr>");
}
sb.append("<td align='center' id='" + DefaultActivityViewer.getActivityName(child, instance, options) + "'>");
ActivityViewer viewer = DefaultActivityViewer.createViewer(child);
sb.append(viewer.render(child, instance, options));
sb.append("</td>");
if (isVertical) sb.append("</tr>");
}
}