Release Automation

  • 1.  Setting up Dynamic Environment Variable & using them in a flow

    Posted May 24, 2017 10:58 AM

    I am trying to setup Environment Variable for a flow using 'export' command. To do this I am using the 'Run Command Line' option.

    Subsequently I am trying to use the 'Get Environment Variable Value' action and it fails stating that no such variable exist.

     

    When we have a group of actions assigned to a flow and if the first action sets up an environment variable. Would the same value be propagated to the  next set of actions ? i.e. Will all the actions under a flow be running under a single session id or would it be treated as different sessions.

    Is there a way to setup session level environment variable within a flow and use its value until the flow gets completed?

     

    I am running on version i.e.  5.0.2.231



  • 2.  Re: Setting up Dynamic Environment Variable & using them in a flow
    Best Answer

    Posted May 26, 2017 01:24 AM

    hi,

     

    from my understanding each action runs in its own session, so for example, if you run two command line actions after another, both would have their own session and so their own set of session parameters.

     

    I don't know though how the "update environment variable" action works in CA-RA, not sure if it only does a session update or a "global" one (although a session one wouldn't really make sense). But I do know that running a command line with "setx" and the "/M" flag works, as I already did that.

     

    an alternative would be, if we're strictly talking about the "run command line" action, that you define the session parameter in the inputs of the action (Environment Variable Names and Values)

     

    hope this helps.

     

    best regards

    Michael



  • 3.  Re: Setting up Dynamic Environment Variable & using them in a flow

    Posted May 30, 2017 05:30 AM

    Hi Michael,

    Thanks for your reply. I expected each of the commands to have its own session but wanted to know if there were any options or actions available to achieve this or was curious to know if a flow (with sequence of actions)can share a same session ID.

    I considered using the SETX or other options but again I didn't want to have anything set permanent and wanted to have those variables at session level. We are currently doing a migration where in there is a need to deploy changes to both old and new environment running on the same server. The old and new environment requires it own session variables.

     

    I settled with using the "run command line" and wrote a small script which would first setup the temporary environment variable before running the actual command. This gives me all the flexibility required but on the counter part I wrote up to 10 different combinations of scripts to do what I need to achieve.



  • 4.  Re: Setting up Dynamic Environment Variable & using them in a flow

    Posted May 30, 2017 05:52 AM

    you could set up the variable with setx at the start of the flow and remove it at the end?

     

    other then that, I'm also not seeing another option than writing a new script, what you ended up doing



  • 5.  Re: Setting up Dynamic Environment Variable & using them in a flow

    Broadcom Employee
    Posted Jun 01, 2017 07:57 AM

    Hi ,

     

    Indeed this works like Michael mentioned each command action will run in his own sessions .

    I marked the answer from Michael as the correct one .

    If you have any other questions please let me know .

     

    Regards

    Dirk