如下面的例子中,当前数据集DataSet中有几条记录都可以放到这一个流程实例中
procedure TMAINFORM.FlowBroker1BeforeFlowStartup(Sender: TObject; Command: TFlowStartupCommand);
begin
Command.FlowValue.IDs.Clear;
DataSetBroker1.DataSet.First;
while not DataSetBroker1.DataSet.Eof do
begin
Command.FlowValue.IDs.Add(DataSetBroker1.DataSet.FieldByName('PRODUCTID').AsString);
DataSetBroker1.DataSet.Next;
end;
end;
在入口环节的功能窗体上放一个Button,在OnClick事件中做流转
procedure TMAINFORM.Button1Click(Sender: TObject);
begin
DataSetBroker1.DataSet.First;
while not DataSetBroker1.DataSet.Eof do
begin
FlowBroker1.FlowControl.FlowOut(nil);
DataSetBroker1.DataSet.Next;
end;
end;