I have a `SubjectTeacherPeriod` object which has a property `strAttributeMap`
which is a map of `String` and `List<String>`. I want to check if
`HardConstraint.strAttributeValue` and
`SubjectTeacherPeriod.strAttributeMap[$attribute]` *intersect*. Here is the
rule:

    rule "hardConflictIsIn"
        when
        $hc : HardConstraint(
                            $attribute  : attribute,
                            operator == "is in",
                            $values : strAttributeValue,
                            $period : period
                            )
        $stp : SubjectTeacherPeriod(
                                    period == $period,
                                    //ERROR IN FOLLOWING LINE
                                    
Collections.disjoint(strAttributeMap[$attribute], $values) ==
false
                                    )
        then
        insertLogical(new IntConstraintOccurrence("hardConflictIsIn", 
                ConstraintType.NEGATIVE_HARD,1,
                    $hc,$stp));
    end

But the rule (actually two of them) throws the error:

Exception in thread "main" java.lang.IllegalStateException: There are errors
in the scoreDrl's:
Unable to Analyse Expression
Collections.disjoint(strAttributeMap[$attribute], $values) == false:
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast
to java.lang.Class : [Rule name='hardConflictIsIn']

Unable to Analyse Expression
Collections.disjoint(strAttributeMap[$attribute], $values) == true:
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast
to java.lang.Class : [Rule name='hardConflictNotIn']


        at
org.drools.planner.config.solver.SolverConfig.buildRuleBase(SolverConfig.java:238)
        at
org.drools.planner.config.solver.SolverConfig.buildSolver(SolverConfig.java:170)
        at
org.drools.planner.config.XmlSolverConfigurer.buildSolver(XmlSolverConfigurer.java:103)
        at
in.co.technovia.timetabler.TimeTableApp.createSolver(TimeTableApp.java:61)
        at in.co.technovia.timetabler.TimeTableApp.main(TimeTableApp.java:45)

I got it from an answer from my own question at
http://stackoverflow.com/a/9241089/604511 . Is this a bug in Drools itself?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Cant-check-complex-boolean-expressions-with-Collections-disjoint-tp3842259p3842259.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to