Build CSV Sequence from Multiple Sources

This rule produces CSV sequences of varying size and values where each value in a sequence can be produced by a different source. The content of a sequence is built from a list of counters and source field UIDs.

This rule is an extension of the CSV Sequence of Single Source with the ability to create sequences where values are generated by different sources.

One of the children of this rule provides the lists of pairs of UIDs and counters that describe how to build the each sequence from the child fields. A counter says how many time to repeat the source field it is associated to.

For example, if the list describing how to build the CSV sequence is "1,000:2,001:5,000" it means that the sequence will be made of 8 values (the sum of the counters 1 + 2 + 5). The first value in the sequence will be generated by the child with suffix 000, then the two next values will be generated by child with suffix 001 and finally the five last values will be generated again by the child with suffix 000.

Consider you want to produce a sequence of items in a shoping cart. You have designed 2 fields each generating items of a specific category, say for example a "Book" items generator and a "DVD" items generator.

Each time the book generator is asked for a value it produces a new book with its one price and other book related item data. And the second field does the same for a DVD item. For example, the book item generator can produce the following values:

Shine Shine Shine;Lydia Netzer;14.27
The Long Walk;Brian Castner;15.57

For producing a sequence of items in the same record, modeling a shoping cart, you will need to configure a field that produces sequences of pairs [Count,UID] that describes the content of the list in terms of how many items (eg. count) of a given item type to include in the sequence (eg. field pointed by UID). For example, when you need to produce a shoping cart with 2 books and 1 DVD the generated string will be "2,000;1,001", where 000 is the suffix of the field producing book items and 001 is the suffix of the field producing DVD.

Add comment

Security code