参考代码如下,在子流程入口环节的前一个环节做处理(就是主流程调用子流程的前一个环节)
至于怎么给执行者楼主自己做处理吧(思路:根据环节找任务)
procedure TMAINFORM.FlowBroker1CreateFlowOutFlowTasks(Sender: TObject; Command: TFlowOutCommand);
var
lSubFlowTask,lFlowTask: TFlowTask;
lOrgSytem: TOrgSystem;
begin
//在主流程中,控制子流程的入口的执行者
lFlowTask := Command.FlowTasks.FindFlowTask('Z_ZLC'); //主流程中的子流程环节名
lSubFlowTask := lFlowTask.Children.FindFlowTask('ZLCSH');//子流程中的入口环节名
lOrgSytem := TOrgSystem.Create;
try
lSubFlowTask.AllowExecutors.Clear;
if Assigned(lSubFlowTask) then
lOrgSytem.GetOrgURLsByOrgExpr('OrgKey('+'BM1'+','+'GW1'+','+ 'ry2'+')',lSubFlowTask.AllowExecutors);
finally
lOrgSytem.Free;
end;
end; |