Return Values of Transformations

In those components in which a transformations are defined, some return values can also be defined. They are integer numbers greater than, equal to or less than 0.

[Note]Note

Remember that DBExecute can also return integer values less than 0 in form of SQLExceptions.

[Important]Important
  1. Values greater than or equal to 0

    Remember that all return value that are greater than or equal to 0 allow to send the same data record to the specified output ports only in case of DataGenerator, Partition, Reformat, and Rollup. Do not forget to define the mapping for each such connected output port in DataGenerator, Reformat, and Rollup. In Partition (and clusterpartition), mapping is performed automatically. In the other components, this has no meaning. They have either unique output port or their output ports are strictly defined for explicit outputs. On the other hand, CloverDataReader and DBFDataReader always send each data record to all of the connected output ports.

  2. Values less than -1

    Remember that you do not call corresponding optional OnError() function of CTL template using these return values. To call any optional <required function>OnError(), you may use, for example, the following function:

    raiseError(string Arg)

    It throws an exception which is able to call such <required function>OnError(), e.g. transformOnError(), etc. Any other exception thrown by any <required function>() function calls corresponding <required function>OnError(), if this is defined.

  3. Values less than or equal to -2

    Remember that if any of the functions that return integer values, returns any value less than or equal to -2 (including STOP), the getMessage() function is called (if it is defined).

    Thus, to allow calling this function, you must add return statement(s) with values less than or equal to -2 to the functions that return integer. For example, if any of the functions like transform(), append(), or count(), etc. returns -2, getMessage() is called and the message is written to Console.

[Important]Important

You should also remember that if graph fails with an exception or with returning any negative value less then -1, no record will be written to the output file.

If you want that previously processed records are written to the output, you need to return SKIP (-1). This way, such records will be skipped, graph will not fail and at least some records will be written to the output.