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

Wolfgang Laun wolfgang.laun at gmail.com
Sat May 7 10:11:14 EDT 2011


On 7 May 2011 07:16, boy18nj <boy18nj at gmail.com> wrote:

> 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?
>

Yes.

When asking the way to a goal, it helps to describe the goal. Otherwise, the
answer is likely to be "Just go on, you'll get there."

-W




>
>
> --
> 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.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110507/60b087b7/attachment.html 


More information about the rules-users mailing list