流程节点处理人使用脚本返回身份数组可以吗?
var inWhile = true;//是否在while循环体内
var creatorUnitDn = this.workContext.getWork().creatorUnitDn;
alert("creatorUnitDn:" + creatorUnitDn);//北土城研发总部@571104078@U
var creatorUnit =this.workContext.getWork().creatorUnit;
alert("creatorUnit:" + creatorUnit);//北土城研发总部
var identityList1;//身份数组。
while(inWhile) {
alert("creatorUnitDn:" + creatorUnitDn);
//同步执行,返回身份数组。
identityList1 = this.org.getDuty("组织负责人",creatorUnitDn);
alert("identityList1:" + identityList1);//null,,
alert("identityList1.length:" + identityList1.length);//0,1,2
if(identityList1.length > 0) {
inWhile = false;
break;//跳出while循环体
}
//同步执行,返回嵌套上级组织数组。nested Boolean true嵌套的所有上级组织;false直接上级组织;默认false。
var unitList = this.org.listSupUnit(creatorUnitDn,false);
unitList.forEach(function(item){
alert("item.name:" + item.name);//研发中心
alert("item.unique:" + item.unique);//571109097
alert("item.distinguishedName:" + item.distinguishedName);//研发中心@571109097@U
creatorUnitDn = item.distinguishedName;
});
}
return identityList1;
alert("creatorUnit:" + creatorUnit);//北土城研发总部
这个应该报错了
这个是后台脚本,您可以加print("内容")
页:
[1]