Question

I have sub workflows created with in the main workflow and they are called in the sequence that means when one completes then next sub workflow will be triggered but on the the failure of the sub-workflow, my main- workflow is not getting aborted and the next sub-workflow is getting triggered. The main workflow example is given below

<?xml version="1.0"?>
<workflow-app xmlns="uri:oozie:workflow:0.4" name="Mainworkflow_">
  <start to="subworkflow-node-abc"/>
  <action name="subworkflow-node-abc">
    <sub-workflow>
      <app-path>hdfs://link/abc.xml</app-path>
      <configuration>
        <property>
          <name>autoReconnect</name>
          <value>true</value>
        </property>
        <property>
          <name>TableName</name>
          <value>abc</value>
        </property>
        <property>
          <name>targetDirPath</name>
          <value>${targetDirPath}</value>
        </property>
      </configuration>
    </sub-workflow>
    <ok to="subworkflow-node-def"/>
    <error to="kill"/>
  </action>
  <action name="subworkflow-node-def">
    <sub-workflow>
      <app-path>hdfs://def.xml</app-path>
      <configuration>
        <property>
          <name>autoReconnect</name>
          <value>true</value>
        </property>
        <property>
          <name>TableName</name>
          <value>def</value>
        </property>
        <property>
          <name>targetDirPath</name>
          <value>${targetDirPath}</value>
        </property>
      </configuration>
    </sub-workflow>
    <ok to="end"/>
    <error to="kill"/>
  </action>
  <kill name="kill">
    <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
  </kill>
  <end name="end"/>
</workflow-app>

So in the above example, the second workflow is getting triggered. Can anyone tell the way to kill that main workflow in case it aborts.

Was it helpful?

Solution 2

there was different error. the Kill node was not getting executed due to the mistake. We have to use EL commands only in the Main workflow so at Kill node the workflow was having the other parameter which was making the kill node stuck and main work flow was not getting aborted

OTHER TIPS

you can use Decision Control Node

For example if the output of the suv-workflow doesn't exist - send to end/fail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top