You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Marcelo Valle <mv...@redoop.org> on 2013/11/29 11:13:10 UTC

workflow.xml not using variable declared in coordinator.xml

Hello,

I'm triying to use variable named inputs in coordinator.xml:

<!-- Coordinator simple example -->
<coordinator-app name="maxTemperatureCoordinator"
frequency="${coord:minutes(10)}" start="${startTime}" end="${endTime}"
timezone="${timezone}" xmlns="uri:oozie:coordinator:0.2">

   <datasets>
         <dataset name="cuarter" frequency="${coord:minutes(5)}"
initial-instance="${startTime}" timezone="${timezone}">

 <uri-template>hdfs://mvalle1:8020/data/temperatures/${YEAR}/${MONTH}/${DAY}/${HOUR}/${MINUTE}</uri-template>
         </dataset>
   </datasets>
   <input-events>
         <data-in name="coordInput1" dataset="cuarter">
              <start-instance>${coord:current(-4)}</start-instance>
              <end-instance>${coord:current(-3)}</end-instance>
         </data-in>
  </input-events>

   <action>
      <workflow>
             <app-path>${workflowPath}</app-path>
             <configuration>
                <property>
                        <name>inputs</name>
                        <value>${coord:dataIn('coordInput1')}</value>
                </property>
             </configuration>
      </workflow>
   </action>
</coordinator-app>


And then use it in workflow.xml:

<workflow-app xmlns="uri:oozie:workflow:0.2" name="map-reduce-wf">
    <start to="mr-node"/>
    <action name="mr-node">
        <map-reduce>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <prepare>
                <delete
path="${nameNode}/user/${wf:user()}/${examplesPath}/output-data/${outputDir}"/>
            </prepare>
            <configuration>
                 ......
                    <name>mapreduce.input.fileinputformat.inputdir</name>
                    <value>${inputs}</value>
                </property>
                 .......
            </configuration>
        </map-reduce>
        <ok to="end"/>
        <error to="fail"/>
    </action>
    <kill name="fail">
        <message>Map/Reduce failed, error
message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

But map-reduce job isn't working, and in logs I can see this line:

131128112603220-oozie-oozi-W@mr-node] ELException in ActionStartXCommand
javax.servlet.jsp.el.ELException: variable [inputs] cannot be resolved

I'm doing something wrong?
Thanks for the help!

~ Marcelo