• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[NAB] Export and Import from external programs [>6.0.20210708.0]

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

  • [NAB] Export and Import from external programs [>6.0.20210708.0]

    Valence 6.X has support for manually exporting NAB apps from one instance, manually copying the save file to another instance, and then manually importing the app into another instance. For change management purposes, I would like to automate this process. I have been playing with the source code for programs vvExport and vvImport and it has required surprisingly few changes to the code to support this process at least as a proof of concept.

    I would like to request that support for calling vvExport and vvImport from a standard RPGLE or other program be added to these programs. This would allow us to call these programs from hooks in the existing change management process to export and import NAB apps at specific steps in the change managment process.

    vvExport alreadys works as-is to export a savefile as long as you have the proper app id and vvImport requires small modifications to support a current user id from an external program as well as replacing vvOut messages with some other message output format.

  • #2
    Sounds good...we will definitely look into making the changes to make both callable from the command line and/or another RPGLE program.

    Comment


    • #3
      Great! Thank you for at least looking into it and the quick reply.

      Comment


      • #4
        FYI, as of today's build (6.0.20210708.0), this functionality is available. You can now call VVEXPORT from a command line or inside a batch job to copy an app, widget or data source from one instance to another. The call structure is as follows:

        CALL PGM(VVEXPORT) PARM(type id errFlag errMsg destInstance mode)
        • type (20A): DATA_SOURCE or WIDGET or APP
        • id (15p 5): the ID of the data source / widget / app
        • errFlag (1A): will return a '1' if an error was encountered
        • errMsg (1024A): will return error message text if an error was encountered
        • destInstance (10A): the name of the instance you want to migrate to
        • iMode (1A): pass "B" for batch

        Ensure you have the 'from' Valence instance library at the top of your library list when making this call.

        Comment


        • #5
          Great! Thank you. I'll look into this as soon as we can get Valence updated on our system.

          Comment


          • #6
            This idea is great and good to see some movement on it!

            At first glance, this seems to be targeted for moving apps between instances on the same server. Have you come up with a procedure/process to use this for "promoting" apps from server to server?

            Being able to capture versions of the app in change control is a very good thing. We can automate that if not already available.

            Comment


            • #7
              Originally posted by opendave View Post
              This idea is great and good to see some movement on it!

              At first glance, this seems to be targeted for moving apps between instances on the same server. Have you come up with a procedure/process to use this for "promoting" apps from server to server?

              Being able to capture versions of the app in change control is a very good thing. We can automate that if not already available.
              I haven't yet no. We are working in conjunction with our change management vendor to deal with moving it through our change management process which would require moving it between servers at one point as well.

              Comment


              • #8
                If you're moving a NAB data source / widget / app from one partition or server to another, you will need two separate calls: One from the origination server to export the save file, then one from the destination server to import it. Between the calls you must of course transfer the save file from one server to the other.


                The calls for the migration would be as follows...


                Origination server:
                CALL PGM(VVEXPORT) PARM(type id errFlag errMsg)
                • type (20A): DATA_SOURCE or WIDGET or APP
                • id (15p 5): the ID of the data source / widget / app
                • errFlag (1A): will return a '1' if an error was encountered
                • errMsg (1024A): will return error message text if any error is encountered
                Be sure the appropriate Valence library containing the NAB object(s) is in your library list when making this call. A save file for the data source / widget / app will be placed into library VVEXPORT. The file name will be ten characters, consisting of a single letter denoting the object type ("D" for Data Source, "W" for Widget, "A" for App) followed by a nine digit number with leading zeros denoting the ID, i.e. A0000001001. You must then copy that save file to a library of your choice on your destination server.


                Destination server:
                CALL PGM(VVIMPORT) PARM(type savfName savfLib toLib mode errMsg)
                • type (20A): DATA_SOURCE or WIDGET or APP
                • savfName (10A): the name of the save file created by VVEXPORT
                • savfLib (10A): the library in which the save file is located
                • toLib (10A): the destination library (Valence instance name) for the NAB object(s)
                • mode (10A): 'BATCH_EXEC' to indicate you're executing the import in batch mode
                • errMsg (256A): will return error message text if any error is encountered
                Be sure the appropriate Valence library to which the NAB object(s) should be exported is in your library list when making this call. The program will unpack the save file for the NAB object(s) into QTEMP, then merge it into the appropriate files in the destination Valence instance.

                Comment

                Working...
                X