-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathloop.xml
54 lines (49 loc) · 1.81 KB
/
loop.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<workflow-app name="loop_${loop_name}" xmlns="uri:oozie:workflow:0.4">
<start to="check_type"/>
<decision name="check_type">
<switch>
<case to="loop_range">${loop_type eq "range"}</case>
<case to="loop_list">${loop_type eq "list"}</case>
<default to="error"/>
</switch>
</decision>
<action name="loop_range">
<sub-workflow>
<app-path>/your/path/to/loop_range_step.xml</app-path>
<propagate-configuration/>
<configuration>
<property>
<name>loop_value</name>
<value>${loop_start}</value>
</property>
</configuration>
</sub-workflow>
<ok to="end"/>
<error to="error"/>
</action>
<action name="loop_list">
<sub-workflow>
<app-path>/your/path/to/loop_list_step.xml</app-path>
<propagate-configuration/>
<configuration>
<!-- See loop_list_step.xml for what's going on here -->
<property>
<name>loop_value</name>
<value>${replaceAll(replaceAll(loop_list, "([^,]*),?(.*)", "$1"),
"^$", "--NOVALUE--")}</value>
</property>
<property>
<name>loop_list</name>
<value>${replaceAll(replaceAll(loop_list,"([^,]*),?(.*)", "$2"),
"^$", "--ENDOFLIST--")}</value>
</property>
</configuration>
</sub-workflow>
<ok to="end"/>
<error to="error"/>
</action>
<kill name="error">
<message>Oops!</message>
</kill>
<end name="end"/>
</workflow-app>