cancel
Showing results for 
Search instead for 
Did you mean: 

GP Loop Block

Former Member
0 Kudos

Hi all,

I have an alternate block which allows the user to choose one among the 4 alternatives. Each alternative has a Target action and each alternative gives 3 output parameters.

I have a Precondition loop block immediately after this Alternative Block which will redirect the user to the earlier alternate block upon choosing "Yes" (Looping). On choosing No it will continue the process.

In the next step I am showing the consolidated output values of the previous 2 blocks. So for that I have created 12 input parameters (4 options x 3 values) and consolidated them to the output of the Alternate Block as well as the Loop Block. So for each item 3 values are consolidated into one (output of Alternative Block, output of Loop Block and the input of the Display Block)

But when I run the process and execute the loop, I am getting only the last selected option values. To explain more

1st, I selected option1 and I got 3 outputs that of option 1

I chose to loop, this time I selected option 2 and I got outputs of option 2

Now when I see the Display page, I am getting only values of option 2. It seems like the values of option 1 is overwritten.

Any idea how this situation can be tackled?

Regards

Praveen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Praveen,

If I get you right, you want to accumulate results from your alternative blocks?

If that is the case then I believe you will have to maintain a collection-type input-and-output parameter.

Your consolidated parameters work like variables in e.g. a Java program. They get overwritten everytime.

Maybe you could implement some callable object that accumulates the values. This CO would have an input parameter for the last produced value, which you would consolidate with output of the Alternative Block. Internally it would add the value to a collection. The CO could put the collection into the process context as an output parameter that you can then use as input in the display action. The CO also could receive the collection as an input parameter (from previous loop iterations). I'm not sure though how/where initial creation of the collection would happen.

These are just thoughts. I have not tried this myself.

Please tell when and how you've solved your problem.

Good luck

Markus