获取组织管理架构org对象
你可以通过org对象获取组织中的人员、人员属性、组织、组织属性、身份、群组和角色。
Syntax:
您可以在流程表单、内容管理表单和门户页面中,通过this来获取当前实例的org对象,如下:
var org = this.org;
组织信息: unit操作
getUnit
Syntax:
var unitList = this.org.getUnit( unit );
Arguments:
unit : (string JsonObject or array)必选。
可以是组织的distinguishedName、name、id、unique属性值,组织对象,或者是上述属性值和对象的数组。
//以下均为合法参数
//组织属性值
"开发部@kfb@U" //组织标识名
"cce8bc22-225a-4f85-8132-7374d546886e" //id
"kfb" //组织唯一标识
"开发部" //组织名称
//对象
{ "distinguishedName": "开发部@kfb@U" } //组织识别名
{ "unique": "cce8bc22-225a-4f85-8132-7374d546886e" } //组织唯一标识
{ "unique": "kfb" } //组织唯一标识
{ "name": "开发部" } //组织对象
//上述属性组和对象数组
[ "开发部", "综合部" ] //名称数组
[ { "name": "开发部" }, { "name": "综合部" } ] //名称数组
...其他属性值或对象数组
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }
listSubUnit
Syntax:
var unitList = this.org.listSubUnit( unit , nested );
Arguments:
unit : (string JsonObject or array)必选。
可以是组织的distinguishedName、name、id、unique属性值,组织对象,或者是上述属性值和对象的数组。
> nested : (boolean)可选,true嵌套的所有组织;false直接组织;默认false
参数unit示例
//以下均为合法参数
//组织属性值
"开发部@kfb@U" //组织标识名
"cce8bc22-225a-4f85-8132-7374d546886e" //id
"kfb" //组织唯一标识
"开发部" //组织名称
//对象
{ "distinguishedName": "开发部@kfb@U" } //组织识别名
{ "unique": "cce8bc22-225a-4f85-8132-7374d546886e" } //组织唯一标识
{ "unique": "kfb" } //组织唯一标识
{ "name": "开发部" } //组织对象
//上述属性组和对象数组
[ "开发部", "综合部" ] //名称数组
[ { "name": "开发部" }, { "name": "综合部" } ] //名称数组
...其他属性值或对象数组
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }
listSupUnit
Syntax:
var unitList = this.org.listSupUnit( unit , nested );
Arguments:
unit : (string JsonObject or array)必选。
可以是组织的distinguishedName、name、id、unique属性值,组织对象,或者是上述属性值和对象的数组。
> nested : (boolean)可选,true嵌套的所有组织;false直接组织;默认false
参数unit示例
//以下均为合法参数 //组织属性值 "开发部@kfb@U" //组织标识名 "cce8bc22-225a-4f85-8132-7374d546886e" //id "kfb" //组织唯一标识 "开发部" //组织名称 //对象 { "distinguishedName": "开发部@kfb@U" } //组织识别名 { "unique": "cce8bc22-225a-4f85-8132-7374d546886e" } //组织唯一标识 { "unique": "kfb" } //组织唯一标识 { "name": "开发部" } //组织对象 //上述属性组和对象数组 [ "开发部", "综合部" ] //名称数组 [ { "name": "开发部" }, { "name": "综合部" } ] //名称数组 ...其他属性值或对象数组
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }
getUnitByIdentity
Syntax:
var unitList = this.org.getUnitByIdentity( identity, flag );
Arguments:
identity : (string or JsonObject)必选。
可以是身份的distinguishedName、name、id、unique属性值,身份对象,或者是上述属性值和对象的数组。
> flag : (number or string)可选。
当值为数字的时候, 表示获取第几层的组织。
当值为字符串的时候,表示获取指定类型的组织。
当值为空的时候,表示获取直接所在组织。
参数identity示例
//以下均为合法参数 //身份属性值 "李四@23dd1b53-feed-485d-8c9c-1a4e64ff58a2@I" //身份识别名 "23dd1b53-feed-485d-8c9c-1a4e64ff58a2" //id "lisi_i" //身份唯一标识 "李四" //名称 //对象 { "distinguishedName": "李四@23dd1b53-feed-485d-8c9c-1a4e64ff58a2@I" } //身份识别名 { "unique": "23dd1b53-feed-485d-8c9c-1a4e64ff58a2" } //身份唯一标识 { "unique": "lisi_i" } //身份唯一标识 { "name": "李四" } //名称对象
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }
listAllSupUnitWithIdentity
Syntax:
var unitList = this.org.listAllSupUnitWithIdentity( identity );
Arguments:
identity : (string JsonObject or array)必选。
可以是身份的distinguishedName、name、id、unique属性值,身份对象,或者是上述属性值和对象的数组。
参数identity示例
//以下均为合法参数
//身份属性值
"李四@23dd1b53-feed-485d-8c9c-1a4e64ff58a2@I" //身份识别名
"23dd1b53-feed-485d-8c9c-1a4e64ff58a2" //id
"lisi_i" //身份唯一标识
"李四" //名称
//对象
{ "distinguishedName": "李四@23dd1b53-feed-485d-8c9c-1a4e64ff58a2@I" } //身份识别名
{ "unique": "23dd1b53-feed-485d-8c9c-1a4e64ff58a2" } //身份唯一标识
{ "unique": "lisi_i" } //身份唯一标识
{ "name": "李四" } //名称对象
//上述属性组和对象数组
[ "张三", "李四" ] //名称数组
[ { "name": "李四" }, { "name": "张三" } ] //名称数组
...其他属性值或对象数组
Return:
unit array : (Array)群组对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{
"name": "开发部", //组织名称
"unique": "kfb", //组织唯一标识
"distinguishedName": "开发部@kfb@U", //组织识别名
"typeList": [ //组织类型
"部门"
],
"description": "", //组织描述
"shortName": "kfb", //组织简称
"level": 2, //组织层级
"levelName": "浙江兰德纵横/开发部", //层级名
"superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织
}
listUnitWithPerson
Syntax:
var unitList = this.org.listUnitWithPerson( person );
Arguments:
person : (string JsonObject or array)必选。
可以是人员的distinguishedName、name、id、unique属性值,人员对象,或者是上述属性值和对象的数组。
参数person示例
//以下均为合法参数
//人员属性值
"李四@lisi@P" //人员别名
"cce8bc22-225a-4f85-8132-7374d546886e" //id
"lisi" //人员唯一标识
"李四" //人员名称
//对象
{ "distinguishedName": "李四@lisi@P" } //人员识别名
{ "unique": "cce8bc22-225a-4f85-8132-7374d546886e" } //人员唯一标识
{ "unique": "lisi" } //人员唯一标识
{ "name": "李四" } //名称对象
//上述属性组和对象数组
[ "张三", "李四" ] //名称数组
[ { "name": "李四" }, { "name": "张三" } ] //名称数组
...其他属性值或对象数组
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{
"name": "开发部", //组织名称
"unique": "kfb", //组织唯一标识
"distinguishedName": "开发部@kfb@U", //组织识别名
"typeList": [ //组织类型
"部门"
],
"description": "", //组织描述
"shortName": "kfb", //组织简称
"level": 2, //组织层级
"levelName": "浙江兰德纵横/开发部", //层级名
"superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织
}
listAllSupUnitWithPerson
Syntax:
var unitList = this.org.listAllSupUunitnitWithPerson( person );
Arguments:
person : (string JsonObjector array)必选。
可以是人员的distinguishedName、name、id、unique属性值,人员对象,或者是上述属性值和对象的数组。
参数person示例
//以下均为合法参数
//人员属性值
"李四@lisi@P" //人员别名
"cce8bc22-225a-4f85-8132-7374d546886e" //id
"lisi" //人员唯一标识
"李四" //人员名称
//对象
{ "distinguishedName": "李四@lisi@P" } //人员识别名
{ "unique": "cce8bc22-225a-4f85-8132-7374d546886e" } //人员唯一标识
{ "unique": "lisi" } //人员唯一标识
{ "name": "李四" } //名称对象
//上述属性组和对象数组
[ "张三", "李四" ] //名称数组
[ { "name": "李四" }, { "name": "张三" } ] //名称数组
...其他属性值或对象数组
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }
listUnitWithAttribute
Syntax:
var unitList = this.org.listUnitWithAttribute( attributeName, attributeValue );
Arguments:
attributeName : (string )必选。组织属性名称。
> attributeValue : (string )必选。组织属性值。Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }
listUnitWithDuty
Syntax:
var unitList = this.org.listUnitWithDuty( dutyName, identity );
Arguments:
dutyName : (string)必选。组织职务名称。
> identity : (string or JsonObject)必选。
可以是身份的distinguishedName、name、id、unique属性值,身份对象。
参数identity示例
//以下均为合法参数
//身份属性值
"李四@23dd1b53-feed-485d-8c9c-1a4e64ff58a2@I" //身份识别名
"23dd1b53-feed-485d-8c9c-1a4e64ff58a2" //id
"lisi_i" //身份唯一标识
"李四" //名称
//对象
{ "distinguishedName": "李四@23dd1b53-feed-485d-8c9c-1a4e64ff58a2@I" } //身份识别名
{ "unique": "23dd1b53-feed-485d-8c9c-1a4e64ff58a2" } //身份唯一标识
{ "unique": "lisi_i" } //身份唯一标识
{ "name": "李四" } //名称对象
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }
listTopUnit
Syntax:
var unitList = this.org.listTopUnit();
Return:
unit array : (Array)组织对象数组。
unit对象为JSON格式数据,其格式和主要数据如下:
unit对象
{ "name": "开发部", //组织名称 "unique": "kfb", //组织唯一标识 "distinguishedName": "开发部@kfb@U", //组织识别名 "typeList": [ //组织类型 "部门" ], "description": "", //组织描述 "shortName": "kfb", //组织简称 "level": 2, //组织层级 "levelName": "浙江兰德纵横/开发部", //层级名 "superior": "浙江兰德纵横@a706f5f0-4a3b-4785-8e1d-0a944bfad4eb@U" //上级组织 }