<br><br><div class="gmail_quote">On 7 May 2011 07:16, boy18nj <span dir="ltr"><<a href="mailto:boy18nj@gmail.com">boy18nj@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is currently I have-<br>
<br>
<br>
[condition][]There is fire in "{room}"=Fire({room} : room )<br>
[condition][]"{sprinkler}" is in same "{room}" and sprinkler is<br>
"{off}"={sprinkler}: Sprinkler( room == {room}, on == {off} )<br>
[consequence][]Turn on the "{sprinkler}" for "{room}"=modify( {sprinkler}<br>
){setOn(true)}<br>
[condition][]There is a "{room}"={room} : Room( )<br>
[condition][]This is no fire in "{room}"=not Fire( room == {room} )<br>
[condition][]"{sprinkler}" is in same "{room}" and is "{off}"={sprinkler} :<br>
Sprinkler( room == {room}, on == true )<br>
[consequence][]Turn off the "{sprinkler}" for "{room}"=modify( {sprinkler}<br>
){setOn(false)}<br>
<br>
Is it possible to further reuse or define the elements and reuse them in<br>
further conditions?<br></blockquote><div><br>Yes.<br><br>When asking the way to a goal, it helps to describe the goal. Otherwise, the<br>answer is likely to be "Just go on, you'll get there."<br><br>-W<br><br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-further-shorten-the-DSL-code-tp2911052p2911052.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-further-shorten-the-DSL-code-tp2911052p2911052.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>