当然会报错了,因为如果下面是结束环节,肯定不产生任务了,command 下根本不会产生FlowTasks,所以就会报错
用
var
I: Integer;
lUnits: TList;
begin
lUnits := TList.Create;
try
FlowBroker1.FlowControl.CurrentProcUnit.GetSuccedentUnits(lUnits,[TProcUnitKind.ukCondition],True);
for I := 0 to lUnits.Count - 1 do
begin
dialogs.ShowMessage(TProcUnit(lUnits[I]).ID + TProcUnit(lUnits[I]).DisplayName);
end;
finally
lUnits.Free;
end;
end;
找下一个条件环节的ID,根据条件环节的ID来做处理