Passing Global Variables from FTP Dir Parse to IB Data

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Passing Global Variables from FTP Dir Parse to IB Data

  • Creator
    Topic
  • #47649
    Skip Williams
    Participant

    Hi everyone,

    Boy, I am really stumped.  I have placed a proc in the FTP Dir Parse.  In that proc I declare a global variable called ibfilename.  I ftp files from a remote site and pickup the file names. putting each file name into a variable called “filename” and then returning it.  I reset the mh variable, mh [msgcreate $filename], do an lappend dispList “Continue $mh” and then, return $dispList.

    I have proc in the IB data that attempts to declare the same global variable and process the MSGID.

    I am echoing the variables and looking in the process log to see what the procs are doing.  The first proc seems to work, at least the echos seem to give me what they are suppose to.  But I get nothing from the proc in the IB Data.  When I echo the ibfilename global in this proc, nothing happens.

    Can someone tell me what I am doing wrong or at least point me in another direction.  I would be glad to share the procs or discuss this in any way?  Do I need to do something else to  declare the global variable and share its data?

    Thanks for any help you can give me.

    Skip Williams

    Peacehealth Interface Analyst

    541 686-3710

    skwilliams@peacehealth.org

Viewing 4 reply threads
  • Author
    Replies
    • #56356
      Robert Milfajt
      Participant

      Not sure how to solve your current problem of not seeing the global variable.  But I have a creative workaround for you to explore.

      You could use the USERDATA metadata field for the message itself.  Using msgmetaset within your  FTP Dir Parse, you can set the filename for the message, which will carry through to the IB Data TPS where you can retrieve it useing msgmetaget.

      Hope this works

      Bob 8)

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #56357
      Bill Bertera
      Participant

      I had that problem with using a global between IB TPS and the Xlate. I think you have the same issue here that globals don’t always carry over from one part of then engine to another. I think because new message id’s are created in different parts. I would suggest the same workaround as Robert.

    • #56358
      Charlie Bursell
      Participant

      You can share globals *ONLY* within the same Tcl interpreter.  Cloverleaf uses 3 separate interpreters;  IB Protocol, Xlate, and OB protocol

      Charlie

    • #56359
      Charlie Bursell
      Participant

      Won’t work Bob.  You don’t have access to meta data in a Directory Parse routine.  There is not a message at that point.  You are just telling the engine which files to process.

      A global list will work as long as you read the list in an IB proc so that both procs are in the same interpreter.  Just push the files onto a global list.  Then in the IB proc, as you read a message, pop off the file name.

      Now, if you need the file name in a later ineterpreter, put it in the USER meta data field.

      Charlie

    • #56360
      Skip Williams
      Participant

      Thanks to all of you who read and/or replied to my issue.  I found out that my proc was not working in the TPS Directory Parse because I was choosing the wrong message protocol style.  So the echos would end up in the process log, but the message was not sent to the IB Data.  My test data is a fax message and the only way the engine could interpret it as a message was to chose the “single” option instead of “nl”, “eof” or the others.  Again, thanks for all your input – a great educational experience.

      Skip Williams

      Peacehealth Interface Analyst

      541 686-3710

      skwilliams@peacehealth.org

Viewing 4 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,299
Replies
34,443
Topic Tags
288
Empty Topic Tags
10