<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Create a global variable in Oozie to be accessible to all actions? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Create-a-global-variable-in-Oozie-to-be-accessible-to-all/m-p/172463#M54306</link>
    <description>&lt;P&gt;I want to create a variable that should be available to all the actions in the Oozie workflow. I have tried to create it as shown below. But EL expression is not getting evaluated resulting in variable current_ts value as EL expression itself. Can somebody please throw some light on this?&lt;/P&gt;&lt;PRE&gt;    &amp;lt;workflow-app xmlns="uri:oozie:workflow:0.4" name="no-op-wf"&amp;gt;
      &amp;lt;parameters&amp;gt;
        &amp;lt;property&amp;gt;
          &amp;lt;name&amp;gt;current_ts&amp;lt;/name&amp;gt;
          &amp;lt;value&amp;gt;${replaceAll((replaceAll((replaceAll((timestamp()),"-","")),"T","_")),":","")}&amp;lt;/value&amp;gt;
        &amp;lt;/property&amp;gt;
      &amp;lt;/parameters&amp;gt;
      &amp;lt;start to="test"/&amp;gt;
      &amp;lt;kill name="test"&amp;gt;
        &amp;lt;!--message Just to show that this expression works if used here&amp;gt;Timestamp - [${replaceAll((replaceAll((replaceAll((timestamp()),"-","")),"T","_")),":","")}&amp;lt;/message--&amp;gt;
        &amp;lt;message&amp;gt;Timestamp - ${current_ts}&amp;lt;/message&amp;gt; &amp;lt;!-- this will print expression but not evaluate it --&amp;gt;
      &amp;lt;/kill&amp;gt;
      &amp;lt;end name="end"/&amp;gt;
    &amp;lt;/workflow-app&amp;gt;

&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Feb 2017 00:29:43 GMT</pubDate>
    <dc:creator>codetexas</dc:creator>
    <dc:date>2017-02-14T00:29:43Z</dc:date>
    <item>
      <title>Create a global variable in Oozie to be accessible to all actions?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Create-a-global-variable-in-Oozie-to-be-accessible-to-all/m-p/172463#M54306</link>
      <description>&lt;P&gt;I want to create a variable that should be available to all the actions in the Oozie workflow. I have tried to create it as shown below. But EL expression is not getting evaluated resulting in variable current_ts value as EL expression itself. Can somebody please throw some light on this?&lt;/P&gt;&lt;PRE&gt;    &amp;lt;workflow-app xmlns="uri:oozie:workflow:0.4" name="no-op-wf"&amp;gt;
      &amp;lt;parameters&amp;gt;
        &amp;lt;property&amp;gt;
          &amp;lt;name&amp;gt;current_ts&amp;lt;/name&amp;gt;
          &amp;lt;value&amp;gt;${replaceAll((replaceAll((replaceAll((timestamp()),"-","")),"T","_")),":","")}&amp;lt;/value&amp;gt;
        &amp;lt;/property&amp;gt;
      &amp;lt;/parameters&amp;gt;
      &amp;lt;start to="test"/&amp;gt;
      &amp;lt;kill name="test"&amp;gt;
        &amp;lt;!--message Just to show that this expression works if used here&amp;gt;Timestamp - [${replaceAll((replaceAll((replaceAll((timestamp()),"-","")),"T","_")),":","")}&amp;lt;/message--&amp;gt;
        &amp;lt;message&amp;gt;Timestamp - ${current_ts}&amp;lt;/message&amp;gt; &amp;lt;!-- this will print expression but not evaluate it --&amp;gt;
      &amp;lt;/kill&amp;gt;
      &amp;lt;end name="end"/&amp;gt;
    &amp;lt;/workflow-app&amp;gt;

&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Feb 2017 00:29:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Create-a-global-variable-in-Oozie-to-be-accessible-to-all/m-p/172463#M54306</guid>
      <dc:creator>codetexas</dc:creator>
      <dc:date>2017-02-14T00:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create a global variable in Oozie to be accessible to all actions?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Create-a-global-variable-in-Oozie-to-be-accessible-to-all/m-p/172464#M54307</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/15964/codetexas.html" nodeid="15964"&gt;@Abb Code&lt;/A&gt; Just try to see if by defining the required variable through global section in workflow.xml helps you. More details about defining global is available at following URL.&lt;/P&gt;&lt;P&gt;&lt;A href="https://oozie.apache.org/docs/4.2.0/WorkflowFunctionalSpec.html#a19_Global_Configurations" target="_blank"&gt;https://oozie.apache.org/docs/4.2.0/WorkflowFunctionalSpec.html#a19_Global_Configurations&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 00:49:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Create-a-global-variable-in-Oozie-to-be-accessible-to-all/m-p/172464#M54307</guid>
      <dc:creator>pbishnoi</dc:creator>
      <dc:date>2017-02-14T00:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create a global variable in Oozie to be accessible to all actions?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Create-a-global-variable-in-Oozie-to-be-accessible-to-all/m-p/172465#M54308</link>
      <description>&lt;P&gt;Thanks &lt;A href="https://community.hortonworks.com/questions/83232/create-a-global-variable-in-oozie-to-be-accessible.html#"&gt;@peeyush&lt;/A&gt; . I was able to use global property section to create a global variable and reference it in different actions in workflow. But it didn't work in the same workflow, I had to pass it to a sub workflow as a configuration property from another workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;  &amp;lt;global&amp;gt;
    &amp;lt;configuration&amp;gt;
      &amp;lt;property&amp;gt;
        &amp;lt;name&amp;gt;run_ts&amp;lt;/name&amp;gt;
        &amp;lt;value&amp;gt;${replaceAll((replaceAll((replaceAll((timestamp()),"-","")),"T","_")),":","")}&amp;lt;/value&amp;gt;
      &amp;lt;/property&amp;gt;
    &amp;lt;/configuration&amp;gt;
  &amp;lt;/global&amp;gt;


 &amp;lt;action name="coaching-tbl-subwf"&amp;gt;
    &amp;lt;sub-workflow&amp;gt;
      &amp;lt;app-path&amp;gt;/data/app/subwf.xml&amp;lt;/app-path&amp;gt;
      &amp;lt;propagate-configuration/&amp;gt;
 &amp;lt;/configuration&amp;gt;
    &amp;lt;/sub-workflow&amp;gt;
    &amp;lt;ok to="join-node"/&amp;gt;
    &amp;lt;error to="fail"/&amp;gt;
  &amp;lt;/action&amp;gt;




&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2017 05:16:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Create-a-global-variable-in-Oozie-to-be-accessible-to-all/m-p/172465#M54308</guid>
      <dc:creator>codetexas</dc:creator>
      <dc:date>2017-02-16T05:16:01Z</dc:date>
    </item>
  </channel>
</rss>

