Global Variables Configurator

Clovertech Forums Cloverleaf Global Variables Configurator

  • Creator
    Topic
  • #113917
    Tim Jipson
    Participant

      Inside of an xlt I can call ‘echo $$sampleGV’ and it resolves fine. In a tcl proc the same command throws the error ‘an’t read “sampleGV”: no such variable’.

      gvprint returns Global variable sampleGV = HelloWorld, encrypt = 0 but none of the other gv commands seem to be working.

      Is there another step I need to take in a tcl proc to load the globalVariables.ini file?

      • This topic was modified 5 years, 2 months ago by Tim Jipson.
    Viewing 7 reply threads
    • Author
      Replies
      • #113919
        Rob Abbott
        Keymaster

          Yes.  you need to use the gvgetvar command:

           

          set value [gvgetvar <variable-name>]

           

           

          Rob Abbott
          Cloverleaf Emeritus

        • #113936
          Tim Jipson
          Participant

            Thanks Rob!

          • #118411
            Jeff Dawson
            Participant

              Came across this same issue and was able to get this to work via tcl with the gvgetvar command, no mention of this in the CIS 6.2 Help document, is there any more information on this command?

               

              Jeff

            • #118414
              Jeff Dawson
              Participant

                I opened a ticket with Infor support and they were able to confirm the documentation for this command and CIS 19.1, since we are on CIS 6.2 it’s not listed in that versions help document.  Hoping to upgrade to ether 19 or 20 this year!

              • #118415
                Rob Abbott
                Keymaster

                  Hi Jeff, the gv* commands were properly documented in 19.1 and above.

                   

                  Here’s the documentation:

                  gvgetvar varname Gets the global variable value by name. varname: The global variable name. Returns the global variable value if success, or the error message if an error.

                   

                  gvsubstring stringvalue Substitutes the global variable by its value in the string. stringvalue: The string includes global variables.

                  Returns the string with global variable substituted.

                  gvsubfile inputfilename ?outputfilename? Substitutes the global variable by its value in the file. inputfilename: The absolute path of the file that includes global variables.

                  outputfilename: The absolute path of the file to save the result. If not given, the result is written to the input file.

                  Returns empty if success or the error message if an error.
                  gvaddvar varname varvalue ?isencrypted? Adds the variable name and value to the table in memory. varname: The global variable name.

                  varvalue: The global variable value.

                  isencrypted: If the global variable value needs be encrypted.

                  “1” is encrypted

                  “0” or others is not encrypted.

                  Default is 0.

                  Returns empty if success, or the error message if an error.
                  gvdelvar varname Deletes a global variable by name. varname: The global variable name. Returns empty if success or the error message if error.
                  gvsetvar varname varvalue ?isencrypted? Sets the global variable value in mermory. varname: The global variable name.

                  varvalue: The global variable value.

                  isencrypted: If the global variable value need be encrypted. 0 or others – not encrypted.

                  “1” is encrypted

                  “0” or others is not encrypted.

                  Default is 0.

                  Returns empty if success or the error message if an error.

                   

                  gvprint Prints out the global variable table in memory.
                  gvsave Saves the global variable table in memory to the global variable ini file. Returns empty if success, or an error message if an error.

                   

                  Rob Abbott
                  Cloverleaf Emeritus

                • #118440
                  Jeff Dawson
                  Participant

                    Great, Ty Rob!

                    Jeff

                  • #119513
                    Dirk Engels
                    Participant

                      Hi Rob,

                      is there also an equivalent in Java?

                    • #119517
                      Rob Abbott
                      Keymaster

                        Hi Dirk, yes, but it looks like the documentation for the Java API was missed, we’ll put that in the next patch.  Here’s a little detail from R&D:

                        There is a gvjni.jar under HCIROOT/lib/java. You can find the interface class after importing the jar to your classpath if you are writing your own project. GlobalVariableJni.loadConfig() should be called before using other APIs. The rest APIs all function as their names implied.

                        Rob Abbott
                        Cloverleaf Emeritus

                    Viewing 7 reply threads
                    • You must be logged in to reply to this topic.