private static JsonObject analyzeJobflow(FlowScript flowScript) {
assert flowScript != null;
JsonArray phases = new JsonArray();
for (Map.Entry<ExecutionPhase, Set<ExecutionScript>> entry : flowScript.getScripts().entrySet()) {
ExecutionPhase phase = entry.getKey();
if (entry.getValue().isEmpty() == false
|| phase == ExecutionPhase.SETUP
|| phase == ExecutionPhase.CLEANUP) {
phases.add(new JsonPrimitive(phase.getSymbol()));
}
}
JsonObject jobflow = new JsonObject();
jobflow.addProperty("id", flowScript.getId());
jobflow.add("blockers", toJsonArray(flowScript.getBlockerIds()));