Why is next traced for each instance? Why cant I get only set of output? I have attached rule sheet and rule flow... - Forum - Corticon - Progress Community

Why is next traced for each instance? Why cant I get only set of output? I have attached rule sheet and rule flow...

 Forum

Why is next traced for each instance? Why cant I get only set of output? I have attached rule sheet and rule flow...

This question is answered

If I make three instances I get 9 messages....

How can I make it to work once?

Verified Answer
  • You are iterating in rule 1 through the Books collection instead of the “sorted” collection. So by Books occurrence (3x), it will generate corresponding sorted messages (3x). Try to change it to sorted.pages in rule 1 and you’ll be all set.
     
    Best regards,
    Harold
     
All Replies
  • Please make sure you apply the sortedBy and next operators against a ROOT entity. It will not work correctly against a CHILD entity.
     
    Example:
     
     
     
     
    Best regards,
    Harold
     
  •   I am getting the same error when I try for single entity.

  • You are iterating in rule 1 through the Books collection instead of the “sorted” collection. So by Books occurrence (3x), it will generate corresponding sorted messages (3x). Try to change it to sorted.pages in rule 1 and you’ll be all set.
     
    Best regards,
    Harold