Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Using Oozie Worfklow Expression Language Functions in Hue

avatar
Explorer

I have a shell action node that is able to send notifications to a chat application and can be used as a transition route if another action node in the workflow fails. What I'd like to be able to do, is use wf:user() and wf:lastErrorNode() in that notification.

 

My idea was to pass these values to my shell script as arguments, but when I place 'wf:X()' as the argument to my shell action node, it doesn't resolve to anything and just gives me the raw string as the argument.

 

Is there a way to use these in a shell action node? 

1 ACCEPTED SOLUTION

avatar
Explorer
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
3 REPLIES 3

avatar
Master Collaborator

Hi James,

 

Could you share your XML action script for that SSH action?

 

In general, the following example shows how to pass arguments to your shell (from Oozie docs😞

<workflow-app name="sample-wf" xmlns="uri:oozie:workflow:0.1">
    ...
    <action name="myssjob">
        <ssh>
            <host>foo@bar.com<host>
            <command>YOURCOMMAND</command>
            <args>${wf:user()}</args>
            <args>${wf:lastErrorNode()}</args>
        </ssh>
        <ok to="myotherjob"/>
        <error to="errorcleanup"/>
    </action>
    ...
</workflow-app>

 Note the ${} syntax of the parameter.  If this helps, please accept this as a solution.

 

 

Regards,

Alex

avatar
Master Collaborator

If you are doing this through Hue, please post the generated XML once you submit the job.

avatar
Explorer
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login