Announcement

Collapse
No announcement yet.

how to use our own java Bean in tranformer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to use our own java Bean in tranformer

    hi to all, please friends help me,

    i am using mirth 1.4, my requirement is how use java Bean in mirth transformer

    i have created one patientInfo java bean and kept the package in a mirth/lib/custom folder
    and i have import that package in javaScript with
    importPackage(Packages.MyClass);
    //"MyClass" is my package name which has PatientInfo.class file
    var obj=new PatientInfo();

    return obj;
    //End of My Code//


    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    org.mozilla.javascript.EcmaError: ReferenceError: "PatientInfo" is not defined. (1a0a5c23-058d-4461-9398-9aeeafd45934#22)
    at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3226)
    at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3216)
    at org.mozilla.javascript.ScriptRuntime.notFoundError (ScriptRuntime.java:3289)
    at org.mozilla.javascript.ScriptRuntime.name(ScriptRu ntime.java:1567)
    at org.mozilla.javascript.gen.c41._c3(1a0a5c23-058d-4461-9398-9aeeafd45934:22)
    at org.mozilla.javascript.gen.c41.call(1a0a5c23-058d-4461-9398-9aeeafd45934)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c41._c0(1a0a5c23-058d-4461-9398-9aeeafd45934:26)

  • #2
    Re:how to use our own java Bean in tranformer

    Is your class in a jar file?
    Chris Lang

    Comment


    • #3
      thanks for your help i got it

      hi to all,

      i thank to Mirth Administrator, i got it! with your suggestion, my mistake is i did not put my java class in jar file, i did it now, my problem got solved.


      but i have one more requirement, ie i will create one java bean object by accessing fields from HL7 message, now i am able to do it with your help, but how can i send this object to my destination/ my destination will be JMS message writer.

      please contribute your help please, looking forward for your replay.

      regards,
      Noor.

      Comment


      • #4
        Re:thanks for your help i got it

        Mirth Administrators:

        I am having trouble calling an external java class. I have followed the guidelines that are in this post, however I am not having luck. I am using the latest mirth 1.7 release. Has the syntax for loading external classes changed?

        Thanks.

        Comment


        • #5
          Re:thanks for your help i got it

          I had a similar problem, but I had forgotten to include a JAR file my class depended on.

          However, Mirth logged absolutely nothing about the problem, the channel just hung on the statement where I tried to instantiate the class.

          Post edited by: trymirth, at: 06/02/2008 06:39

          Comment

          Working...
          X