<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word"><head><META content="text/html; charset=us-ascii" http-equiv="Content-Type">

<meta content="text/html; charset=us-ascii" http-equiv=Content-Type>
<meta content="Microsoft Word 12 (filtered medium)" name=Generator>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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>
<DIV><SPAN STYLE="FONT-SIZE: 7.5pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT COLOR="gray" FACE="Arial" SIZE="1"><SPAN STYLE="FONT-SIZE: 14pt; FONT-FAMILY: 'Arial','sans-serif'"><FONT SIZE="2"><FONT COLOR="#000000" FACE="Times New Roman" SIZE="3"><FONT FACE="Arial" SIZE="1"><FONT SIZE="2">

<div class=WordSection1>

<p class=MsoNormal>Hi,<o:p></o:p></p>

<p class=MsoNormal>I have a Map object that maps User product type experience
with the level of expertise. I am trying to use accumulate in my rule <o:p></o:p></p>

<p class=MsoNormal>Such that if the user has experience with certain product
then it gets the experience level and sums it up . <o:p></o:p></p>

<p class=MsoNormal>I am using Drools 5.1 , mvel 2, spring batch 2.x.<o:p></o:p></p>

<p class=MsoNormal>This is my rule :-<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>rule</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:green'>&quot;Insert Product Types&quot;</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>dialect</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;mvel&quot;</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>salience</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> 1800</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>when</span></b><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>eval</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> (</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>true</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>)</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>then</span></b><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; ProductType p1 = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>new</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> ProductType();</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; p1.setName(</span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;P1&quot;</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; ProductType p2 = </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>new</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> ProductType();</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; p2.setName(</span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;P2&quot;</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>insert</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> (p1);</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>insert</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> (p2);</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>end</span></b><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>rule</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:green'>&quot;Product Class
Experience&quot;</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>dialect</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;mvel&quot;</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>salience</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> 1600</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>when</span></b><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; ProductType ($name :
name)</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; $total : Number () </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>from</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#960000'>accumulate</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> (</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Client (productExperience.keySet </span><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000'>contains</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> $name, $score :
productExperience[$name]),</span><span style='font-size:10.0pt;font-family:
"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";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;
sum($score))</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp; </span><b><span style='font-size:
10.0pt;font-family:"Courier New";color:#960000'>then</span></b><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp; System.out.println (</span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;Product
Type Score &quot;</span><span style='font-size:10.0pt;font-family:"Courier New";
color:black'> + $total);</span><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'><o:p>&nbsp;</o:p></span></b></p>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'>End<o:p></o:p></span></b></p>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000'><o:p>&nbsp;</o:p></span></b></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>When
the rule is fired I get the attached exception .<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Any
suggestions / help will be great.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Regards,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Akash<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</FONT></FONT></FONT></FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN STYLE="FONT-SIZE: 7.5pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT COLOR="gray" FACE="Arial" SIZE="1"><SPAN STYLE="FONT-SIZE: 14pt; FONT-FAMILY: 'Arial','sans-serif'"><FONT SIZE="2"><FONT COLOR="#000000" FACE="Times New Roman" SIZE="3"><FONT FACE="Arial" SIZE="1">
<HR>
</FONT></FONT></FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN STYLE="FONT-SIZE: 7.5pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT FACE="Arial" SIZE="1"><SPAN STYLE="FONT-SIZE: 14pt; FONT-FAMILY: 'Arial','sans-serif'"><FONT SIZE="2"><FONT FACE="Times New Roman" SIZE="3"><FONT FACE="Arial" SIZE="1"><FONT COLOR="#808080">NOTICE: 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: </FONT><A HREF="http://www.morganstanley.com/disclaimers"><FONT COLOR="#808080">http://www.morganstanley.com/disclaimers</FONT></A><FONT COLOR="#808080">. 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.</FONT></FONT></FONT></FONT></SPAN></FONT></SPAN></DIV><FONT SIZE="+0"></FONT><FONT SIZE="+0"></FONT><FONT SIZE="+0"></FONT><SPAN></SPAN><FONT SIZE="+0"></FONT><SPAN></SPAN></BODY></HTML>