On 3 January 2011 16:18, Edson Tirelli <span dir="ltr">&lt;<a href="mailto:ed.tirelli@gmail.com">ed.tirelli@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
   Hi Wolfgang,<br>
<br>
   It looks very good. My only concern is how it affects the eclipse<br>
plugin, specially the line breaks. I am guessing we will have to<br>
change it to support that?<br>
<br></blockquote><div>Good catch. I would not expect the Eclipse editor to keep the line breaks, but it seems<br>that it fails to continue reading entries after the first split entry. :-{<br>Can this be fixed without busting a vein? Given that &quot;Language Expression&quot; and &quot;Rule<br>
Language Mapping&quot; could both be multiline, the widget structure in the DSL Editor<br>would need some rework. But it sure would benefit, too.<br><br>(I can&#39;t imagine how anybody could edit a complex DSL with this editor. Even minor<br>
changes in the DSL require you to reorder the entries, and I don&#39;t see how you can<br>do this in the Eclipse editor. And there&#39;s no &quot;find&quot;, no &quot;find/replace&quot;, etc... This<br>editor just isn&#39;t going to clinch it.)<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;">
   Also, does any of these changes break backward compatibility?<br></blockquote><div><br>None I&#39;m aware of.  <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;">

   In case it doesn&#39;t, my vote is to apply all the changes listed.<br></blockquote><div><br>OK, which means I&#39;ll go ahead and fix the Expert doc.<br>-W</div><div><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;">

   Edson<br>
<br>
<br>
2011/1/3 Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Probably sent not at the best of times, this didn&#39;t get a peep from anyone.<br>
&gt; Please do comment, for the reasons stated below.<br>
&gt; -W<br>
&gt;<br>
&gt; On 24 December 2010 11:23, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; This is a summary of the currently implemented new features for the DSL<br>
&gt;&gt; expansion. I&#39;ll have to add tests and documentation, but before doing so,<br>
&gt;&gt; I&#39;d like to learn whether there are any objections (resulting in the<br>
&gt;&gt; removal) or suggestions for improvement. Myself, I&#39;m not sure about one or<br>
&gt;&gt; two items which I&#39;ve marked with &quot;(?)&quot;. Also, there&#39;s a couple of items<br>
&gt;&gt; which might gain from easy-to-implement additions, see &quot;Votes, please&quot;. An<br>
&gt;&gt; example showing most of the new options is given below.<br>
&gt;&gt;<br>
&gt;&gt; The right hand side of entry definitions can be empty. (Useful for<br>
&gt;&gt; deleting &quot;filler&quot; phrases.)<br>
&gt;&gt; Long entry lines can be split without the need of escaping EOL:<br>
&gt;&gt;<br>
&gt;&gt; Any line beginning with # or // starts a DSL comment and is not passed to<br>
&gt;&gt; the DSL parser.<br>
&gt;&gt; Any line beginning with &#39;[&#39; starts a new entry.<br>
&gt;&gt; All other lines are appended to the preceding line, with a space replacing<br>
&gt;&gt; EOL.<br>
&gt;&gt; Empty lines are inserted to maintain original line numbers, and line and<br>
&gt;&gt; column numbers in error messages from the parser are recalculated to reflect<br>
&gt;&gt; the user view of the DSL text.<br>
&gt;&gt;<br>
&gt;&gt; The special comment introduction &quot;#/&quot; is used to mark a line containing<br>
&gt;&gt; debug options. Currently recognized keywords are:<br>
&gt;&gt;<br>
&gt;&gt; result - dumps the resulting DRL<br>
&gt;&gt; steps - shows all expansion operations in conditions and consequences<br>
&gt;&gt; keyword, when, then - display the corresponding entry definitions<br>
&gt;&gt; usage - shows how often an entry was actually used in an expansion<br>
&gt;&gt;<br>
&gt;&gt; Variable substitution uses the definition of that variable seen last in<br>
&gt;&gt; the current when or then part expansion. not just from the current line.<br>
&gt;&gt; (But this probably should keep variables from the when part for the<br>
&gt;&gt; following then part. Votes, please.)<br>
&gt;&gt; The value used in a variable substitution can be modified on the fly by<br>
&gt;&gt; adding one of the modifiers after and &#39;!&#39; in the variable reference.<br>
&gt;&gt; Currently recognized modifiers are:<br>
&gt;&gt;<br>
&gt;&gt; uc, lc - convert all letters to upper case or lower case, respectively<br>
&gt;&gt; ucfirst - convert the first letter to upper case, and all other letters to<br>
&gt;&gt; lower case<br>
&gt;&gt; num - extract all digits and a &#39;-&#39; preceding the first digit and insert<br>
&gt;&gt; the numeric value; a &#39;.&#39; or &#39;,&#39; two digits from the right is retained as a<br>
&gt;&gt; decimal point, which is useful for monetary quantitites. (?)<br>
&gt;&gt;<br>
&gt;&gt; Another modification of the value used for substituting the reference is<br>
&gt;&gt; by providing a &quot;multiple choice&quot; after an &#39;!&#39;, consisting of strings<br>
&gt;&gt; separated alternatively by &#39;?&#39; and &#39;/&#39;: If the string extracted from the<br>
&gt;&gt; DSLR line matches the string before a &#39;?&#39;, the string following it is used<br>
&gt;&gt; for substitution; otherwise test the next choice. (?)<br>
&gt;&gt; A DSL value starting with a hyphen (&#39;-&#39;) can also be used in a consequence<br>
&gt;&gt; to add another setter expression into a preceding &quot;modify(x){}&quot;. (Should<br>
&gt;&gt; probably be extended to be able to handle the insertion of another parameter<br>
&gt;&gt; to any preceding method call and, as a special, but useful, case the<br>
&gt;&gt; concatenation to a preceding x.println() or x.print() call. Votes, please.)<br>
&gt;&gt;<br>
&gt;&gt; DSL:<br>
&gt;&gt; [when][][Tt]here is an?=<br>
&gt;&gt; [when][]{entity} called {x}=<br>
&gt;&gt;         ${entity!lc}: {entity!ucfirst}( $name:<br>
&gt;&gt; name==&quot;{x!M?Mark/E?Edson/G?Geoffrey/unknown}&quot;)<br>
&gt;&gt; [when][]and no other with the same {attr}=not {entity!ucfirst}( {attr} ==<br>
&gt;&gt; ${attr} )<br>
&gt;&gt; [then][]change person=modify($person)\{\}<br>
&gt;&gt; [then][]- set {attr} to {value} = set{attr!ucfirst}( {value!num} )<br>
&gt;&gt;<br>
&gt;&gt; DSLR:<br>
&gt;&gt; rule &quot;Rule 1&quot;<br>
&gt;&gt; when<br>
&gt;&gt;     There is a PERSON called M<br>
&gt;&gt;     and no other with the same name<br>
&gt;&gt; then<br>
&gt;&gt;     change person<br>
&gt;&gt;     - set salary to US$9,999.99<br>
&gt;&gt;     - set rank to &quot;colonel&quot;<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt; DRL:<br>
&gt;&gt;    8  rule &quot;Rule 1&quot;<br>
&gt;&gt;    9  when<br>
&gt;&gt;   10  $person: Person( $name: name==&quot;Mark&quot;)<br>
&gt;&gt;   11  not Person( name == $name )<br>
&gt;&gt;   12  then<br>
&gt;&gt;   13  modify($person){ setSalary( 9999.99 ), setRank( &quot;colonel&quot; ) }<br>
&gt;&gt;   14  end<br>
&gt;&gt;<br>
&gt;&gt; Cheers<br>
&gt;&gt; Wolfgang<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; rules-dev mailing list<br>
&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
  Edson Tirelli<br>
  JBoss Drools Core Development<br>
  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br>