The problem is that you are inserting the fact type definition instead of the facts themselves. <div><br></div><div>instead of insert <i>appType</i> and <i>incomeType</i> you should insert <i>application</i> and <i>income</i>.<br clear="all">

<br>Best Regards,<br><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">On Mon, Jul 16, 2012 at 3:20 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">

Why do you think that you should have a third fact when there are no<br>
insert() calls except the two in your Java code?<br>
<span class="HOEnZb"><font color="#888888">-W<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 16/07/2012, Ravikiran &lt;<a href="mailto:ravikiran.kakarla@gmail.com">ravikiran.kakarla@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt; I&#39;m using default Guvnor package &quot;mortgages&quot; decision table as example for<br>
&gt; my POC. Below is the rules from the decision table. No rule is being fired<br>
&gt; from my JAVA client out of 3 rules given below.<br>
&gt;<br>
&gt; //from row number: 1<br>
&gt; rule &quot;Row 3 Pricing loans&quot;<br>
&gt;       dialect &quot;mvel&quot;<br>
&gt;       when<br>
&gt;                    application : LoanApplication( amount &gt; &quot;131000&quot; , amount &lt;=<br>
&gt; &quot;200000&quot; , lengthYears == &quot;30&quot; , deposit &lt; &quot;20000&quot; )<br>
&gt;               income : IncomeSource( type == &quot;Asset&quot; )<br>
&gt;       then<br>
&gt;               application.setApproved( true );<br>
&gt;               application.setInsuranceCost( 0 );<br>
&gt;               application.setApprovedRate( 2 );<br>
&gt; end<br>
&gt;<br>
&gt; //from row number: 2<br>
&gt; rule &quot;Row 1 Pricing loans&quot;<br>
&gt;       dialect &quot;mvel&quot;<br>
&gt;       when<br>
&gt;               application : LoanApplication( amount &gt; &quot;10000&quot; , amount &lt;= &quot;100000&quot; ,<br>
&gt; lengthYears == &quot;20&quot; , deposit &lt; &quot;2000&quot; )<br>
&gt;               income : IncomeSource( type == &quot;Job&quot; )<br>
&gt;       then<br>
&gt;               application.setApproved( true );<br>
&gt;               application.setInsuranceCost( 0 );<br>
&gt;               application.setApprovedRate( 4 );<br>
&gt; end<br>
&gt;<br>
&gt; //from row number: 3<br>
&gt; rule &quot;Row 2 Pricing loans&quot;<br>
&gt;       dialect &quot;mvel&quot;<br>
&gt;       when<br>
&gt;               application : LoanApplication( amount &gt; &quot;100001&quot; , amount &lt;= &quot;130000&quot; ,<br>
&gt; lengthYears == &quot;20&quot; , deposit &lt; &quot;3000&quot; )<br>
&gt;               income : IncomeSource( type == &quot;Job&quot; )<br>
&gt;       then<br>
&gt;               application.setApproved( true );<br>
&gt;               application.setInsuranceCost( 10 );<br>
&gt;               application.setApprovedRate( 6 );<br>
&gt; end<br>
&gt;<br>
&gt; ==&gt; My Java client follows<br>
&gt; KnowledgeBase knowledgeBase = createKnowledgeBase(); //Successfully creates<br>
&gt; knowledgebase<br>
&gt; StatefulKnowledgeSession session =<br>
&gt; knowledgeBase.newStatefulKnowledgeSession();<br>
&gt;<br>
&gt;         FactType appType = knowledgeBase.getFactType( &quot;mortgages&quot;,<br>
&gt; &quot;LoanApplication&quot; );<br>
&gt;         FactType incomeType = knowledgeBase.getFactType( &quot;mortgages&quot;,<br>
&gt; &quot;IncomeSource&quot; );<br>
&gt;<br>
&gt;         Object application = appType.newInstance();<br>
&gt;         Object income = incomeType.newInstance();<br>
&gt;<br>
&gt;         appType.set(application, &quot;amount&quot;, 100000);<br>
&gt;         appType.set(application, &quot;deposit&quot;, 1500);<br>
&gt;         appType.set(application, &quot;lengthYears&quot;, 20);<br>
&gt;<br>
&gt;         incomeType.set(income, &quot;type&quot;, &quot;Job&quot;);<br>
&gt;         incomeType.set(income, &quot;amount&quot;, 65000);<br>
&gt;<br>
&gt;         session.insert(appType);<br>
&gt;         session.insert(incomeType);<br>
&gt;<br>
&gt;         assertTrue(session.getFactCount() == 2);<br>
&gt;         session.fireAllRules();<br>
&gt;         assertTrue(session.getFactCount() == 3);<br>
&gt;<br>
&gt; Question: I hope the way i pass the input satisfies &quot;Row 2 Pricing loans&quot;<br>
&gt; above. But My assertion is getting failed after calling<br>
&gt; fireAllRules()...because the factcount was still 2. Please help what could<br>
&gt; be the wrong in above scenario.<br>
&gt;<br>
&gt; thanks a lot.<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context:<br>
&gt; <a href="http://drools.46999.n3.nabble.com/Drools-Guvnor-Decison-Tables-Rule-is-not-being-fired-Please-help-tp4018701.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-Guvnor-Decison-Tables-Rule-is-not-being-fired-Please-help-tp4018701.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>