<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"><<a href="mailto:nestabur@gmail.com">nestabur@gmail.com</a>></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>
><br>
> Yes,<br>
><br>
> If I put a non existent package and type, the method getFactType returns<br>
> me<br>
> null value, but if I put the correct package and type it throws that<br>
> error.<br>
><br>
> Thanks,<br>
><br>
> NEStor<br>
><br>
> 2009/3/8 Michal Bali <<a href="mailto:michalbali@gmail.com">michalbali@gmail.com</a>><br>
><br>
>> your factTypeName should consist of package name + type name, for<br>
>> example:<br>
>> com.mycompany.Account<br>
>><br>
>><br>
>> On Sun, Mar 8, 2009 at 7:02 PM, nestabur <<a href="mailto:nestabur@gmail.com">nestabur@gmail.com</a>> wrote:<br>
>><br>
>>><br>
>>> Hi all,<br>
>>><br>
>>> I'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>
>>><br>
>>> --<br>
>>> View this message in context:<br>
>>> <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>
>>><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>
>><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>
><br>
><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>