Announcement

Collapse
No announcement yet.

Transformer Failing

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

  • Transformer Failing

    Hi. I have a transformer set up so that when an ORU^RO1 message with OBX Observation Results segments filled with an RTF file come in, I write out the contained RTF file. All RTF parts map to the path "msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION']['OBX']['OBX.5']", so I index them as I would an array. Being that the path is an array, I use the .length property of the array to know how long the for loop should go. It ends up looking like this-

    ------------------------
    var RTF = "";
    var Array_Length = msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION']['OBX']['OBX.5'].length
    for (var i = 0; i < Array_Length; i++) {
    RTF = RTF + msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;ORU_R01.OBSERVATION&#039;][&#039;OBX&#039;][&#039;OBX.5&#039;][i].toString();
    }

    globalMap.put("RTF_File",RTF);
    ----------------------

    Which I see no fault in assuming I&#039;m allowed to program Javascript inside of a Transformer step. However, I get the following error message when deploying-

    WARN 2007-01-24 05:37:08,893 [Thread-0] com.webreach.mirth.server.Mirth: Error deploying channels.
    org.mule.config.ConfigurationException: Failed to parse configuration resource "/home/styree/Mirth-1.3/conf/mule-config.xml" (org.mule.config.ConfigurationException)
    at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:196)
    at com.webreach.mirth.server.Mirth.startMule(Mirth.ja va:164)
    at com.webreach.mirth.server.Mirth.restartMule(Mirth. java:147)
    at com.webreach.mirth.server.Mirth.run(Mirth.java:103 )
    Caused by: org.mule.config.ConfigurationException: Failed to parse configuration resource "/home/styree/Mirth-1.3/conf/mule-config.xml"
    at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:12 1)
    at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:202)
    at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:194)
    ... 3 more
    Caused by: org.mule.umo.lifecycle.InitialisationException: Initialisation Failure: missing ) after argument list (f665cd45-94e7-47d6-b66f-578cbea265c8#1)
    at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2919)
    at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2945)
    at org.apache.commons.digester.Digester.endElement(Di gester.java:1133)
    at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digeste r.java:1685)
    at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:11 9)
    ... 5 more

    I&#039;ve taken out the transformer step and it worked without problems. Is there something wrong with what I&#039;m doing? Do I need to put each line in its own Transformer Step? Am I allowed to declare variables in a Transformer Step? Do I need the globalMap.put command or do I just declare a variable RTF_File and it does it for me? I just don&#039;t know what I&#039;m allowed and not allowed to do.

  • #2
    Re: Transformer Failing

    - Be sure the transformer step you&#039;re using is &#039;JavaScript&#039; type, not Mapper/MessageBuilder

    - You can use the &#039;Validate Javascript&#039; button in the left, previous of publishing the channel.

    Comment


    • #3
      Re: Transformer Failing

      Thanks Alberto, hadn&#039;t realized that there was more than one type of transformer.

      Comment


      • #4
        Re: Transformer Failing

        How do you specify the transformer type ?

        When I select "Add Step" in the "Edit Transformer", I don&#039;t see any way of specifying it.

        Comment


        • #5
          Re: Transformer Failing

          When you do "Add Step", you see a row with "newVar0" under column "Name" and "Mapper" under column "Type". Double click under "Type" it should show a list box with "Mapper" and "JavaScript" dropdown. Select "JavaScript".

          Comment

          Working...
          X