Hi Scott,<br><br>You could do the second rule many different ways. One that springs to mind is to assert a Transaction object at the start of a transaction and use that, ie.:<br><br>when<br><div style="margin-left: 40px;">
c: Customer (status == &quot;suspended&quot;)<br>Transaction(transactionType == TransactionType.NEW_ORDER, customer == c)<br></div>then<br><div style="margin-left: 40px;">...<br></div><br>Something along those lines - basically just think about what information you have at the instigation of the transaction that would allow you to determine the type of the transaction and the customer and assert them. If you are only asserting one customer into the WM then you could do away with needing a customer property on the Transaction object as you could assume it.
<br><br>cheers<br>Steve<br><br><div><span class="gmail_quote">On 2/23/07, <b class="gmail_sendername">Scott Finnie</b> &lt;<a href="mailto:scott.finnie@virgin.net">scott.finnie@virgin.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Doh!<br><br>rule 2 should of course read<br><br>&quot;A suspended customer may /not/ place any orders&quot;<br><br>Sorry.<br><br>Scott Finnie wrote:<br>&gt; Hi,<br>&gt;<br>&gt; Apologies if this has been covered somewhere, couldn&#39;t find it in the
<br>&gt; archives.<br>&gt;<br>&gt; I&#39;m wondering about ability / sensibility of above.&nbsp;&nbsp;For example, say I<br>&gt; want to model the following rules:<br>&gt;<br>&gt; 1. A customer must be suspended if they default on a payment
<br>&gt; 2. A suspended customer may place any orders<br>&gt;<br>&gt; Now the first one I can readily map to the when/then format of<br>&gt; production rules.&nbsp;&nbsp;But I can&#39;t see how to elegantly represent the second<br>
&gt; one - at least not in a transactionally clean manner.&nbsp;&nbsp;I could write:<br>&gt;<br>&gt; when<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; c: Customer (status == &quot;suspended&quot;)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; o: Order ( customer == c)<br>&gt; then<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; o.reject
() #etc.<br>&gt;<br>&gt; But that&#39;s not really what I want to achieve.&nbsp;&nbsp;Rather, I&#39;d like the<br>&gt; check enforced before the order was created, not after.<br>&gt;<br>&gt; Or maybe I&#39;m just thinking wrong?&nbsp;&nbsp;Main influence is RDBMS, where I&#39;d
<br>&gt; write a trigger that would stop the transaction completing if violated.<br>&gt;<br>&gt; Hope that makes sense, and thanks in advance.<br>&gt;<br>&gt;&nbsp;&nbsp;- Scoot.<br>&gt;<br>&gt; _______________________________________________
<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br>&gt;<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><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
<br><a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br><br>consulting | development | training | support
<br>our experience makes the difference