1. prepare shell case
$ hdfs dfs -cat oozie/apps/hue/hello_hue.sh
#!/bin/sh
echo "my_output=Hello Mushishi"
2. create shell workflow
1) enter oozie editor
2) assign app name as "shell"
3) add a description (if need)
4) drag and drop a shell action node to an acvtive area
5) select and fill script name into "shell command" field, click "Add", then add the script to "FILES"
6) click Save button on top right corner
7) click Submit button nearby
Then hello_hue.sh is running, after it done, you can check workflow / job log from panel
hue_oozie_shell
3. add fork to workflow
1) open workflow "shell" from "My documents"
2) click "Edit"
3) change app name to "shell-fork"
4) drag and drop a Kill action node under shell action node, add error message if needs
5) drag and drop another Kill action node to the right of the previous Kill node
6) then a fork node pops up, convert it to Decision node
7) fill and modify conditions as needs, ensure all node name are proper and "capture output" is opened
8) remove useless node if any
9) save and submit "shell-fork" workflow
Then you can verify result via workflow / job log, or see job DAG graph directly on oozie console
hue_oozie_shell_fork
btw, workflow xml created by hue looks like this:
<workflow-app name="shell-fork" xmlns="uri:oozie:workflow:0.5">
<start to="shell-50ec"/>
<kill name="Kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="shell-50ec">
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<exec>/user/sun_xo/oozie/apps/hue/hello_hue.sh</exec>
<file>/user/sun_xo/oozie/apps/hue/hello_hue.sh#hello_hue.sh</file>
<capture-output/>
</shell>
<ok to="decision-8c70"/>
<error to="Kill"/>
</action>
<kill name="kill-21d4">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<decision name="decision-8c70">
<switch>
<case to="End">
${wf:actionData('shell-50ec')['my_output'] eq 'Hello Mushishi'}
</case>
<default to="kill-21d4"/>
</switch>
</decision>
<end name="End"/>
</workflow-app>
reference Hue Guide > User > Scheduler