procedure TMainForm.Button1Click(Sender: TObject);
var
lTasks: TList;
I: integer;
begin
lTasks := TList.Create;
try
FlowBroker1.FlowControl.Flow.GetLeadingTasks(FlowBroker1.FlowControl.CurrentTask, lTasks, True);
for I := 0 to lTasks.Count - 1 do
memo1.Lines.Add((lTasks.items[I] as TTask).ProcUnitID);
///在MEMO中显示当前任务之前的任务列表,lTasks.items[0]表示当前任务之前的任务,依此类推lTasks.items[lTasks.Count - 1]为最开始的任务。
finally
lTasks.free;
end;
end;