T
> * To: *Rules Users List
> * Subject: *Re: [rules-users] How do I write a rule to detect a missing
> value in a group of facts?
>
> Don't think procedurally, just write the *rule* for a missing post ;-)
>
> rule "missing fence post"
> when
> FencePos
: [rules-users] How do I write a rule to detect a missing value in a
group of facts?
Don't think procedurally, just write the *rule* for a missing post ;-)
rule "missing fence post"
when
FencePost( $d: distanceFromStart )
FencePost( distanceFromStart == $d + 2*FencePos
Don't think procedurally, just write the *rule* for a missing post ;-)
rule "missing fence post"
when
FencePost( $d: distanceFromStart )
FencePost( distanceFromStart == $d + 2*FencePost.GAP )
not FencePost( distanceFromStart == $d + FencePost.GAP )
then
System.out.println( "Missing
I need to write a rule to identify a missing element in a group of facts.
For example, let us say I want to ensure that my fence has a fence post
every 8 feet. My fact declaration is as follows:
declare FencePost
identifier : String
distanceFromStart: Long
end
If I add the following facts