Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Define "variables" for a sequential step #4317

benprim ·

Dear all,
Is there already something to kind of create scopes for variables ?
For instance what I would like to do is create a parallel step, this step will have multiple sequential step.
I would like to define some variables let's say Platform for example and have this "variable" (or something else) resolve to the correct variable for each sequential Step so something like

-Parallel Step:
-Sequential step (x64)
-Sequential step (x64_Server)

But when what I would like is for instance calling in both ${vars.getValue("PLATFORM")} and this would resolve to:
-"x64" in step "Sequential step (x64)"
-"x64_Server" in step "Sequential step (x64_Server)"

Thanks
Ben

  • replies 4
  • views 1259
  • stars 2
robinshen ADMIN ·

You may set variable value at start of each sequential step and other steps in the sequential will see different value for same variable.

benprim ·

Thanks Robin, I thought the value would stay for all the build.
What makes the scope of the variable ? parent step ? node ?

robinshen ADMIN ·

QB does not have variable scope concept. Instead each step inherits variables from its parent, and then merged back to parent step after the step finishes. So if the variable is changed in one child of sequential step, subsequent steps will see the change. However for parallel step, although child steps can get the same variable value at the start, the final merged value will be non-deterministic after these children finishes if more than one child step modified it.

benprim ·

Thanks Robin very valuable information !