<font size=2 face="sans-serif">is there a place to go look at a detailed
example?</font>
<br>
<br><font size=2 face="sans-serif">Thanks</font>
<br><font size=2 face="sans-serif">Ghanshyam</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Wolfgang Laun &lt;wolfgang.laun@gmail.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Rules Users List &lt;rules-users@lists.jboss.org&gt;,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">11/05/2012 05:19 AM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [rules-users]
DROOLs callback API for L-value predicate &nbsp; &nbsp; &nbsp; &nbsp;matching
events</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">rules-users-bounces@lists.jboss.org</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>&quot;Learning the reason for failure to match&quot;
is the title of a section in my<br>
boot camp you missed at this year's IntelliFest a couple of weeks ago.<br>
<br>
You are getting close to the solution, but here's the outline of the<br>
rule programming design pattern:<br>
<br>
Write one rule (high salience) to create an auxiliary fact (Aux),<br>
containing a reference to the fact under investigation (Crf) and a<br>
Set.<br>
<br>
Write one rule each, combining Aux and Crf, restricting the latter with
one<br>
of the required property values/range. On the RHS, add an<br>
identification to the set component of Aux. DO NOT MODIFY/UPDATE.<br>
<br>
Write another rule (low salience) combining Aux and Crf and see what<br>
Aux contains in the Set. Retract Aux.<br>
<br>
-W<br>
<br>
<br>
<br>
<br>
On 05/11/2012, Cotton, Ben &lt;Ben.Cotton@morganstanley.com&gt; wrote:<br>
&gt; Could a solution be as simple as this? &nbsp;Is this approach to consuming<br>
&gt; &quot;LCHUS_IRS_CURRENCY_RULE&quot; L-value matching events sound/complete
(and<br>
&gt; not-vulnerable to any race condition?). &nbsp;Is there any DROOLS
EventListener<br>
&gt; callback API that would be more appropriate to solve the problem?<br>
&gt;<br>
&gt; E.g. &nbsp;I want to be able to log when each of these 5 L-value predicates<br>
&gt; either &quot;MATCHES&quot; or &quot;FAILS TO MATCH&quot; (at the time
of the event)<br>
&gt;<br>
&gt; rule &quot;LCHUS_IRS_CURRENCY_RULE&quot; &nbsp;//XLS Item=195<br>
&gt; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;IRDCurrencyRuleFact(<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; productType == &quot;IRS&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currency==&quot;GBP&quot;,<br>
&gt; upfrontFeePaymentDate &lt; IRDCurrencyRuleFact.terminationDate,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maturity &lt;= 18275,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//unit
= days, i.e. 50 Years<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; notional &lt;= 99,999,999,999.99<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //max Notional<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;)<br>
&gt; &nbsp; &nbsp; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;LCHUS&quot;);<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt; Again the objective is to be able to join a high-resolution logging<br>
&gt; capability wrt to which of the specific 5 L-value predicates matched.<br>
&gt; Instinctively, to this DROOLs newbie, this approach seems workable
but not<br>
&gt; ideal ....<br>
&gt;<br>
&gt; rule &quot;LCHUS_IRS_CURRENCY_RULE_LVALUE_MATCHING_EVENT_1&quot;<br>
&gt; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;IRDCurrencyRuleFact(productType == &quot;IRS&quot;)<br>
&gt; &nbsp; &nbsp;then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;LCHUS_IRS_CURRENCY_RULE_L-value
event 1<br>
&gt; match&quot;); &nbsp;//log event &nbsp;L-value predicate 1 matched<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;LCHUS_IRS_CURRENCY_RULE_LVALUE_MATCHING_EVENT_2&quot;<br>
&gt; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;IRDCurrencyRuleFact(currency==&quot;GBP&quot;)<br>
&gt; &nbsp; &nbsp;then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;LCHUS_IRS_CURRENCY_RULE_L-value
event 2<br>
&gt; match&quot;); //log event &nbsp;L-value predicate 2 matched<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;LCHUS_IRS_CURRENCY_RULE_LVALUE_MATCHING_EVENT_3&quot;<br>
&gt; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IRDCurrencyRuleFact(upfrontFeePaymentDate
&lt;<br>
&gt; IRDCurrencyRuleFact.terminationDate)<br>
&gt; &nbsp; &nbsp; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;LCHUS_IRS_CURRENCY_RULE_L-value
event 3<br>
&gt; match&quot;); //log event &nbsp;L-value predicate 3 matched<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;LCHUS_IRS_CURRENCY_RULE_LVALUE_MATCHING_EVENT_4&quot;<br>
&gt; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IRDCurrencyRuleFact(maturity
&lt;= 18275)<br>
&gt; &nbsp; &nbsp; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;LCHUS_IRS_CURRENCY_RULE_L-value
event 4<br>
&gt; match&quot;); //log event &nbsp;L-value predicate 4 matched<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;LCHUS_IRS_CURRENCY_RULE_LVALUE_MATCHING_EVENT_5&quot;<br>
&gt; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IRDCurrencyRuleFact(notional
&lt;= 99,999,999,999.99)<br>
&gt; &nbsp; &nbsp; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;LCHUS_IRS_CURRENCY_RULE_L-value
event 5<br>
&gt; match&quot;); //log event &nbsp;L-value predicate 5 matched<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Ben D Cotton III<br>
&gt; Morgan Stanley &amp; Co.<br>
&gt; OTC Derivatives Clearing Technology<br>
&gt; 1221 AOTA Rockefeller Ctr - Flr 27<br>
&gt; New York, NY 10020<br>
&gt; (212)762.9094<br>
&gt; ben.cotton@ms.com&lt;</font></tt><a href=mailto:ben.cotton@ms.com><tt><font size=2>mailto:ben.cotton@ms.com</font></tt></a><tt><font size=2>&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; From: rules-users-bounces@lists.jboss.org<br>
&gt; [</font></tt><a href="mailto:rules-users-bounces@lists.jboss.org"><tt><font size=2>mailto:rules-users-bounces@lists.jboss.org</font></tt></a><tt><font size=2>]
On Behalf Of Cotton, Ben<br>
&gt; (ISGT)<br>
&gt; Sent: Saturday, November 03, 2012 8:24 AM<br>
&gt; To: rules-users@lists.jboss.org<br>
&gt; Cc: O'Brien, Patrick (ISGT)<br>
&gt; Subject: [rules-users] DROOLs callback API for L-value predicate matching<br>
&gt; events<br>
&gt;<br>
&gt; Hi, &nbsp;Can someone please point me to compelling examples/sample
code &nbsp;of how<br>
&gt; to use a DROOLs callback API for very high-resolution logging of L-value<br>
&gt; predicate matching events?<br>
&gt;<br>
&gt; E.g. &nbsp;I want to be able to log when each of these 5 L-value predicates<br>
&gt; either &quot;MATCHES&quot; or &quot;FAILS TO MATCH&quot; (at the time
of the event)<br>
&gt;<br>
&gt; rule &quot;LCHUS_IRS_CURRENCY_RULE&quot; &nbsp;//XLS Item=195<br>
&gt; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;IRDCurrencyRuleFact(<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; productType == &quot;IRS&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currency==&quot;GBP&quot;,<br>
&gt; upfrontFeePaymentDate &lt; IRDCurrencyRuleFact.terminationDate,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maturity &lt;= 18275,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//unit
= days, i.e. 50 Years<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; notional &lt;= 99,999,999,999.99<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //max Notional<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;)<br>
&gt; &nbsp; &nbsp; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;LCHUS&quot;);<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt; Ben D Cotton III<br>
&gt; Morgan Stanley &amp; Co.<br>
&gt; OTC Derivatives Clearing Technology<br>
&gt; 1221 AOTA Rockefeller Ctr - Flr 27<br>
&gt; New York, NY 10020<br>
&gt; (212)762.9094<br>
&gt; ben.cotton@ms.com&lt;</font></tt><a href=mailto:ben.cotton@ms.com><tt><font size=2>mailto:ben.cotton@ms.com</font></tt></a><tt><font size=2>&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ________________________________<br>
&gt;<br>
&gt; NOTICE: Morgan Stanley is not acting as a municipal advisor and the
opinions<br>
&gt; or views contained herein are not intended to be, and do not constitute,<br>
&gt; advice within the meaning of Section 975 of the Dodd-Frank Wall Street<br>
&gt; Reform and Consumer Protection Act. If you have received this communication<br>
&gt; in error, please destroy all electronic and paper copies and notify
the<br>
&gt; sender immediately. Mistransmission is not intended to waive confidentiality<br>
&gt; or privilege. Morgan Stanley reserves the right, to the extent permitted<br>
&gt; under applicable law, to monitor electronic communications. This message
is<br>
&gt; subject to terms available at the following link:<br>
&gt; </font></tt><a href=http://www.morganstanley.com/disclaimers><tt><font size=2>http://www.morganstanley.com/disclaimers</font></tt></a><tt><font size=2>
If you cannot access these links,<br>
&gt; please notify us by reply message and we will send the contents to
you. By<br>
&gt; messaging with Morgan Stanley you consent to the foregoing.<br>
&gt;<br>
&gt;<br>
&gt; ________________________________<br>
&gt;<br>
&gt; NOTICE: Morgan Stanley is not acting as a municipal advisor and the
opinions<br>
&gt; or views contained herein are not intended to be, and do not constitute,<br>
&gt; advice within the meaning of Section 975 of the Dodd-Frank Wall Street<br>
&gt; Reform and Consumer Protection Act. If you have received this communication<br>
&gt; in error, please destroy all electronic and paper copies and notify
the<br>
&gt; sender immediately. Mistransmission is not intended to waive confidentiality<br>
&gt; or privilege. Morgan Stanley reserves the right, to the extent permitted<br>
&gt; under applicable law, to monitor electronic communications. This message
is<br>
&gt; subject to terms available at the following link:<br>
&gt; </font></tt><a href=http://www.morganstanley.com/disclaimers><tt><font size=2>http://www.morganstanley.com/disclaimers</font></tt></a><tt><font size=2>
If you cannot access these links,<br>
&gt; please notify us by reply message and we will send the contents to
you. By<br>
&gt; messaging with Morgan Stanley you consent to the foregoing.<br>
&gt;<br>
_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
</font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-users"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-users</font></tt></a><tt><font size=2><br>
</font></tt>
<br>

-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you