<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Macon,<div>you can write all on one statement, but must be separated by comma</div><div><br></div><div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div lang="EN-US" link="blue" vlink="purple"><div class="Section1"><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; ">[when]User is eligible for “{testCD}”=not MyFeature(testCD == “{testCD}”) </span><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 13px;"><b>,</b></span></font><span style="font-size: 10pt; "> $eligible : FeatureEligible(testCD = “{testCD}”)</span></font></pre></div></div></span></blockquote><br></div><div>and you will not get any overhead at runtime because all the interpretation happens at compilation, as you says</div><div><br></div><div>lucaz</div><div><br></div><div><div><div>El 22/10/2009, a las 11:28, Pegram, Macon escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div lang="EN-US" link="blue" vlink="purple"><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">All,<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">Given the following rule:<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">rule</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span></span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: green; ">"Add ABC123 Feature"</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">when</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">not</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span>MyFeature(testCD ==<span class="Apple-converted-space"> </span></span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: green; ">"ABC123"</span></font><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">)</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> UserRequest(someValue ==<span class="Apple-converted-space"> </span></span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: green; ">"ABC123_FEATURE"</span></font><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">)</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> $eligible : FeatureEligible(testCD ==<span class="Apple-converted-space"> </span></span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: green; ">"ABC123"</span></font><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">)</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">then</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">insert</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">(</span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">new</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span>MyFeature($eligible)); </span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">end</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">I’d like to create a DSL. Notice that “testCD” is the same value. <o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">Is it possible to apply a value captured in a DSL and use it in more than one condition? In the above scenario we want to see if the user is eligible for the feature ABC123, and check whether or not that feature has already been added in working memory.<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">The DSL version of the rule might look something like:<br></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">rule</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span></span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: green; ">"Add ABC123 Feature"</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">when</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> User<span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">is</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span>eligible<span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">for</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span></span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: green; ">"ABC123"</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> User requests<span class="Apple-converted-space"> </span></span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: green; ">"ABC123_FEATURE"</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">then</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> Add feature </span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><b><font size="2" color="#960000" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(150, 0, 0); font-weight: bold; ">end</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">Would I need to write the DSL for the “ABC123” piece like this?<o:p></o:p></span></font></div><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; ">[when]User is eligible for “{testCD}”=not MyFeature(testCD == “{testCD}”) $eligible : FeatureEligible(testCD = “{testCD}”)<o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; "><o:p> </o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">Or will I always need to create 2 statements? <o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">What are the performance implications of using a DSL? Is there extra overhead at runtime or does all the interpretation occur at rule compilation?<o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">Thanks!<o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">Macon<o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; "><o:p> </o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; "><o:p> </o:p></span></font></pre><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "> <o:p></o:p></span></font></div></div>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" style="color: blue; text-decoration: underline; ">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" style="color: blue; text-decoration: underline; ">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></div></span></blockquote></div><br></div></body></html>