Drool Function error
by shawn
I write a function in drool, but it always has error.
The error is :The method insertLogical(PreCondition) is undefined for the
type InsertPreCondition
Is it because insertLogical must be used in RHS?
Is there any way to use insertLogical in function or implement the function
in RHS?
code:
import PreCondition;
import Authorization;
function void insertPreCondition(Authorization a) {
// a.getPreCondition() returns an arraylist
for( PreCondition pc : a.getPreCondition() ){
insertLogical( pc );
}
}
--
View this message in context: http://drools.46999.n3.nabble.com/Drool-Function-error-tp3788965p3788965....
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Trivial bug in Planner 5.4.Beta1 : misleading error message when the wrong entity was annotated with @PlanningEntityCollectionProperty
by aitchnyu
I accidently denoted the wrong class with the annotator
@PlanningEntityCollectionProperty ; a class which was NOT a planning entity.
Apparently, Drools Planner does not attempt to check for such a possibility,
hence I get:
*--OUTPUT--*
Exception in thread "main" java.lang.NullPointerException
at
org.drools.planner.core.domain.solution.SolutionDescriptor.getAllFacts(SolutionDescriptor.java:135)
at
org.drools.planner.core.solution.director.DefaultSolutionDirector.getWorkingFacts(DefaultSolutionDirector.java:129)
at
org.drools.planner.core.solution.director.DefaultSolutionDirector.resetWorkingMemory(DefaultSolutionDirector.java:123)
at
org.drools.planner.core.solution.director.DefaultSolutionDirector.setWorkingSolution(DefaultSolutionDirector.java:97)
at
org.drools.planner.core.solver.DefaultSolver.setPlanningProblem(DefaultSolver.java:97)
at in.co.technovia.examduties.ExamDutiesApp.main(ExamDutiesApp.java:47)
*--OUTPUT--*
Please check for such a possibility in future versions of Drools Planner and
emit a more meaningful error message.
--
View this message in context: http://drools.46999.n3.nabble.com/Trivial-bug-in-Planner-5-4-Beta1-mislea...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Rule nodes in a ruleflow sharing some rules
by Francois Gadrat
Hello drools users,
I have a modeling issue with ruleflows : I would like to know how to having
rule nodes sharing some rules.
Problem:
Lets says i have 3 rule nodes A, B and C in a ruleflow after a split node:
Node A has rules R1, R3 and R5
Node B has rules R2,R3 and R4
Node C has rules R1, R2, R6
so the issue is that there are rules that are common to different rule nodes
and this seems to be a problem with uniqueness of ruleflow-group attribute
and value in both rule and rule node.
Is there a way to achieve this without splitting nodes A,B and C into
smaller nodes?
Would it be possible to achieve this with getting the ruleflow-group rule
attribute as a result of a function call or an evaluation at runtime, in
order to operate a dynamic rule selection?
Something like this in a rule
ruleflow-group (getRuleflowGroup(kcontext))
where from kcontext,
one would get the name of the rule => kcontext.getRule().getName()
one would get the name of current Node from kcontext ?
Thanks for sharing your thoughts and for your time. Francois.
14 years