我用下面的代码, 会出错,提示"组织节点不存在", 是不是组织单元的部门,岗位,人员都要有才行.
procedure TDZLC.ProcUnitBBMSHCreateFlowOutFlowTasks(Sender: TObject; Command: TFlowOutCommand);
var
lFlowTask:TFlowTask;
lOrgURL: TOrgURL;
begin
lFlowTask := Command.FlowTasks.FindFlowTask('DRBMSP');//根据任务环节查找任务
if lFlowTask <> nil then
begin
lFlowTask.Executors.Clear; //删除缺省执行者
lOrgURL := TOrgURL.Create('AskDepartment','','' ); //部门、岗位、人员创建组织单元
lFlowTask.Executors.Add(lOrgURL);//添加执行者
end;
end; |