简体   繁体   中英

retrieving array result in channel destination from source - mirth

I have this javascript in mirth connect and my source connector and basically grabs everything i want. I stored some of my results in an array and placed in in an array because its much.

var gist = [];
var list = new java.util.ArrayList();

    xmlMs = '<html>';
    xmlMs += '  <body>';
    xmlMs += '<table>';
     // content here
    xmlMs += '</table>';
    xmlMs += '  </body>';
    xmlMs += '</html>';
    list.add(xmlMs);


    gist.push([list, new_app]);

channelMap.put('try', gist);

What i tried to do is put the gist array in a channel map so as to be able to retrive it in the destination or destination/transformer. It complained of not recognizing the channelMap.put;

I had no problem to run your code. I had to define the variable new_app. In the message browser I got the channel variable with the value org.mozilla.javascript.NativeArray@186a7a9. If you use native java arrays, you can see the values displayed correctly. Concerning your problem: Check for syntax errors in your code, becasuse your put-statement is correct. You can upgrade to mirth connect 3.2, there is a javascript IDE implemented.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM