I have 2 action nodes in workflow : javaMainAction
and javaMainAction2
.
My LoadApplicationService
method returns SUCCESS or FAILURE after execution.
How to check response if SUCCESS is returned?
workflow.xml :
<workflow-app name="WorkflowJavaMainAction" xmlns="uri:oozie:workflow:0.1">
<start to="javaMainAction" />
<action name="javaMainAction">
<java>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<main-class>in.augmentiq.maxiq.dataschedular.services.LoadApplicationService</main-class>
<arg>${workflowAppPath}/javaMainActionInput/schedule_config.properties</arg>
<arg>${workflowAppPath}/javaMainActionInput/appRequestParams.json</arg>
<capture-output/>
</java>
<ok to="javaMainAction2" />
<error to="killJobAction" />
</action>
<action name="javaMainAction2">
<java>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<main-class>in.augmentiq.maxiq.dataschedular.services.LoadApplicationService</main-class>
<arg>${workflowAppPath}/javaMainAction2Input/schedule_config.properties</arg>
<arg>${workflowAppPath}/javaMainAction2Input/appRequestParams.json</arg>
<capture-output/>
</java>
<ok to="end" />
<error to="killJobAction" />
</action>
<kill name="killJobAction">
<message>"Killed job due to error: ${wf:errorMessage(wf:lastErrorNode())}"</message>
</kill>
<end name="end" />
</workflow-app>
LoadApplicationService
needs to write the output into akey=pair
format e.g.response=SUCCESS
. The you can inspect the output like this:Use Decision control node for comparing and taking decision Decision_Control_Node.
The main() method writes a Property file to the path specified in the
oozie.action.output.properties
ENVIRONMENT variable. Reference