OK...the following rules seems to work:
rule "Assign awardable activity to default context"
ruleflow-group "select qualified activity"
when
$context : ResultContext( activity != null &&
activity.qualifiedActivity == null )
$activity : Activity() from $context.activity
$candidate : CandidateMatch( member != null &&
match != null &&
eval( match instanceof QualifiedActivity))
eval(((QualifiedActivity)$candidate.getMatch()).isAwardable())
then
modify($activity){
setQualifiedActivity((QualifiedActivity) $candidate.getMatch());
}
end
The key seemed to be to modify the activity directly in working memory
rather than traversing to it from the context. Not sure if this gives any
hints towards why drools is throwing a NullPointerException in the prior
case.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/NullPointerException-...
Sent from the Drools - User mailing list archive at
Nabble.com.