|
楼主 |
发表于 2007-3-20 10:39:54
|
显示全部楼层
定义:
procedure TCGDDHQXX.UserStartFlow(AFlowUrl,ADept,ARole,APerson,AStartProc,AFlowID,ASubject,ADescription:string);
var
lBizURL: TBizURL;
lFlowValue: TFlowValue;
lFlowControl: TFlowControl;
lExecutor: TOrgURL;
begin
lBizURL := TBizURL.Create;
lFlowValue := TFlowValue.Create;
lFlowControl := TFlowControl.Create(Self.Context);
lExecutor := TOrgURL.Create(ADept, ARole, APerson);
lBizURL.URL := AFlowUrl;
try
lFlowValue.IDs.Add(AFlowID);
lFlowValue.Subject := ASubject;
lFlowValue.Description := ADescription;
lExecutor := TOrgURL.Create(ADept,ARole,APerson); //传入发起者的部门、岗位、人员
lFlowControl.StartupFlow(lBizURL, AStartProc, lExecutor, lFlowValue);
//lFlowControl.FlowRunnerByIndex[0].CurrentTask.TaskMessages[0].ReceiverID := BizUrlValue.ID; //传入接收者的人员ID
//lFlowControl.FlowRunnerbyIndex[0].CurrentTask.PreemptMode := TTaskPreemptMode.omFirstProcess;
//lFlowControl.FlowRunnerByIndex[0].CurrentTask.TaskMessages[0].ReceiverDeptID := GGHS.TGGHS.GetDeptName(BizUrlValue.ID);//传入接收者的部门ID
//lFlowControl.FlowRunnerByIndex[0].CurrentTask.TaskMessages[0].ReceiverPositionID := GGHS.TGGHS.GetPositionName(BizUrlValue.ID); //传入接收者的岗位ID
//lFlowControl.FlowRunnerByIndex[0].CurrentTask.TaskMessages[0].ReceiverID := BizUrlValue.ID; //传入接收者的人员ID
lFlowControl.FlowRunnerbyIndex[0].CurrentTask.SaveToDB;
finally
lFlowControl.Free;
lFlowValue.Free;
lBizURL.Free;
end;
end;
调用:
UserStartFlow('Biz:NBHLERPXTCGSPLC.PROC',lContextCurrent.Dept.ID,lContextCurrent.PositionMember.ID,lContextCurrent.PersonMember.ID,'BJCGDD',str,'采购审批流程','');
平台上点击待办任务时出现这样的问题
|
|