[rules-users] NullPointerException @ modify()

H.C. canterburry at gmail.com
Fri May 14 18:54:54 EDT 2010


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-modify-tp818403p818575.html
Sent from the Drools - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100514/973a114e/attachment.html 


More information about the rules-users mailing list