Create a gist now

Instantly share code, notes, and snippets.

Iterate over a collection using Redwood Script
{
Partition partition = jcsJob.getJobDefinition().getPartition();
JobDefinition jd = jcsSession.getJobDefinitionByName(partition, "JD_EchoInParameterValue_jamie_test");
String[] sArr = inParam.split("\n",-1);
int sArrLength = sArr.length;
jcsOut.println("sArrLength=" + String.valueOf(sArrLength));
int iterator = 0;
while (iterator < sArrLength){
jcsOut.println("sArr[Length]iterator]=" + String.valueOf(sArr[iterator]));
jcsOut.println(sArr[iterator]);
Job job = jd.prepare();
job.getJobParameterByName("in").setInValueString(sArr[iterator]);
jcsSession.persist();
iterator++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment