your factTypeName should consist of package name + type name, for example:<br>com.mycompany.Account<br><br><div class="gmail_quote">On Sun, Mar 8, 2009 at 7:02 PM, nestabur <span dir="ltr">&lt;<a href="mailto:nestabur@gmail.com">nestabur@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi all,<br>
<br>
I&#39;m trying to create a fact programatically like this:<br>
<br>
FactType myfact =package.getFactType(factTypeName);<br>
Object myPojo = myfact.newInstance();<br>
<br>
An error occurs when calling the method getFactType, here my stackTrace:<br>
36267-1236185246849-0:0:1:1 Exception while processing message:<br>
java.lang.StringIndexOutOfBoundsException: String index out of range: -1<br>
java.lang.StringIndexOutOfBoundsException: String index out of range: -1<br>
        at java.lang.String.substring(String.java:1938)<br>
        at java.lang.String.substring(String.java:1905)<br>
        at org.drools.rule.Package.getFactType(Package.java:552)<br>
<br>
My drools version is 5.0.0.M5<br>
<br>
Any suggestion?<br>
<font color="#888888"><br>
--<br>
View this message in context: <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>

Sent from the drools - user mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>