cancel
Showing results for 
Search instead for 
Did you mean: 

Reusing Variables in a search tree

Former Member
0 Kudos

Hi,

I am modeling some rules by using a search tree, and I am facing an issue to reuse variables for which a value was already determine in a different section of the tree (lets say a sub-node, I want to avoid the reprocessing of the Procedure call for performance reasons):

   Condition1

          Condition 2 -> Value Range which call a Procedure call to determine if the value of a parameter is equal to A, this is saved in variable X.

               Condition 3

                    Condition 4 - Result A

                    Condition 5 - Result B

               Condition 6 -> Compares the value of the parameter determined in condition 2, however variable X is empty, the value populated in condition 2 is lost

                    Condition 7 - Result C

          Condition 8 ->  Result D

What should I do to keep the value determined in condition 2 during the rest of the processing of the tree?

By the way, in the ruleset I didn't define any expression to Initialize the Variables, because the value of the variable shouldn't be determined before processing the search tree.

Many thanks for your help.

Mario.

Accepted Solutions (1)

Accepted Solutions (1)

christianlechne
Active Contributor
0 Kudos

Hi Mario,

to the best of my knowledge there is no way to store intermediate results during the processing of an expression. The same thing is e. g. valif when you delegate to expression within the columns of a decision table, so each time the cell or in your case the edge of a tree the expression is reprocessed.

Perhaps it might be an alternative as you mentioned to do the evaluation before firing the search tree via local variables in your rule set in order to optimize performance as this might really become in issue in your scenario.

BR

Christian

Former Member
0 Kudos

Thanks Christian, one more question, do you know what are the benefits of not allowing the storing of intermediate results?

christianlechne
Active Contributor
0 Kudos

as I did not build up the solution I can only make some educated guesses on that (usual problems with caching e. g.  when to refresh etc.). But again that is just an guess and not a statement of the vendor of that tool 🙂

BR

Christian

Answers (0)