<HTML xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<HEAD><!-- Template generated by Exclaimer Template Editor on 11:47:13 Thursday, 29 November 2012 -->
<STYLE type=text/css>P.cd987f72-e700-448b-b4e1-7fb38b81e891 {
        MARGIN: 0cm 0cm 0pt
}
LI.cd987f72-e700-448b-b4e1-7fb38b81e891 {
        MARGIN: 0cm 0cm 0pt
}
DIV.cd987f72-e700-448b-b4e1-7fb38b81e891 {
        MARGIN: 0cm 0cm 0pt
}
TABLE.cd987f72-e700-448b-b4e1-7fb38b81e891Table {
        MARGIN: 0cm 0cm 0pt
}
DIV.Section1 {
        page: Section1
}
</STYLE>

<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta name="Generator" content="Microsoft Word 12 (filtered medium)" />
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</HEAD>

<BODY lang="EN-US" link="blue" vlink="purple">
<P>
<div class="WordSection1">
<p class="MsoNormal"><span style=font-size:12.0pt>Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>I have finally gained a tiny bit of control (and maybe even some competency) in using the DROOLs language operators &#8216;no-loop&#8217; and &#8216;lock-on-active&#8217; as a basis for controlling rule set firing behavior in response
 to Fact mutation events (during consequence processing).<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>I now want to (competently!) use DROOLs language tactics that give me ever finer grained control over managing rule set firing behavior on Fact mutation events.&nbsp; Specifically, I want to be able to implement
 some form of &#8216;Guarded entry/block&#8217; controls.&nbsp; <o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>E.g. let&#8217;s say I have a Fact &nbsp;(InsertedFactPOJO) that I insert into the KS and want to have its &#8216;fireAllRules()&#8217; &nbsp;AgendaSet(s) renedered in exact incremental ordinal stages and in perfect isolation.&nbsp; To do
 this, I am testing the inclusion of a &#8216;countdownLatch&#8217; Semaphore reference as a Fact member (initialized to N=`total rule count` value).&nbsp; I then use this to &#8216;Guard&#8217; individual rule entry, by generating an explicit predicate participant
<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>(</span><span style="font-family:&quot;Courier New&quot;;color:black">InsertedFactPOJO(countdownLatch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; == i)
</span><span style=font-size:12.0pt>) <o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>@ each ith Rule producedby my template.<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>Is this approach a valid/sound/complete way to implement &#8216;Guarded entry/block&#8217; controls in DROOLs?&nbsp; Is there a better way?<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>As always, my sincerest gratitude to this community for its generosity (and its genius).<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt>Ben<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">package</span></b><span style="font-family:&quot;Courier New&quot;;color:black"> com.ms.fast.triclear.eligibility.rules.drools_community.questions.posted;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">import</span></b><span style="font-family:&quot;Courier New&quot;;color:black"> com.ms.fast.triclear.eligibility.InsertedFactPOJO;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:olive">//fact:(backed by Class 'InsertedFactPOJO'&nbsp; has
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:olive">//- 'countdownLatch' (Semaphore) member
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:olive">//- 'aList' (List)member<o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span style="font-family:&quot;Courier New&quot;;color:black">
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;RULE_ALL_RULES_HAVE_FIRED_ONCE_ORDINALLY&quot;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp; fact:InsertedFactPOJO()</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp; InsertedFactPOJO(countdownLatch == 0)</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp; System.out.format(</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;\tALL RULES have fired *EXACTLY* once, *EXACTLY* ordinally. &quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot; fact.countdownLatch=%d \n\t fact.aList=%s\n\n&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">,</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fact.countdownLatch,
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fact.aList.toString());</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">end</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span style="font-family:&quot;Courier New&quot;;color:black">
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;RULE_3&quot;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;
</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;fact:InsertedFactPOJO()</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InsertedFactPOJO(countdownLatch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; == 3)</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:olive">//bunch of other L-Value PREDICATES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.format(</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;\t %20.20s&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot; \t(DROOLS agenda: consequence fired for L-value predicate match @RULE=&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;3&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot; -- fact.countDownLatch=%d)\n&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">,
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;Rule 3&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">,fact.countdownLatch);</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">modify</span></b><span style="font-family:&quot;Courier New&quot;;color:black"> (fact) {</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; countdownLatch = fact.countdownLatch - 1,</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aList.add(</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;Rule 3 pattern-match event added to POJO 'aList' field&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">end</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span style="font-family:&quot;Courier New&quot;;color:black">
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;RULE_2&quot;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;
</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fact:InsertedFactPOJO()</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InsertedFactPOJO(countdownLatch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; == 2)</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:olive">//bunch of other L-Value PREDICATES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.format(</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;\t %20.20s&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot; \t(DROOLS agenda: consequence fired for L-value predicate match @RULE=&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;2&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot; -- fact.countDownLatch=%d)\n&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">,
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;Rule 2&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">,fact.countdownLatch);</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">modify</span></b><span style="font-family:&quot;Courier New&quot;;color:black"> (fact) {</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; countdownLatch = fact.countdownLatch - 1,</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aList.add(</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;Rule 2 pattern-match event added to POJO 'aList' field&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">end</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span style="font-family:&quot;Courier New&quot;;color:black">
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;RULE_1&quot;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;
</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fact:InsertedFactPOJO()</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InsertedFactPOJO(countdownLatch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;== 1)</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:olive">//bunch of other L-Value PREDICATES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.format(</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;\t %20.20s&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot; \t(DROOLS agenda: consequence fired for L-value predicate match @RULE=&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;1&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">&#43;</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot; -- fact.countDownLatch=%d)\n&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">,
</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;Rule 1&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">,fact.countdownLatch);</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b><span style="font-family:&quot;Courier New&quot;;color:#960000">modify</span></b><span style="font-family:&quot;Courier New&quot;;color:black"> (fact) {</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; countdownLatch = fact.countdownLatch - 1,</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aList.add(</span><span style="font-family:&quot;Courier New&quot;;color:green">&quot;Rule 1 pattern-match event added to POJO 'aList' field&quot;</span><span style="font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><span style="font-family:&quot;Courier New&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal" style=text-autospace:none><b><span style="font-family:&quot;Courier New&quot;;color:#960000">end</span></b><span style="font-family:&quot;Courier New&quot;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style=font-size:12.0pt><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span style=font-size:12.0pt;color:gray><o:p>&nbsp;</o:p></span></b></p>
<p class="MsoNormal"><b><span style=color:gray>Ben D Cotton III</span></b><span style=font-size:9.0pt;color:gray><br />
Morgan Stanley &amp; Co.<br />
OTC Derivatives Clearing Technology <br />
1221 AOTA Rockefeller Ctr - Flr 27<br />
New York, NY 10020<br />
(212)762.9094<br />
<a href="mailto:ben.cotton@ms.com"><span style=color:gray>ben.cotton@ms.com</span></a>
<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<BR /><BR />
<HR id=HR1 />
<BR /><SPAN style="FONT-FAMILY: Arial; COLOR: #808080; FONT-SIZE: 7.5pt">NOTICE: 
Morgan Stanley is not acting as a municipal advisor and the opinions or views 
contained herein are not intended to be, and do not constitute, advice within 
the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer 
Protection Act. If you have received this communication in error, please destroy 
all electronic and paper copies and notify the sender immediately. 
Mistransmission is not intended to waive confidentiality or privilege. Morgan 
Stanley reserves the right, to the extent permitted under applicable law, to 
monitor electronic communications. This message is subject to terms available at 
the following link: <A style="FONT-FAMILY: Arial; COLOR: #808080; FONT-SIZE: 7.5pt" href="http://www.morganstanley.com/disclaimers">http://www.morganstanley.com/disclaimers</A> 
If you cannot access these links, please notify us by reply message and we will 
send the contents to you. By messaging with Morgan Stanley you consent to the 
foregoing.</SPAN><BR />
<P></P>
<P></P></P></BODY>
</HTML>