hadoopoozieoozie-coordinator

Dynamic Variable inside Oozie EL Function


I am writing a frequency-based coordinator workflow.
The configs are stored in some oozie.wf.properties file as:

-- java properties config
myFrequencyDays=1

The coordinator definition looks like:

<coordinator-app xmlns="uri:oozie:coordinator:0.4" name="MyCoord"  frequency="${coord:days($myFrequencyDays)}" start="${coordStartTime}" end="${coordEndTime}" timezone="${timezone}">  
   <action>
      <workflow>
         <app-path>${appLocation}/application.workflow.xml</app-path>
      </workflow>
   </action>
</coordinator-app>

This however fails with EL Parsing error because of ${coord:days($myFrequencyDays)}
Any idea to achieve this ?


Solution

  • You won't be able to use a parameter from properties inside of an Oozie EL function. The solution would be to use the chron syntax described in the Coordinator Functional Spec.

    So, in your properties file you would have something like frequency="0 12 * * *" and the coordinator definition would include frequency=${frequency}