我现在是这样做的,是正常的,代码如下:
for I:=0 to command.FlowTasks.Count -1 do
begin
pu := command.FlowTasks[I].ProcUnit;
s:=SysUtils.UpperCase(pu.ID.Trim);
if (s = 'FGLDSP')or(s = 'CWSH')or(s = 'ZJLSP')or(s = 'FYBXZJLSP')then
command.FlowTasks[I].AllowExecutorInOrgURLs.Add(orgunit.ID,'','');
end;
for I:=0 to command.AllowFlowTasks.Count -1 do
begin
pu := command.AllowFlowTasks[I].ProcUnit;
s:=SysUtils.UpperCase(pu.ID.Trim);
if (s = 'FGLDSP')or(s = 'CWSH')or(s = 'ZJLSP')or(s = 'FYBXZJLSP')then
command.AllowFlowTasks[I].AllowExecutorRange:='OrgChildren(OrgKey('''+orgunit.ID+''','''',''''),'''',True,True)';
end; |