[rules-users] Creating fact instance programatically

Michal Bali michalbali at gmail.com
Sun Mar 8 16:27:02 EDT 2009


your factTypeName should consist of package name + type name, for example:
com.mycompany.Account

On Sun, Mar 8, 2009 at 7:02 PM, nestabur <nestabur at gmail.com> wrote:

>
> Hi all,
>
> I'm trying to create a fact programatically like this:
>
> FactType myfact =package.getFactType(factTypeName);
> Object myPojo = myfact.newInstance();
>
> An error occurs when calling the method getFactType, here my stackTrace:
> 36267-1236185246849-0:0:1:1 Exception while processing message:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>        at java.lang.String.substring(String.java:1938)
>        at java.lang.String.substring(String.java:1905)
>        at org.drools.rule.Package.getFactType(Package.java:552)
>
> My drools version is 5.0.0.M5
>
> Any suggestion?
>
> --
> View this message in context:
> http://www.nabble.com/Creating-fact-instance-programatically-tp22334399p22334399.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090308/1d39a111/attachment.html 


More information about the rules-users mailing list