<br><font size=2 face="sans-serif">Hi </font>
<br>
<br><font size=2 face="sans-serif">at line number 51 of RuleHandler.java
following assignment is there</font>
<br>
<br><font size=2 face="sans-serif">FlifoDTO flifoDTO = flDTO;</font>
<br>
<br><font size=2 face="sans-serif">this flDTO is comming as parameter of
</font><font size=2 face="Courier New">initMessage</font><font size=2 face="sans-serif">()
which is an instance of FlifoDTO created in main method.</font>
<br><font size=2 face="sans-serif"><br>
Regards<br>
Sanjib Karmakar<br>
SkyTech Solutions Pvt. Ltd<br>
<br>
Please consider the environment before printing this email.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>&quot;Wolfgang Laun-2 [via
Drools - Java Rules Engine]&quot; &lt;<a href="/user/SendEmail.jtp?type=node&node=1018292&i=0" target="_top" rel="nofollow">[hidden email]</a>&gt;</b>
</font>
<p><font size=1 face="sans-serif">08/03/2010 11:08 AM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Sanjib Karmakar &lt;<a href="/user/SendEmail.jtp?type=node&node=1018292&i=1" target="_top" rel="nofollow">[hidden email]</a>&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: Need help to call method with input
parameter and return type</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>ksession hasn't been assigned an object when you call
ksession.insert <br>
in RuleHandler.java:61. <br>
-W <br>
<br>
On 3 August 2010 06:31, Sanjib Karmakar &lt;</font><a href="/user/SendEmail.jtp?type=node&amp;node=1018143&amp;i=0&by-user=t" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>[hidden
email]</u></font></a><font size=3>&gt; wrote: </font>
<br><font size=3><br>
&gt; <br>
&gt; Hi <br>
&gt; <br>
&gt; I am new in drools. In my project I have to call the method define
in xml <br>
&gt; rule file using java <br>
&gt; <br>
&gt; ## Following is my rule xml <br>
&gt; <br>
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; <br>
&gt; Â&nbsp;&lt;package name=&quot;com.sample&quot; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;xmlns=&quot;</font><a href="http://drools.org/drools-5.0" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>http://drools.org/drools-5.0</u></font></a><font size=3>&quot;
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;xmlns:xs=&quot;</font><a href="http://www.w3.org/2001/XMLSchema-instance" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>http://www.w3.org/2001/XMLSchema-instance</u></font></a><font size=3>&quot;
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;xs:schemaLocation=&quot;</font><a href="http://drools.org/drools-5.0" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>http://drools.org/drools-5.0</u></font></a><font size=3>
drools.org/drools-5.0.xsd&quot;&gt; <br>
&gt; &lt;import name=&quot;com.skyfusion.dto.FlifoDTO&quot; /&gt; <br>
&gt; <br>
&gt; &lt;global identifier=&quot;flifoDTO&quot; type=&quot;com.skyfusion.dto.FlifoDTO&quot;
/&gt; <br>
&gt; <br>
&gt; &lt;function return-type=&quot;FlifoDTO&quot; name=&quot;show&quot;&gt;
<br>
&gt; Â&nbsp; Â&nbsp;&lt;parameter identifier=&quot;appId&quot; type=&quot;FlifoDTO.appId&quot;/&gt;
<br>
&gt; Â&nbsp; Â&nbsp;&lt;body&gt; <br>
&gt; Â&nbsp; Â&nbsp; System.out.println(&quot;appId &quot; + appId); <br>
&gt; Â&nbsp; Â&nbsp; if(appId==2) <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp;{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;flifoDTO.setChnlName(&quot;SKYFUSION.UNI.SIMU.TXT.QUEUE&quot;);
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; if(appId==3) <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp;{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;flifoDTO.setChnlName(&quot;SKYFUSION.BASE.MSGFLTR.TXT.TOPIC&quot;);
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp;&lt;/body&gt; <br>
&gt; &lt;/function&gt; <br>
&gt; <br>
&gt; &lt;rule name=&quot;Find Channel&quot;&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;&lt;lhs&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;&lt;pattern
identifier=&quot;flDTO&quot; object-type=&quot;FlifoDTO&quot; &gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;&lt;field-constraint field-name=&quot;flifoType&quot;&gt;
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;&lt;qualified-identifier-restriction
<br>
&gt; evaluator=&quot;==&quot;&gt;FlifoDTO.FLIFO&lt;/qualified-identifier-restriction&gt;
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;&lt;/field-constraint&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;&lt;field-binding field-name=&quot;appId&quot; identifier=&quot;ruleDTO&quot;/&gt;
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;&lt;/pattern&gt;
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;&lt;/lhs&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;&lt;rhs&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;//System.out.println(ruleDTO);
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;System.out.println(&quot;Find
Channel&quot;); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;//show(appId);
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;&lt;/rhs&gt; <br>
&gt; &lt;/rule&gt; <br>
&gt; <br>
&gt; &lt;/package&gt; <br>
&gt; <br>
&gt; ## Following is my DTO class <br>
&gt; <br>
&gt; package com.skyfusion.dto; <br>
&gt; <br>
&gt; public class FlifoDTO <br>
&gt; { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public static final int FLIFO = 1;
<br>
&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;private String ruleId; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;private int appId; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;private int flifoType; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;private String chnlName; <br>
&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public FlifoDTO() { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public int getAppId() { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;return
appId; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public void setAppId(int appId) { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;this.appId
= appId; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public String getChnlName() { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;return
chnlName; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public void setChnlName(String chnlName)
{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;this.chnlName
= chnlName; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public void setRuleId(String ruleId)
{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;this.ruleId
= ruleId; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public String getRuleId() { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;return
ruleId; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public int getFlifoType() { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;return
flifoType; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public void setFlifoType(int flifoType)
{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;this.flifoType
= flifoType; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; } <br>
&gt; <br>
&gt; ## Following is my rule execution class <br>
&gt; <br>
&gt; package com.skyfusion.rule.handler; <br>
&gt; <br>
&gt; import org.drools.KnowledgeBase; <br>
&gt; import org.drools.KnowledgeBaseFactory; <br>
&gt; import org.drools.builder.KnowledgeBuilder; <br>
&gt; import org.drools.builder.KnowledgeBuilderError; <br>
&gt; import org.drools.builder.KnowledgeBuilderErrors; <br>
&gt; import org.drools.builder.KnowledgeBuilderFactory; <br>
&gt; import org.drools.builder.ResourceType; <br>
&gt; import org.drools.io.ResourceFactory; <br>
&gt; import org.drools.runtime.StatefulKnowledgeSession; <br>
&gt; <br>
&gt; import com.skyfusion.dto.FlifoDTO; <br>
&gt; <br>
&gt; public class RuleHandler { <br>
&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;private StatefulKnowledgeSession ksession
= null; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;private KnowledgeBase kbase = null;
<br>
&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public RuleHandler() <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;try
{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;// load up the knowledge base <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;kbase = readKnowledgeBase(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;ksession = kbase.newStatefulKnowledgeSession();
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} catch
(Exception t) { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;t.printStackTrace(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;private KnowledgeBase readKnowledgeBase()
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;throws Exception <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;KnowledgeBuilder
kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;kbuilder.add(ResourceFactory.newClassPathResource(&quot;fliforule.xml&quot;),
<br>
&gt; ResourceType.XDRL); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;KnowledgeBuilderErrors
errors = kbuilder.getErrors(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;if
(errors.size() &gt; 0) { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;for (KnowledgeBuilderError error: errors) { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;System.out.println(error);
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;throw new IllegalArgumentException(&quot;Could not
parse knowledge.&quot;); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;KnowledgeBase
kbase = KnowledgeBaseFactory.newKnowledgeBase(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;return
kbase; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public FlifoDTO initMessage(String
ruleID, FlifoDTO flDTO, int appId, int <br>
&gt; type) <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;throws Exception <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;FlifoDTO
flifoDTO = flDTO; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;try
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; {
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;flifoDTO.setRuleId(ruleID); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;flifoDTO.setAppId(appId); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;flifoDTO.setFlifoType(type); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;ksession.insert(flifoDTO); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;ksession.fireAllRules(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; }catch(Exception
t) <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;{
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;t.printStackTrace(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;}
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;return
flifoDTO; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; } <br>
&gt; <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;public static void main(String args[]){
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;RuleHandler
rh = new RuleHandler(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;FlifoDTO
flifoDTO = new FlifoDTO(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;try
{ <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;flifoDTO = rh.initMessage(&quot;Find Channel&quot;,flifoDTO,2,1);
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} catch
(Exception e) { <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;
Â&nbsp; Â&nbsp; Â&nbsp;e.printStackTrace(); <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;System.out.println(flifoDTO.getChnlName());
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;} <br>
&gt; } <br>
&gt; <br>
&gt; ## I am getting the following exception <br>
&gt; <br>
&gt; java.lang.IllegalArgumentException: Could not parse knowledge. <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;at <br>
&gt; com.skyfusion.rule.handler.RuleHandler.readKnowledgeBase(RuleHandler.java:45)
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;at com.skyfusion.rule.handler.RuleHandler.&lt;init&gt;(RuleHandler.java:28)
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;at com.skyfusion.rule.handler.RuleHandler.main(RuleHandler.java:71)
<br>
&gt; java.lang.NullPointerException <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;at com.skyfusion.rule.handler.RuleHandler.initMessage(RuleHandler.java:61)
<br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;at com.skyfusion.rule.handler.RuleHandler.main(RuleHandler.java:74)
<br>
&gt; (null: 29, 54): schema_reference.4: Failed to read schema document
<br>
&gt; 'drools.org/drools-5.0.xsd', because 1) could not find the document;
2) the <br>
&gt; document could not be read; 3) the root element of the document is
not <br>
&gt; &lt;xsd:schema&gt;. <br>
&gt; (null: 31, 60): schema_reference.4: Failed to read schema document
<br>
&gt; 'drools.org/drools-5.0.xsd', because 1) could not find the document;
2) the <br>
&gt; document could not be read; 3) the root element of the document is
not <br>
&gt; &lt;xsd:schema&gt;. <br>
&gt; (null: 34, 7): schema_reference.4: Failed to read schema document
<br>
&gt; 'drools.org/drools-5.0.xsd', because 1) could not find the document;
2) the <br>
&gt; document could not be read; 3) the root element of the document is
not <br>
&gt; &lt;xsd:schema&gt;. <br>
&gt; Error importing : 'com.sample.Show.show' <br>
&gt; [ show : unable to resolve type while building function <br>
&gt; Â&nbsp;] <br>
&gt; [ show : Function Compilation error <br>
&gt; show (line:-2): FlifoDTO.appId cannot be resolved to a type <br>
&gt; show (line:3): flifoDTO cannot be resolved <br>
&gt; show (line:7): flifoDTO cannot be resolved <br>
&gt; Â&nbsp;] <br>
&gt; [ show : Function Compilation error <br>
&gt; show (line:-2): FlifoDTO.appId cannot be resolved to a type <br>
&gt; show (line:3): flifoDTO cannot be resolved <br>
&gt; show (line:7): flifoDTO cannot be resolved <br>
&gt; Â&nbsp;] <br>
&gt; Rule Compilation error : [Rule name='Find Channel'] <br>
&gt; Â&nbsp; Â&nbsp; Â&nbsp; Â&nbsp;com/sample/Rule_Find_Channel_0.java
(2:89) : The import com.sample.Show <br>
&gt; cannot be resolved <br>
&gt; <br>
&gt; Error importing : 'com.sample.Show.show' <br>
&gt; null <br>
&gt; <br>
&gt; ## Please let me know I am missing. <br>
&gt; <br>
&gt; Thanks in advance <br>
&gt; <br>
&gt; -- <br>
&gt; View this message in context: </font><a href="http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-to-call-method-with-input-parameter-and-return-type-tp1018058p1018058.html?by-user=t&by-user=t" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-to-call-method-with-input-parameter-and-return-type-tp1018058p1018058.html</u></font></a><font size=3><br>
&gt; Sent from the Drools - User mailing list archive at Nabble.com. <br>
&gt; _______________________________________________ <br>
&gt; rules-users mailing list <br>
&gt; </font><a href="/user/SendEmail.jtp?type=node&amp;node=1018143&amp;i=1&by-user=t" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>[hidden
email]</u></font></a><font size=3> <br>
&gt; </font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>https://lists.jboss.org/mailman/listinfo/rules-users</u></font></a><font size=3><br>
&gt; </font>
<br><font size=3><br>
_______________________________________________ <br>
rules-users mailing list </font><font size=3 color=blue><u><br>
</u></font><a href="/user/SendEmail.jtp?type=node&amp;node=1018143&amp;i=2&by-user=t" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>[hidden
email]</u></font></a><font size=3> </font><font size=3 color=blue><u><br>
</u></font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_top rel="nofollow" link="external"><font size=3 color=blue><u>https://lists.jboss.org/mailman/listinfo/rules-users</u></font></a><font size=3><br>
</font>
<hr noshade>
<br><font size=3 color=#666666>View message @ </font><a href="http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-to-call-method-with-input-parameter-and-return-type-tp1018058p1018143.html?by-user=t" target="_top" rel="nofollow" link="external"><font size=3 color=blue><u>http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-to-call-method-with-input-parameter-and-return-type-tp1018058p1018143.html</u></font></a><font size=3 color=#666666>
<br>
To unsubscribe from Need help to call method with input parameter and return
type, </font><a target="_top" rel="nofollow" link="external"><font size=3 color=blue><u>click
here</u></font></a><font size=3 color=#666666>. </font>
<br>
<br><hr align="left" width="300">
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-to-call-method-with-input-parameter-and-return-type-tp1018058p1018292.html">Re: Need help to call method with input parameter and return type</a><br>
Sent from the <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html">Drools - User mailing list archive</a> at Nabble.com.<br>