Permalink
Browse files

adding properties for optional input in updates

  • Loading branch information...
1 parent 24e1114 commit 52c7fe4bdef6d1bbcf3d70324614eb578e1e9504 Shwetha GS committed Nov 6, 2012
Showing with 18 additions and 17 deletions.
  1. +18 −17 process/src/main/java/org/apache/ivory/workflow/OozieProcessWorkflowBuilder.java
@@ -54,22 +54,8 @@
for (String clusterName: clusters) {
org.apache.ivory.entity.v0.process.Cluster processCluster = ProcessHelper.getCluster(process, clusterName);
Properties properties = newWorkflowSchedule(process, processCluster.getValidity().getStart(), clusterName);
- if (properties == null) continue;
-
- //Add libpath
- String libPath = process.getWorkflow().getLib();
- if (!StringUtils.isEmpty(libPath)) {
- String path = libPath.replace("${nameNode}", "");
- properties.put(OozieClient.LIBPATH, "${nameNode}" + path);
- }
-
- if(process.getInputs() != null) {
- for(Input in:process.getInputs().getInputs())
- if(in.isOptional())
- addOptionalInputProperties(properties, in, clusterName);
- }
-
- propertiesMap.put(clusterName, properties);
+ if (properties != null)
+ propertiesMap.put(clusterName, properties);
}
return propertiesMap;
}
@@ -122,7 +108,22 @@ public Properties newWorkflowSchedule(Process process, Date startDate, String cl
if(!mapper.map(cluster, bundlePath)){
return null;
}
- return createAppProperties(clusterName, bundlePath);
+
+ Properties properties = createAppProperties(clusterName, bundlePath);
+
+ //Add libpath
+ String libPath = process.getWorkflow().getLib();
+ if (!StringUtils.isEmpty(libPath)) {
+ String path = libPath.replace("${nameNode}", "");
+ properties.put(OozieClient.LIBPATH, "${nameNode}" + path);
+ }
+
+ if(process.getInputs() != null) {
+ for(Input in:process.getInputs().getInputs())
+ if(in.isOptional())
+ addOptionalInputProperties(properties, in, clusterName);
+ }
+ return properties;
}
@Override

0 comments on commit 52c7fe4

Please sign in to comment.