Customer Portal

reformat component issue in java

Comments 8

  • Avatar
    jurban
    0
    Comment actions Permalink
    Hi,

    your issue can be broken down into 2 parts:

    1) I believe you're extending the CTLRecordTransform class as the base for your transformation. That class is internally used by our CTL to Java compiler, it's not intended to be used elsewhere. You should extend the DataRecordTransform class and implement the transform() method - this will be your "main".

    2) The specific cause of the error you're seeing is that the sign() method throws SignatureException, and you don't catch the exception at the location where you're calling the method (I'm guessing that your original main had a "throws Exception" clause). You should catch the SignatureException and either re-throw it by wrapping it in a TransformException, or handle the error in some other way (e.g. send some record to a different output port for error logging).

    Combining the 2 hints above should help - extend DataRecordTransform and catch the SignatureException.

    Best regards,
    Jaro
  • Avatar
    poctavian
    0
    Comment actions Permalink
    Hi Jaro,

    Thanks for the response. I'm new to all this and I really appreciate your help.

    I did the changes you asked me to do and I still have a few more questions about how to make my code work in the reformat component since I'm still getting some errors that I can't figure out.

    First, I used to have public final class CTL_REFORMAT0_01052012_09_15_57_0 extends org.jetel.component.CTLRecordTransform {} then I changed it to public final class CTL_REFORMAT0_01052012_09_15_57_0 extends org.jetel.component.DataRecordTransform {}
    but I'm getting an error that says "CTL_REFORMAT0_01052012_09_15_57_0 is not abstract and does not override abstract method transform(org.jetel.data.DataRecord[],org.jetel.data.DataRecord[]) in org.jetel.component.DataRecordTransform". So I changed it to public abstract class CTL_REFORMAT0_01052012_09_15_57_0 extends org.jetel.component.DataRecordTransform {}, I'm not even sure if I should be doing that. Also, you mentioned that I should implement the transform() method and that would act as my main method. Does that mean that I should change protected final int transformDelegate() throws org.jetel.exception.ComponentNotReadyException, org.jetel.exception.TransformException to public void transform() throws org.jetel.exception.ComponentNotReadyException, org.jetel.exception.TransformException? One more thing, should my class be something like "public final class CTL_REFORMAT0_01052012_09_15_57_0 extends org.jetel.component.DataRecordTransform implements transform{}"?

    I don't know if it'll help but I can send you a copy of the java file that I'm trying to implement in the reformat component.

    Thanks.
  • Avatar
    poctavian
    0
    Comment actions Permalink
    Hi,

    Attached is the copy of the java codes that I'm trying to implement in the reformat component.

    Thanks.
  • Avatar
    poctavian
    0
    Comment actions Permalink
    Hi Jaro,

    I went through your instructions again and I got it working. Thanks.
  • Avatar
    rafaelwinston23
    0
    Comment actions Permalink
    thanks for sharing....
  • Avatar
    rovarellasbt
    0
    Comment actions Permalink
    Hello, I had a similar problem but I can't find any information regarding which Clover classes should be used and not.

    Where I can find this information (internal classes vs API classes)?

    Thank you for your attention

    Hi,

    your issue can be broken down into 2 parts:

    1) I believe you're extending the CTLRecordTransform class as the base for your transformation. That class is internally used by our CTL to Java compiler, it's not intended to be used elsewhere. You should extend the DataRecordTransform class and implement the transform() method - this will be your "main".

    2) The specific cause of the error you're seeing is that the sign() method throws SignatureException, and you don't catch the exception at the location where you're calling the method (I'm guessing that your original main had a "throws Exception" clause). You should catch the SignatureException and either re-throw it by wrapping it in a TransformException, or handle the error in some other way (e.g. send some record to a different output port for error logging).

    Combining the 2 hints above should help - extend DataRecordTransform and catch the SignatureException.

    Best regards,
    Jaro

    "jurban"
  • Avatar
    imriskal
    0
    Comment actions Permalink
    The most frequently used classes available are described in CustomJavaComponent documentation.
  • Avatar
    rovarellasbt
    0
    Comment actions Permalink
    Thank your your support!

Please sign in to leave a comment.