<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Lucas,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Great! Thanks for the quick reply. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Macon<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Lucas Amador<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, October 22, 2009
10:58 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Rules Users List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [rules-users] DSL
questions....</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi Macon,<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>you can write all on one statement, but must be separated by comma<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite><span
style='orphans: 2;widows: 2;-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;word-spacing:0px'>
<div link=blue vlink=purple>
<div><pre><font size=2 color=black face="Courier New"><span style='font-size:
10.0pt;color:black'>[when]User is eligible for “{testCD}”=not MyFeature(testCD == “{testCD}”) <span
class=apple-style-span><b><span style='font-weight:bold'>,</span></b></span> $eligible : FeatureEligible(testCD = “{testCD}”)<o:p></o:p></span></font></pre></div>
</div>
</blockquote>
</span>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>and you will not get any overhead at runtime because all the
interpretation happens at compilation, as you says<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>lucaz<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>El 22/10/2009, a las 11:28, Pegram, <st1:City w:st="on"><st1:place
w:st="on">Macon</st1:place></st1:City> escribió:<o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<o:p></o:p></span></font></p>
<span style='orphans: 2;text-align:auto;widows: 2;-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;word-spacing:
0px'>
<div link=blue vlink=purple>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>All,<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>Given the following rule:<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><b><font size=2 color="#960000" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:
bold'>rule</span></font></b><span class=apple-converted-space><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'> </span></font></span><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>"Add ABC123 Feature"</span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:#960000;font-weight:bold'>when</span></font></b><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:#960000;font-weight:bold'>not</span></font></b><span
class=apple-converted-space><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></font></span><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>MyFeature(testCD ==<span
class=apple-converted-space> </span></span></font><font size=2
color=green face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>"ABC123"</span></font><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>)</span></font><font color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:green'>"ABC123_FEATURE"</span></font><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>)</span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:green'>"ABC123"</span></font><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>)</span></font><font color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:#960000;font-weight:bold'>then</span></font></b><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:#960000;font-weight:bold'>insert</span></font></b><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>(</span></font><b><font size=2 color="#960000"
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:#960000;font-weight:bold'>new</span></font></b><span
class=apple-converted-space><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></font></span><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>MyFeature($eligible)); </span></font><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><b><font size=2 color="#960000" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:
bold'>end</span></font></b><font color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>I’d like to create a DSL.
Notice that “testCD” is the same value. <u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>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.<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>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:10.0pt;font-family:"Courier New";color:#960000;font-weight:
bold'>rule</span></font></b><span class=apple-converted-space><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'> </span></font></span><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>"Add ABC123 Feature"</span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:#960000;font-weight:bold'>when</span></font></b><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;
font-family:"Courier New";color:#960000;font-weight:bold'>is</span></font></b><span
class=apple-converted-space><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></font></span><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>eligible<span class=apple-converted-space> </span></span></font><b><font
size=2 color="#960000" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#960000;font-weight:bold'>for</span></font></b><span
class=apple-converted-space><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></font></span><font
size=2 color=green face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:green'>"ABC123"</span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:green'>"ABC123_FEATURE"</span></font><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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:10.0pt;font-family:
"Courier New";color:#960000;font-weight:bold'>then</span></font></b><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>
Add feature </span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><b><font size=2 color="#960000" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:
bold'>end</span></font></b><font color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>Would I need to write the DSL for the
“ABC123” piece like this?<u1:p></u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></p>
</div>
<pre><font size=2 color=black face="Courier New"><span style='font-size:10.0pt;
color:black'>[when]User is eligible for “{testCD}”=not MyFeature(testCD == “{testCD}”) $eligible : FeatureEligible(testCD = “{testCD}”)<u1:p></u1:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'>Or will I always need to create 2 statements? <u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></pre><pre><font
size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'><u1:p> </u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></pre><pre><font size=2
color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'>What are the performance implications of using a DSL? Is there extra overhead at runtime or does all the interpretation occur at rule compilation?<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></pre><pre><font
size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'><u1:p> </u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></pre><pre><font size=2
color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'>Thanks!<u1:p></u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></pre><pre><st1:City w:st="on"><st1:place
w:st="on"><font size=2 color=black face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:black'>Macon<u1:p></u1:p></span></font></st1:place></st1:City><font
color=black><span style='color:black'><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;color:black'><u1:p> </u1:p><o:p></o:p></span></font></pre>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'> <u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=4 color=black face=Helvetica><span
style='font-size:13.5pt;font-family:Helvetica;color:black'>_______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'></span><o:p> </o:p></span></font></p>
</div>
</div>
</body>
</html>