Customer Portal

Pass variable as Reformat Port Output

Comments 3

  • Avatar
    admin
    0
    Comment actions Permalink
    Hi Paul,

    you can achieve this by simple Java transformation like:


    import com.opensys.cloveretl.ctl.CTLUtils;
    import static com.opensys.cloveretl.ctl.CTLUtils.DECIMAL_MAX_PRECISION;

    /**Top level class*/
    public final class CTL_REFORMAT_22052014_15_47_15_278_0 extends org.jetel.component.CTLRecordTransform {

    /**Code from CTL function globalScopeInit()*/
    public final void globalScopeInit() throws org.jetel.exception.ComponentNotReadyException {
    }

    /**Code from CTL function transform()*/
    protected final java.lang.Integer transformDelegate() throws org.jetel.exception.ComponentNotReadyException, org.jetel.exception.TransformException {
    for (int i=0;i<3;++i) {
    getOutputRecord(i).getField("field1").setValue(i);
    }

    return 2147483647;
    }
    }



    Sample graph attached.
  • Avatar
    paul.field
    0
    Comment actions Permalink
    This is great - thanks for the response.
    Is it possible to achieve this using CTL2? Or is this functionality only possible using Java? If the latter, would i be able to embed Java in my existing code (which is CTL2).

    Thanks,
    Paul
  • Avatar
    admin
    0
    Comment actions Permalink
    Hi Paul,

    Unfortunately this cannot be achieved by CTL2. You can either split your code into CTL2 and Java part and have 2 Reformats or convert your CTL2 code to Java. CTL2 can be converted into Java automatically - please see "Convert to Java" on http://doc.cloveretl.com/documentation/ ... ditor.html for details.

Please sign in to leave a comment.