对,还要用那个批处理流转。代码在最后作了些修改
procedure TBATCHLISTFORMDOC.fbMainBeforeFlowOut(Sender: TObject; Command: TFlowOutCommand);
var
lWarningMsg: string;
i : Integer;
lStrings : TStrings;
lTask : TTask;
lTasks : TList;
begin
if FMyFlowOut then
exit;
Command.Accept := False;
FFlowFinished := False;
FFlowArchived := False;
GetBizInfo.SaveBizData;
if (not GetCanFlowOut(lWarningMsg)) then
begin
jsDialogs.ShowWarning(lWarningMsg, '警告');
Command.Accept := False;
exit;
end
else if GetBizInfo.ProcUnitInfo.NeedProcess then
begin
GetBizInfo.AutoGenerateBatchProcessData;
GetBizInfo.SaveBizData;
end;
lStrings := TStringList.Create;
lTasks := TList.Create;
try
FMyFlowOut := True;
GetBizInfo.GetBatchSelectedTaskGUIDs(lStrings); 的guid
for i := 0 to lStrings.Count - 1 do
begin
lTasks.Clear;
lTask := Command.FlowControl.FindTaskByGUID(lStrings);
if lTask <> nil then
begin
dsbBizMain.DataSet.Locate('FFLOWID',Command.FlowControl.FindFlowByGUID(lTask.FlowGUID).ID,[]);
lTasks.Add(lTask);
Command.FlowControl.FlowOut(lTasks);
end;