that sounds correct.<br><br>No you can't really depend on things happening in a certain order. of course it will be consistent between executions for the same data, but you can't count on that. It would mostly be effected by the order in which you assert facts.
<br><br>I guess the question is why are you concerned in what order it does things?<br><br>Michael<br><br><div><span class="gmail_quote">On 2/13/07, <b class="gmail_sendername">Olenin, Vladimir (MOH)</b> <<a href="mailto:Vladimir.Olenin@moh.gov.on.ca">
Vladimir.Olenin@moh.gov.on.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I was trying to find more detailed explanation on how the fact tuples for
<br>activations are being selected based on the constraints, but couldn't find<br>much. So, I guess I just want to assert my understanding of this process is<br>correct.<br><br>Assuming I have the following set of 'Accounts' with the fields:
<br><br>ID | Province | City | Type | Balance<br>----------------------------------------------------------------<br> 1 | ON | Toronto | Checking | 1000<br> 2 | BC | Vancouver | Checking | 100
<br> 3 | ON | Toronto | Visa | 2000<br> 4 | ON | Toronto | Checking |-100<br> 5 | BC | Vancouver | Checking | 100<br> 6 | BC | Vancouver | Visa | 150
<br> 7 | AB | Calgary | Checking | 100<br> 7 | AB | Toronto | Checking | 300<br><br>I have two rules to process:<br><br>1) within each province, the sum of balances on Visa accounts should less
<br>then 10 times the sum of balances on Checking accounts (within the same<br>province)<br>2) within each province, the sum of balances on Checking accounts should be<br>a positive number<br>3) within each province and within each city, the number of visa accounts
<br>should be no more than 2 times the number of checking accounts<br><br>If I model my business objects like this:<br><br>1) Account (id, province, city, type, balance)<br>2) Province (province)<br>3) City (province, city)
<br><br><br>And WorkingMemory will be initialized (for the data above) with:<br> - 7 Account instances (ids 1 through 7)<br> - 3 Province instances (ON, AB, BC)<br> - 3 City instances (Toronto, Vancouver, Calgary)
<br><br><br>Then the rules containing 'within province' would read like:<br>-----------------<br>Rule '1'<br>When<br> Province($prov: province)<br> $a: Account(province == $prov)<br>Then<br> // accumulate sums on Checking and Visa accounts as Edson showed in
<br>previous emails<br>End<br>-----------------<br><br><br>The rule containing 'within province, within city' would have then:<br>-------------<br>Rule '3'<br>When<br> Province($prov: province)<br> City($city: city, province = $prov)
<br> $a: Account(province = $prov, city = $city)<br>Then<br> // accumulate sums on Checking and Visa accounts as Edson showed in<br>previous emails<br>-------------<br><br><br>Is this correct business object model to achieve the goal? Do I understand
<br>correctly that the LHS statement:<br><br><br> Province($prov: province)<br> City($city: city, province = $prov)<br> $a: Account(province = $prov, city = $city)<br><br><br>Can be read as:<br><br> For each province
<br> For each city within the province<br> For each account for the given city and province<br><br><br><br>What 'guides' the order in which fact tuples are selected from the set of
<br>all facts in the WorkingMemory? Can any particular sequence be guaranteed?<br><br>Thanks!<br><br>Vlad<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br>