HCL Workload Automation, Version 9.4

Example

The following is a coding example of editSubmitJobStreamWithJobVarSub:
String description = "";
	String group = null;
	String owner = null;
	String ownerDescription = null;
	String variableTable = "STREAM1";
		        	
	List<ZosJobInfo>jobsToDelete = new ArrayList<ZosJobInfo>();
     List<ZosJobInfo>jobsToAdd = new ArrayList<ZosJobInfo>();

     List<ZosJobInfo>jobsToModify = new ArrayList<ZosJobInfo>();
     ZosJobInfo job1 = new ZosJobInfo();
     job1.setJobNumber(5);
     job1.setJobName("EXEC1");
     jobsToModify.add(job1);
     ZosJobInfo job2 = new ZosJobInfo();
     job2.setJobNumber(10);
     job2.setJobName("EXEC2");
     jobsToModify.add(job2);
     ZosJobInfo job21 = new ZosJobInfo();
     job21.setJobNumber(15);
     job21.setJobName("EXEC3");
     jobsToModify.add(job21);
     ZosJobInfo job3 = new ZosJobInfo();
     job3.setJobNumber(20);
     job3.setJobName("EXEC4");
     jobsToModify.add(job3);

     HashMap<String, List<Integer>> dependencyToDelete = new HashMap<String, List<Integer>>();
     HashMap<String, List<Integer>> dependencyToAdd = new HashMap<String, List<Integer>>();

     // default (for all jobs) JCL variables values
		 String[][] variablesToBeSubstituted = new String [1][2];
	 variablesToBeSubstituted [0][0] = "VAR1";
	 variablesToBeSubstituted [0][1] = "ValVar1ForExec2And3";
		            
	 String authorityGroup = null;
	 boolean holdAll = true;
	 DependenciesResolutionOption resolutionOption = DependenciesResolutionOption.RESOLUTION_ALL;
		            
	 // job level JCL variables values
	 HashMap<Integer, String[][]> jobVariablesToBeSubstituted = new HashMap<Integer, String[][]>();
   String [][] variablesMap1 = new String [3][2];
   variablesMap1 [0][0] = "VAR1";
   variablesMap1 [0][1] = "ValVar1ForExec1";
   variablesMap1 [1][0] = "VAR2";
	  variablesMap1 [1][1] = "ValVar2ForExec1";
   variablesMap1 [2][0] = "VAR3";
   variablesMap1 [2][1] = "ValVar3ForExec1";
   int jobNum = 5;
	
   jobVariablesToBeSubstituted.put(jobNum, variablesMap1);
		            
	 String [][] variablesMap2 = new String [2][2];
	 variablesMap2 [0][0] = "VAR2";
  variablesMap2 [0][1] = "ValVar2ForExec2";
	 variablesMap2 [1][0] = "VAR4";
	 variablesMap2 [1][1] = "ValVar4ForExec2";
	 jobNum = 10;
		            
	 jobVariablesToBeSubstituted.put(jobNum, variablesMap2);
		            
	 String [][] variablesMap3 = new String [2][2];
	 variablesMap3 [0][0] = "VAR2";
	 variablesMap3 [0][1] = "ValVar2ForExec3";
	 variablesMap3 [1][0] = "VAR4";
  variablesMap3 [1][1] = "ValVar4ForExec3";
	 jobNum = 15;
		            
	 jobVariablesToBeSubstituted.put(jobNum, variablesMap3);
		            
	 String [][] variablesMap4 = new String [4][2];
	 variablesMap4 [0][0] = "VAR3";
	 variablesMap4 [0][1] = "ValVar3ForExec4";
	 variablesMap4 [1][0] = "VAR4";
	 variablesMap4 [1][1] = "ValVar4ForExec4";
  variablesMap4 [2][0] = "VAR5";
	 variablesMap4 [2][1] = "ValVar5ForExec4";
	 variablesMap4 [3][0] = "VAR6";
	 variablesMap4 [3][1] = "ValVar6ForExec4";
	 jobNum = 20;
		            
	 jobVariablesToBeSubstituted.put(jobNum, variablesMap4);
		            
	 Context context = null;
		            
					
	 @SuppressWarnings("unchecked")
       List<Identifier> list = plan.editAddJobStreamInstanceWithVariableSubstitution(
                              JSName, startTime, deadlineTime, priority, description,
                              group, owner, ownerDescription, variableTable, jobsToDelete,
                              jobsToAdd, jobsToModify, dependencyToDelete, dependencyToAdd,
                              variablesToBeSubstituted, authorityGroup, holdAll, 
                              resolutionOption, jobVariablesToBeSubstituted, context);