Version

    Chapter 66. CTL Overview

    CTL is a proprietary scripting language oriented on data processing in transformation components of CloverDX.

    It is designed to allow simple and clear notation of how data is processed and yet provide sufficient means for its manipulation.

    Language syntax resembles Java with some constructs common in scripting languages. Although scripting language itself, CTL code organization into function resembles structure of Java classes with clearly defined methods designating code entry points.

    CTL is a high level language in both abstraction of processed data as well as its execution environment. The language shields programmer from the complexity of overall data transformation, while refocusing him to develop a single transformation step as a set of operations applicable onto all processed data records.

    Closely integrated with CloverDX environment, the language also benefits the programmer with uniform access to elements of data transformation located outside the executing component, operations with values of types permissible for record fields, and a rich set of validation and manipulation functions.

    During transformation execution, each component running CTL code uses separate interpreter instance; thus preventing possible collisions in the heavily parallel multi-threaded execution environment of CloverDX.

    Example 66.1. Example of CTL2 code

    //#CTL2
    
    function integer transform() {
        if ( $in.0.hasDetail ) {
            $out.0.name = $in.0.name;
            $out.0.email = $in.0.email;
    
            return 0;
        }
    
        $out.1.name = $in.0.name;
    
        return 1;
    }