[rules-users] How to further shorten the DSL code?

boy18nj boy18nj at gmail.com
Sat May 7 01:16:26 EDT 2011


This is currently I have-


[condition][]There is fire in "{room}"=Fire({room} : room )
[condition][]"{sprinkler}" is in same "{room}" and sprinkler is
"{off}"={sprinkler}: Sprinkler( room == {room}, on == {off} )
[consequence][]Turn on the "{sprinkler}" for "{room}"=modify( {sprinkler}
){setOn(true)}
[condition][]There is a "{room}"={room} : Room( )
[condition][]This is no fire in "{room}"=not Fire( room == {room} )
[condition][]"{sprinkler}" is in same "{room}" and is "{off}"={sprinkler} :
Sprinkler( room == {room}, on == true )
[consequence][]Turn off the "{sprinkler}" for "{room}"=modify( {sprinkler}
){setOn(false)}

Is it possible to further reuse or define the elements and reuse them in
further conditions?


--
View this message in context: http://drools.46999.n3.nabble.com/How-to-further-shorten-the-DSL-code-tp2911052p2911052.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list