<br>    Nestor,<br><br>    As it is now, DRL files must have a package name or you will be in trouble. So, use a package name for your DRL file and use that package name to retrieve the fact type. It will work.<br><br>    Meanwhile, I will fix the bug. If you can open a JIRA, even better to keep track of progress.<br>
<br>    []s<br>    Edson<br><br><div class="gmail_quote">2009/3/10 nestabur <span dir="ltr">&lt;<a href="mailto:nestabur@gmail.com">nestabur@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Any suggestions?ż<br>
<div><div></div><div class="h5"><br>
<br>
nestabur wrote:<br>
&gt;<br>
&gt; Yes,<br>
&gt;<br>
&gt; If I put a non existent package and type, the method getFactType returns<br>
&gt; me<br>
&gt; null value, but if I put the correct package and type it throws that<br>
&gt; error.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; NEStor<br>
&gt;<br>
&gt; 2009/3/8 Michal Bali &lt;<a href="mailto:michalbali@gmail.com">michalbali@gmail.com</a>&gt;<br>
&gt;<br>
&gt;&gt; your factTypeName should consist of package name + type name, for<br>
&gt;&gt; example:<br>
&gt;&gt; com.mycompany.Account<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Mar 8, 2009 at 7:02 PM, nestabur &lt;<a href="mailto:nestabur@gmail.com">nestabur@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi all,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m trying to create a fact programatically like this:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; FactType myfact =package.getFactType(factTypeName);<br>
&gt;&gt;&gt; Object myPojo = myfact.newInstance();<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; An error occurs when calling the method getFactType, here my stackTrace:<br>
&gt;&gt;&gt; 36267-1236185246849-0:0:1:1 Exception while processing message:<br>
&gt;&gt;&gt; java.lang.StringIndexOutOfBoundsException: String index out of range: -1<br>
&gt;&gt;&gt; java.lang.StringIndexOutOfBoundsException: String index out of range: -1<br>
&gt;&gt;&gt;        at java.lang.String.substring(String.java:1938)<br>
&gt;&gt;&gt;        at java.lang.String.substring(String.java:1905)<br>
&gt;&gt;&gt;        at org.drools.rule.Package.getFactType(Package.java:552)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; My drools version is 5.0.0.M5<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Any suggestion?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; View this message in context:<br>
&gt;&gt;&gt; <a href="http://www.nabble.com/Creating-fact-instance-programatically-tp22334399p22334399.html" target="_blank">http://www.nabble.com/Creating-fact-instance-programatically-tp22334399p22334399.html</a><br>
&gt;&gt;&gt; Sent from the drools - user mailing list archive at Nabble.com.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<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>
&gt;<br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Creating-fact-instance-programatically-tp22334399p22431776.html" target="_blank">http://www.nabble.com/Creating-fact-instance-programatically-tp22334399p22431776.html</a><br>

</font><div><div></div><div class="h5">Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
<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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>