* @param context NodeHandler context.
* @throws WorkflowException thrown if there was an error parsing the action configuration.
*/
@SuppressWarnings("unchecked")
protected static void liteExecute(NodeHandler.Context context) throws WorkflowException {
XLog log = XLog.getLog(LiteWorkflowStoreService.class);
String jobId = context.getProcessInstance().getId();
String nodeName = context.getNodeDef().getName();
String skipVar = context.getProcessInstance().getVar(context.getNodeDef().getName()
+ WorkflowInstance.NODE_VAR_SEPARATOR + ReRunXCommand.TO_SKIP);
boolean skipAction = false;
if (skipVar != null) {
skipAction = skipVar.equals("true");
}
WorkflowActionBean action = new WorkflowActionBean();
String actionId = Services.get().get(UUIDService.class).generateChildId(jobId, nodeName);
if (!skipAction) {
String nodeConf = context.getNodeDef().getConf();
String executionPath = context.getExecutionPath();
String actionType;
try {
Element element = XmlUtils.parseXml(nodeConf);
actionType = element.getName();
nodeConf = XmlUtils.prettyPrint(element).toString();
}
catch (JDOMException ex) {
throw new WorkflowException(ErrorCode.E0700, ex.getMessage(), ex);
}
log.debug(" Creating action for node [{0}]", nodeName);
action.setType(actionType);
action.setExecutionPath(executionPath);
action.setConf(nodeConf);
action.setLogToken(((WorkflowJobBean) context.getTransientVar(WORKFLOW_BEAN)).getLogToken());
action.setStatus(WorkflowAction.Status.PREP);
action.setJobId(jobId);
}
action.setCred(context.getNodeDef().getCred());
log.debug("Setting action for cred: '"+context.getNodeDef().getCred() +
"', name: '"+ context.getNodeDef().getName() + "'");
action.setUserRetryCount(0);
int userRetryMax = getUserRetryMax(context);
int userRetryInterval = getUserRetryInterval(context);
action.setUserRetryMax(userRetryMax);
action.setUserRetryInterval(userRetryInterval);
log.debug("Setting action for userRetryMax: '"+ userRetryMax +
"', userRetryInterval: '" + userRetryInterval +
"', name: '"+ context.getNodeDef().getName() + "'");
action.setName(nodeName);
action.setId(actionId);