Comments (4)
  • Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

1 SrikISL commented Permalink

if the issue is repeated 'definitions' blocks in multiple rules, then we can probably do the defintions in the very first rule of the ruleflow and save the result in the variable (defined in VariableSet) which can be used by the other rules in the flow. In that way, you are building up the array only once & using it everywhere it is required.

2 Daniel Selman commented Permalink

I agree, however this also suffers from the problem of knowing when the variable has been safely initialized. Rules that use the variable outside of the ruleflow risk NPE.

3 AugustoSandoval commented Permalink

I tried to set a variable that I already created, but its not possible. The example create usAddress variable and this is not a global context variable, that means this variable is usefull only for this specific rule. <br /> But anyway, that´s a good solution.

4 GregHadaller commented Permalink

I like the 'parameter navigation' style the best. But what is the advantage of explicitly managing the iteration in the rule? In other words, why not let the rule engine manage the iteration? I have in mind something closer to the 'working memory' example; something like: <div>&nbsp;</div> definitions <br /> set 'addressType' to an address type in the addresses of person <br /> where the country of this address type is "USA" ; <div>&nbsp;</div> then <br /> print "Found a US address!" ;