javascript模板
==========================================================================
var prevRow=previous_result.getRows();
if (prevRow == null && (prevRow.size()=0))
{
false ;
}else{
parent_job.setVariable("tasks" , prevRow); //ArrayList存储task变量名
parent_job.setVariable("size" , prevRow.size()); //存储task的总数量
parent_job.setVariable("i" , 0); //循环控制变量
parent_job.setVariable("TASKNAME" , prevRow.get(0).getString("task_name","") );
true;
}
==========================================================================
var prevRow=previous_result.getRows();//获取上一个传递的结果
var i=new Number(0);//循环初始变量控制
if(prevRow == null && (prevRow.size()=0))
{
false;//返回结果
} else {
parent_job.setVariable("i", i);//循环初始值设置
parent_job.setVariable("size", prevRow.size());//循环总数量
parent_job.setVariable("name", prevRow.get(i).getString("name", ""));//获取第几条数据的值
parent_job.setVariable("province", prevRow.get(i).getString("province", ""));
parent_job.setVariable("uid", prevRow.get(i).getString("uid", ""));
parent_job.setVariable("city", prevRow.get(i).getString("city", ""));
true;//返回结果
}
==========================================================================
var prevRow=previous_result.getRows();//获取上一个传递的结果
var i=new Number(parent_job.getVariable("i"));//获取循环变量
var size=new Number(parent_job.getVariable("size"));//循环总数
if(i<size) {
parent_job.setVariable("name", prevRow.get(i).getString("name", ""));
parent_job.setVariable("province", prevRow.get(i).getString("province", ""));
parent_job.setVariable("uid", prevRow.get(i).getString("uid", ""));
parent_job.setVariable("city", prevRow.get(i).getString("city", ""));
}
parent_job.setVariable("i", i+1);//变量加1
true;
==========================================================================