Re: [rules-users] Is there a way to add a JAR to a knowledBuilder

2013-05-03 Thread Charles Moulliard
You are right. What I was doing was stupid.



On Thu, May 2, 2013 at 9:53 PM, Davide Sottara  wrote:

> What would be the exact use case for this?
> The FactType reflective API is used to access the classes declared in DRL
> and compiled on-the-fly
> at runtime. As long as the jar is on the classpath, you should be fine.
> Notice that guvnor is different, since you do have to deliver the jar
> there.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-Is-there-a-way-to-add-a-JAR-to-a-knowledBuilder-tp4023631p4023646.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Is there a way to add a JAR to a knowledBuilder

2013-05-02 Thread Davide Sottara
What would be the exact use case for this?
The FactType reflective API is used to access the classes declared in DRL
and compiled on-the-fly 
at runtime. As long as the jar is on the classpath, you should be fine.
Notice that guvnor is different, since you do have to deliver the jar there.



--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Is-there-a-way-to-add-a-JAR-to-a-knowledBuilder-tp4023631p4023646.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Is there a way to add a JAR to a knowledBuilder

2013-05-02 Thread Charles Moulliard
I have created an example where I import model from a jar file (containing
classes LoanApplication, Applicant, IncomeSource, ...) but get a NPE when I
try to create a object from FactType. That means that packages has not be
loaded correctly. Any idea is welcome

https://gist.github.com/cmoulliard/0d9564843966a6385946




On Thu, May 2, 2013 at 4:33 PM, Charles Moulliard  wrote:

> Hi,
>
> Is there a way to add a JAR to a knowledgeBuilder with a method like that ?
>
>
> kbuilder.add(ResourceFactory.newUrlResource("file:///model-1.0-SNAPSHOT.jar"),ResourceType.JAR);
>
> Regard,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Is there a way to add a JAR to a knowledBuilder

2013-05-02 Thread Charles Moulliard
Hi,

Is there a way to add a JAR to a knowledgeBuilder with a method like that ?

kbuilder.add(ResourceFactory.newUrlResource("file:///model-1.0-SNAPSHOT.jar"),ResourceType.JAR);

Regard,

-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users