[rules-users] OptaPlanner Guvnor integration

Bartek bartekd100 at wp.pl
Tue Jun 18 03:46:55 EDT 2013


Thanks for your answer, it helps.
But just after solving one problem I am facing another. When uploading 
my domain facts to Guvnor I get exception (from guvnor logs):

...
  Servlet.service() for servlet AssetFileServlet threw exception: 
javax.enterprise.event.ObserverException
...
Caused by: *java.lang.NoClassDefFoundError: 
org/drools/planner/core/solution/Solution*
         at java.lang.ClassLoader.defineClass1(Native Method) 
[rt.jar:1.7.0_07]
...

I suppose there are no  Optaplanner classes on guvnor classpath. Should 
they be? Or mayby guvnor do not need my problem definition(so guvnor 
wont need to use Solution interface )?

Is it generally good idea to try use guvnor to define scores?


W dniu 2013-06-17 15:52, Geoffrey De Smet pisze:
>
> On 17-06-13 15:33, Bartek wrote:
>> Hello,
>> How Optaplanner and Guvnor  should be integrated? I am using Drools 
>> 5.5.0.Final. I have configuration  with spring so I have access to 
>> KnowledgeBase.
>> I found in documentation:
>>
>>
>>           5.3.4.2.2. A RuleBase (possibly defined by Guvnor)
>>
>>
>>            solverFactory.getSolverConfig().getScoreDirectorFactoryConfig.setRuleBase(ruleBase);
>>
>>
>> How I can get rule base? (If it is correct way do integrate with guvnor)
>>
> yes, it's the correct way for optaplanner 5.5.x with drools 5.5.x:
> IIRC, the guvnor docs explains how you can get a KnowledgeBase (~ 
> drools 5 api), which you can transform into a RuleBase (~ drools 4 api 
> which is still available in 5.5.x) like this:
> |((InternalKnowledgeBase) myKnowledgeBase).getRuleBase()|
>
> See 
> http://stackoverflow.com/questions/11017613/live-rule-creation-in-drools-planner
> IIRC, KnowledgeAgent connects to guvnor and builds a KnowledgeBase.
>
>
> That being said, for optaplanner 6.0.x with drools 6.0.x,
> everything is standardized on KieBase (~ drools 6 api) (which is like 
> the KnowledgeBase in the 5 api).
> We recently released 6.0.0.Beta3 (drools, guvnor and optaplanner 
> release together).
> So there's
> solverFactory.getSolverConfig().getScoreDirectorFactoryConfig.setKieBase(kieBase);
> The optaplanner and drools stuff is pretty stable, even if it's called 
> Beta3 (CR1 is coming soon),
> but I have no idea about the state of guvnor's KieBase support.
>
>> Thanks,
>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> 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/20130618/e807d30d/attachment-0001.html 


More information about the rules-users mailing list