代码启动流程lFlowControl.StartupFlow(lBizURL, AStartProc, lExecutor, lFlowValue);出错 不知错在哪了?
procedure TCXJM.Button1Click(Sender: TObject);
Var
AFlowUrl:string;
ADept:string;
ARole:string;
APerson:string;
AStartProc:string;
AFlowID:string;
ASubject:string;
ADescription:string;
begin
AFlowUrl :='Biz:\DMISXT\SQTB.FUNC';
ADept :='FJPT_SLDJZZ';
ARole := 'FJPT_ZDHZZ' ;
APerson := 'PT_DDS_CXY' ;
AStartProc :='Biz:\DMISXT\ECXTJGXMJHGLLC.PROC';
AFlowID:=DataSetBroker1.DataSet.FieldByName('Inst_Id').AsString;
ASubject:='申请填报:二次系统技改项目计划管理流程';
ADescription:='二次系统技改项目计划管理流程';
UserStartFlow(AFlowUrl,ADept,ARole,APerson,AStartProc,AFlowID,ASubject,ADescription);
end;
procedure TCXJM.UserStartFlow(AFlowUrl:string;ADept:string;ARole:string;APerson:string;AStartProc:string;AFlowID:string;ASubject:string;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); //流程ID
lFlowValue.Subject := ASubject; //流程主题
lFlowValue.Description := ADescription; //流程描述
//启动流程实例
lFlowControl.StartupFlow(lBizURL, AStartProc, lExecutor, lFlowValue);
//流程实例数据保存到数据库
lFlowControl.FlowRunnerbyIndex[0].CurrentTask.SaveToDB;
finally
lFlowControl.Free;
lFlowValue.Free;
lBizURL.Free;
end;
end; |