Announcement

Collapse
No announcement yet.

Error: Assignment to lists with more that one item

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

  • Error: Assignment to lists with more that one item

    I am getting the following error message and am stumped as to what it could mean:
    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    org.mozilla.javascript.EcmaError: TypeError: Assignment to lists with more that one item is not supported

    The channel is supposed to map an MDM message into more than one table. Complete error message is below, and I've attached the current incarnation of the channel.

    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    org.mozilla.javascript.EcmaError: TypeError: Assignment to lists with more that one item is not supported (9b1fea35-8229-4fa4-aef6-701508e3c3af#21)
    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.typeError(Scr iptRuntime.java:3232)
    at org.mozilla.javascript.xmlimpl.XMLList.putXMLPrope rty(XMLList.java:374)
    at org.mozilla.javascript.xmlimpl.XMLObjectImpl.ecmaP ut(XMLObjectImpl.java:233)
    at org.mozilla.javascript.ScriptRuntime.setObjectElem (ScriptRuntime.java:1397)
    at org.mozilla.javascript.ScriptRuntime.setObjectElem (ScriptRuntime.java:1389)
    at org.mozilla.javascript.gen.c52._c3(9b1fea35-8229-4fa4-aef6-701508e3c3af:21)
    at org.mozilla.javascript.gen.c52.call(9b1fea35-8229-4fa4-aef6-701508e3c3af)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c52._c0(9b1fea35-8229-4fa4-aef6-701508e3c3af:41)
    at org.mozilla.javascript.gen.c52.call(9b1fea35-8229-4fa4-aef6-701508e3c3af)
    at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:337)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:2755)
    at org.mozilla.javascript.gen.c52.call(9b1fea35-8229-4fa4-aef6-701508e3c3af)
    at org.mozilla.javascript.gen.c52.exec(9b1fea35-8229-4fa4-aef6-701508e3c3af)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:359)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:278)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:183)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:111)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Thread.java:595) MDM_to_usr_and_alg.xml (145592 bytes)

  • #2
    Re:Error: Assignment to lists with more that one item

    This means that you have multiple segments that you are trying to assign to one variable. You must iterate through these segments and put the values from each segment into each map, or reference them using an offset.

    Here's an example referencing with an offset if you have two IN1 segments:

    channelMap.put("primaryInsurance", msg['IN1'][0]['IN1.1'].toString());
    channelMap.put("secondaryInsurance", msg['IN1'][1]['IN1.1'].toString());

    Here's an example using a loop to get each segment:

    var i = 0;
    for(in1 in msg..IN1)
    {
    channelMap.put("insurance" + i, in1['IN1.1'].toString());
    i++;
    }
    Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

    Comment


    • #3
      Re:Error: Assignment to lists with more that one item

      Is there a way to accomplish either method within the Transformer edit screen?

      Comment

      Working...
      X