[rules-users] Guvnor rule with a not and an ==

Dean Whisnant dean at basys.com
Fri Apr 29 16:46:27 EDT 2011


Hi,

I have a rule where I want to check if an object doesn't exist or it exists and a field in it is null or a field in it is D.

Here's .drl code that works

rule "test does not exist is null or is D"
	when
		(not CLM_DET_LOAD_PendCode() ||
			 CLM_DET_LOAD_PendCode(pendCode_29== (null)) || 
			CLM_DET_LOAD_PendCode(pendCode_29== "D")
		)
	then
		System.out.println("CLM_DET_LOAD_PENDCOE does not exist, is null, or is D");
End

Normally in Guvnor to do an Or, I choose "Any of the following are true..." from the 'Add a condition to the rule...' dialogue.  But when I choose this and then try to do the "not" logic, there is no choice for 'not'.  I can get the other two conditions in just fine.  Short of putting freeform DRL language in there, do you have any suggestions?  Am I missing an option in guvnor?

Thanks

Dean




More information about the rules-users mailing list