Creating empty data records in Pipeline Pilot

Sometimes while developing a protocol, there is a need for a number of empty data records that can be then populated with data properties. The easiest way to create more than one empty record is by using the Create Empty Data component. By default, the component can create a set number of data records (controlled by the NumberToGenerate parameter, which is set to 1 by default), but this requires the protocol developer to know how many records have to be created when developing the protocol and hard-code that value in the protocol.

Sometimes, however, the number of records to be created is dynamic, and here there are two situations: the number of records is calculated earlier in the protocol, in which case the NumberToGenerate parameter can be initialized from a global where that value was saved in the earlier pipelines.

However, possibly the most interesting situation is where the data creation needs to be stopped dynamically by components downstream from the Create Empty Data component. And that's where the parameters on the Implementation tab of the Create Empty Data component are very useful.

The Initialize Condition parameter is executed once and can be used to set some global properties. For instance:

@continue := true;

The expression in the Condition parameter is executed before each data record is generated. If the last statement in that PilotScript expression evaluates to true, then a new record is generated, if it evaluates to false, the component finalizes and stops outputting new records. The condition could be something as simple as:

@continue;

In order for the component to stop, a component further downstream from the Create Empty Data component needs to set the global @continue to false, otherwise the data creation will continue for ever (or until the protocol is manually stopped).

See the very simple protocol I attached for an example of how to dynamically stop the data record creation. And comment below if you have any tricks related to the Create Empty Data component.​​​​​​​