Announcement

Collapse
No announcement yet.

Variable scopes

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

  • Variable scopes

    I know this is a little on the old side, but I have a 1.3.2 installation that I'm upgrading to 1.7. Several channels use localmap.put() in JavaScript transformers, which isn't available in 1.7. (Replaced with ConnectorMap.put(), if I'm reading correctly?)

    Did some digging - the closest I found to a good description of the new variable scoping was MIRTH-274 in JIRA. Does a better description exist somewhere?

    Thanks, Mike

  • #2
    Re:Variable scopes

    Follow-up and additional question:

    In some brief testing, connectorMap.put() seems to do the same thing as the old localmap.put(), but I'm scratching my head on a related issue:

    I have a JS transformer step that identifies critical lab results and sets a variable if any are found:


    var hiloflag;
    var rval;

    rval = "";

    for each (obx in msg..OBX) {

    hiloflag = obx['OBX.8'];

    if (hiloflag != null) {
    if (hiloflag.toString().equals('CH')) {
    rval = "C";
    }

    if (hiloflag.toString().equals('CL')) {
    rval = "C";
    }
    }

    }

    connectorMap.put('criticalflag',rval);
    ...works in 1.3.2

    In testing with an Email Sender destination, I have the body as:

    New critical results available
    PID: ${PID}
    Accession: ${Accession}
    Critical flag: ${criticalflag}
    PID and Accession use similar connectorMap.put() calls, and they work, but the criticalflag variable is always null.

    What am I missing?

    Tnx, Mike

    Post edited by: mnowlin, at: 01/30/2008 00:22

    Comment

    Working...
    X