1. REFORMAT reads a record from the in port.
2. If the select parameter has an expression specified, REFORMAT uses the expression to evaluate the input record:
-> If the expression evaluates to false (0), REFORMAT discards the input record and starts over with step
-> If the expression produces NULL, REFORMAT writes a descriptive error message and stops the execution of the graph.
-> If the expression evaluates to true (anything other than 0 or NULL), REFORMAT begins processing the input record.
3) If the select parameter does not have a value, REFORMAT begins processing the input record.
4) REFORMAT determines whether a transform function is specified in either the output-index or output-indexes parameter:
-> If neither output-index nor output-indexes have a value (the usual case when there is only one out port), REFORMAT sends the input record to every transform-out port pair, beginning with out0 and progressing sequentially.
-> If output-index or output-indexes has a value, REFORMAT evaluates the specified index transform. If output-indexes are defined, it should return a vector of port index values. If output-index is defined, it should return a single port index value.
REFORMAT uses one or more values from the index transform to determine the appropriate transform-output port pair or pairs for the input record. If the index transform returns more than one value, REFORMAT sends the record to each of the appropriate ports, starting with the lowest numbered port and progressing to the other ports sequentially.
If the index transform returns an error, REFORMAT rejects the input record to the reject0 port (where it is indistinguishable from records rejected by transform 0).
5) REFORMAT determines whether each out port has a transform function.
-> If an out port does not have a transform function, REFORMAT uses implicit reformat to process the input record.
-> If the input record is sent to more than one port, the order of the transform evaluation is sequential: it calls the transform function on each port in order, starting with the lowest numbered port. For example, if the record is to be sent to port0 and port2, it is sent to port0 first, and then to port2. The evaluation of the second transform can depend on the side-effects of the first transform, which means you could make successive calls to a function like next_in_sequence from sequential transforms for the same input record.
6) If a transform function results in an error or returns NULL, REFORMAT writes the following:
An error message to the corresponding error port
The current input record to the corresponding reject port
The component stops execution of the graph when the number of reject events exceeds the reject threshold
If the reject or error ports do not have flows attached to them, REFORMAT discards the record.
7) REFORMAT writes the record to the out port of each successful transform, and then begins processing the next input record.
No comments:
Post a Comment