workflow.setActions(actions);
return workflow;
}
private static JsonWorkflowAction createDummyAction(int idx) {
JsonWorkflowAction action = new JsonWorkflowAction();
int mod = idx % 5;
action.setId(ACTION_ID + idx);
action.setExternalId(EXT_ID + idx);
action.setConsoleUrl("http://blah:blah/blah/" + idx);
action.setConf("<configuration/>");
action.setData(null);
action.setStartTime(new Date());
action.setEndTime(new Date());
action.setErrorInfo(null, null);
action.setExternalStatus((idx % 2) == 0 ? "RUNNING" : "OK");
action.setName(ACTION_ID + idx);
action.setRetries(idx);
action.setTrackerUri("http://trackerhost:blah/blah/" + idx);
action.setTransition("OK");
switch (mod) {
case 0: {
action.setType("hadoop");
break;
}
case 1: {
action.setType("fs");
break;
}
case 2: {
action.setType("pig");
break;
}
case 3: {
action.setType("ssh");
break;
}
case 4: {
action.setType("decision");
break;
}
}
return action;