<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Arial, sans-serif; "><div><div><div>I have a single rule that includes a "collect" pattern to pass a collection to the RHS. &nbsp;However, what I now need to do fire this rule for multiple collections based on groupings defined by attributes on the fact.</div><div><br></div><div>Here is an example:</div><div><br></div><div><div>Fact(a = 1, b = 1, c = 1)</div></div><div><div>Fact(a = 1, b = 1, c = 2)</div></div><div><div>Fact(a = 2, b = 1, c = 3)</div></div><div><div>Fact(a = 2, b = 2, c = 4)</div></div><div><div>Fact(a = 2, b = 2, c = 5)</div></div><div><br></div><div>I would like to create sub-groups based on the attributes 'a' and 'b'. &nbsp;My rule should fire three times for the facts listed above, providing the corresponding collection of Fact.</div><div><br></div><div>The only solution that I can think of is to build a HashSet and add each Fact to the HashSet using the attributes as keys. &nbsp;I suppose it would have to be a nested set since I can't define a multi-valued key class within a rule. &nbsp;I could then handle this HashSet in a RHS block. &nbsp;However, I realize that I'm completely subverting the whole rule language&#8230;</div><div><br></div><div>Any suggestions?</div><div><br></div><div>Thanks,</div><div><br></div><div>Mike</div></div></div></body></html>