查看: 6566|回复: 1

流程节点处理人使用脚本返回身份数组可以吗?

升级   1.5%

22

主题

19

回帖

150

积分

注册会员

Rank: 2

积分
150
发表于 2021-12-22 10:42:52 | 显示全部楼层 |阅读模式

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,[object Object],[object Object]
    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;





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

升级   100%

139

主题

1万

回帖

4万

积分

超级版主

Rank: 8Rank: 8

积分
41458
发表于 2021-12-23 10:10:05 | 显示全部楼层
alert("creatorUnit:" + creatorUnit);//北土城研发总部

这个应该报错了
这个是后台脚本,您可以加print("内容")
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系客服 关注微信 下载APP 返回顶部 返回列表
viewthread