<div dir="ltr">Hi Wolfgang,<div><br></div><div>You are right. It only happens for variable declaration. It has no problem on the right side. For example</div><div><br></div><div>Map a = new HashMap&lt;String,String&gt;()</div>
<div><br></div><div>has no problem. </div><div><br></div><div>I am using 6.0.1-Final.</div><div><br></div><div>Thanks.</div><div><br></div><div>Jinghai</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, May 16, 2014 at 11:58 PM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This also works:<br>
     Map&lt;String,String&gt; a = new HashMap&lt;&gt;();<br>
<br>
More ways to run into an error<br>
     Map&lt;String,String&gt; a;<br>
<div class="">     a = new HashMap&lt;String,String&gt;();<br>
</div>etc.<br>
<br>
Using 6.0.0-Final<br>
<span class="HOEnZb"><font color="#888888">-W<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 17/05/2014, rjh &lt;<a href="mailto:raojinghai@gmail.com">raojinghai@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I got a weird problem. A Java List/Map with generics can be used together<br>
&gt; with modify() in the same rule. For example, a simple rule like the<br>
&gt; following:<br>
&gt;<br>
&gt; package com.sample<br>
&gt;<br>
&gt; import java.util.Map;<br>
&gt; import java.util.HashMap;<br>
&gt;<br>
&gt; declare TestFact<br>
&gt;     @propertyReactive<br>
&gt;     data : String<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;init&quot;<br>
&gt;     when<br>
&gt;         not TestFact()<br>
&gt;     then<br>
&gt;         insert (new TestFact());<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;Test Rule&quot;<br>
&gt;     when<br>
&gt;         $fact : TestFact()<br>
&gt;     then<br>
&gt;         System.out.println( &quot;Hello&quot; );<br>
&gt;         Map&lt;String,String&gt; a = new HashMap&lt;String,String&gt;();<br>
&gt;         modify ($fact) {setData(&quot;0&quot;)}<br>
&gt; end<br>
&gt;<br>
&gt; I got the following error message:<br>
&gt;<br>
&gt; java.lang.RuntimeException: Error while creating KieBase[Message [id=1,<br>
&gt; level=ERROR, path=rules/Sample.drl, line=18, column=0<br>
&gt;    text=Unable to resolve type Map&lt;String,String&gt;:<br>
&gt; Unable to find class &#39;Map&lt;String,String&gt;&#39;]]<br>
&gt;       at<br>
&gt; org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:260)<br>
&gt;       at<br>
&gt; org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:400)<br>
&gt;       at<br>
&gt; org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:375)<br>
&gt;       at com.sample.DroolsTest.main(DroolsTest.java:17)<br>
&gt;<br>
&gt; However, if I remove &quot;&lt;String,String&gt;&quot; from &quot;Map&lt;String,String&gt;&quot;, or remove<br>
&gt; the &quot;modify&quot; line, the code is correct then.<br>
&gt;<br>
&gt; Thank you!<br>
&gt;<br>
&gt; Jinghai<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context:<br>
&gt; <a href="http://drools.46999.n3.nabble.com/Map-String-String-and-modify-can-t-be-together-tp4029591.html" target="_blank">http://drools.46999.n3.nabble.com/Map-String-String-and-modify-can-t-be-together-tp4029591.html</a><br>

&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<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" target="_blank">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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br></div>