Announcement

Collapse
No announcement yet.

channlId in deploy script

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

  • #16
    You're putting them in the globalMap, not the globalChannelMap. The code I supplied you with pulls the globalChannelMap.

    Comment


    • #17
      If I use logger.info(otherChannelglobalChannelMap(myChannel Id));

      I see the below error. Am I doing anything wrong?

      [2014-06-03 20:51:55,344] ERROR (com.mirth.connect.connectors.js.JavaScriptReceive r:90): Error executing JavaScript Reader script bb1d22d0-2ce0-4407-be80-adba098ec757.
      com.mirth.connect.server.util.javascript.JavaScrip tExecutorException: com.mirth.connect.server.MirthJavascriptTransforme rException: CHANNEL:
      IDLE CHANNEL ALERTCONNECTOR:
      SourceSOURCE CODE:
      LINE NUMBER:
      6528DETAILS:
      TypeError: [email protected] is not a function, it is object.
      at bb1d22d0-2ce0-4407-be80-adba098ec757:6528 (doScript)
      at bb1d22d0-2ce0-4407-be80-adba098ec757:6581
      at com.mirth.connect.server.util.javascript.JavaScrip tUtil.execute(JavaScriptUtil.java:62)
      at com.mirth.connect.connectors.js.JavaScriptReceiver .poll(JavaScriptReceiver.java:88)
      at com.mirth.connect.donkey.server.channel.PollConnec tor$PollConnectorTask.run(PollConnector.java:125)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)Caused by: com.mirth.connect.server.MirthJavascriptTransforme rException: CHANNEL:
      IDLE CHANNEL ALERTCONNECTOR:
      SourceSOURCE CODE:
      LINE NUMBER:
      6528DETAILS:
      TypeError: [email protected] is not a function, it is object.
      at bb1d22d0-2ce0-4407-be80-adba098ec757:6528 (doScript)
      at bb1d22d0-2ce0-4407-be80-adba098ec757:6581
      at com.mirth.connect.server.util.javascript.JavaScrip tUtil.executeScript(JavaScriptUtil.java:490)
      at com.mirth.connect.connectors.js.JavaScriptReceiver $JavaScriptReceiverTask.call(JavaScriptReceiver.ja va:113)
      at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

      Comment


      • #18
        Got it! Hmm my bad. Any ways of getting globalMaps just curious

        Comment


        • #19
          Yes, just use globalMap.get...
          globalMap is global over all channels.

          Comment


          • #20
            Yeah I knew that I have to do a strange thing. I am reading id,name from database, if the id from DB matches deployed channel Id's I have to use the globalMap of that Channel. The reason why I am doing this process because each channel has its own globalMap values and my code monitors all the channels. So if the id from the DB matches channelID I have to use the map values. I am having hard time doing this.

            Comment


            • #21
              It seems to me like you are confusing globalMap and globalChannelMap because you say you want the globalMap for the channel.
              Simon

              Comment


              • #22
                Ok below is my code that I would like to use for all the channels:

                First time it reads an ADT channelid..
                Second time it reads a Lab channel id where Femalevalue - globalMap.get('Female1');
                Similary for third channel the female value is different

                var myChannelId = result.getString("ID").trim().toString();
                var otherChannelglobalChannelMap = com.mirth.connect.server.util.GlobalChannelVariabl eStoreFactory.getInstance().get(myChannelId).getVa riables();
                //if channelId from db matches channelId deployed.
                if(myChannelId){
                FemaleValue= globalMap.get('Female');


                }
                else{
                some default value;
                }

                Let me know if I have confused you

                Comment


                • #23
                  I have come up with a solution where once I get the globalChannelMaps I will split the , ( comma) seperated value and I can use that.

                  Comment


                  • #24
                    I think I am still confused about what you are trying to achieve, but if you have found a solution, that's great.

                    Comment

                    Working...
                    X