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.

How to collect information from parallel steps? #3840

Henry ·

Hi,

A
B C D
E

I have a sequential step which starts step A and after that is finished it starts B,C,D in parallel. Then a new sequential Step E starts.
B,C,D start on arbitrary nodes and I want to pass this node-address information to step E.

I tried to let B,C,D execute a script which adds the node address to a variable but I need some kind of isolation to avoid race conditions.

can I use a script like the following in B,C,D in parallel?

synchronized(this)
{
vars.get("Remember").setValue(vars.getValue("Remember") + "I am B, ");
}

to get the following (reliable) result in E:
by eexecuting logger.info(vars.getValue("Remember"))

"I am C, I am B, I am D,"

Or is there a better way to do that?
I would be be very happy, if you can help me.

thanx in advance
Henry

  • replies 4
  • views 633
  • stars 0
robinshen ADMIN ·

In step E, you may just call
steps.get("master>B").node.address

Henry ·

Thank you very much.

I tried that,too, but I showed you a very much simplified example here. In my environment the path to find the previsous steps is about 3 lines long with 8 parameters in it and such an access method is highly instable if those steps get modified by someone. Thats the reason why I asked you, if there is a way that every "relevant" parallel step can store something in a variable concurrently so that later steps can read this variable and have some kind of summation of the results of the relevant previous steps in it.

I'm not sure, if I was able to decribe the essential point in an apropriate way.

Is there a way to write concurrently to the same variable in parallel from parallel executing steps?

thanx in advance and have a nice day
Henry

robinshen ADMIN ·

I see. Unfortunately there is no approaches to modify same variable concurrently in different concurrent steps and get the merged result later.

Henry ·

Thank you, Robin.

That's bad luck. But now I know for sure that the "variable"-approach will never be successful.
I will solve it by refering to previous steps as you suggested.

greetings
Henry