bottom

Append While

The "Append While" generation rule is used to create CSV sequences of variying number of values. It relies on two child fields, one providing the values to append in a CSV record and another one to decide weither to stop or continue the same record.

WhileGen

The rule asks the "condition" child to decide if the value provided by the source belongs to the current sequence. If the condition says 'true' then the value is appended to the sequence. Otherwise, it means that the current sequence is over, the value is forgotten and the sequence is provided as-is.

Example

Take a source child providing random values such as "value1" "value2" ... "value6" - use for example a weighted list.

WhileGen-Source

Then build a condition child that checks if the value provided by the source is "value6". If so then the sequence is over, otherwise the value is appended to the sequence being built. 

/*
** This expression stops a sequence if the source reaches
** the "value6" item
*/
NOT(EQUAL(FIELD(..-source),"value6"))
 

With this configuration you will build sequences of varying length with values of the source, each time the source is providing "value6" then the sequence stops.

WhileGen-Result

Add comment


Security code
Refresh