<div>&nbsp;</div>
<div>I&#39;m having problems using DSL&#39;s in the guided editor specifically within the eclipse plugin. The simplest of rules using a DSL report a syntax error in eclipse. However, the same DSL rules (using the same DSL)&nbsp;are validated correctly in the normal drl editor in eclipse, and in the guided editor in the BRMS. Whatever condition I add to a rule in the eclipse guided editor, it always reports a validation error along the lines that the first word in the when part of my DSL rule is an unexpected token. It&#39;s as if the editor is trying to validate the DSL sentence itself, rather than the translation of the DSL sentence. Here&#39;s the simplest example I could think off to reproduce the issue:
</div>
<div>&nbsp;</div>
<div>1. I have a single DSL sentence in my .dsl file as follows:</div>
<div>&nbsp;</div>
<div><font size="2">[condition][]string=String()</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">(I&#39;ve used String as it avoids having to import a model to recreate this issue)</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">2. In eclipse I create a new file called rule.package containing:</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">package com.example</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">import java.lang.String</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">3.<font size="2"> In the guided editor in eclipse I create a new rule by clicking on the add condition on the When part of the rule and choosing the single DSL sentence in the drop-down list displayed by the add condition dialog to get the rule:
</font></font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">When</font></div>
<div><font size="2">&nbsp;&nbsp;&nbsp; string</font></div>
<div><font size="2">Then</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">4. I get an error in the list of error that says that string is an unexpected token. </font><font size="2"></font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">5. I<font size="2"> noticed that in the &quot;Generated DRL (read only)&quot; tab under the guided editor, it also displays the rule in DSL format, and not translated into the expressions on the right-hand-side of the DSL definition. This made me wonder if the eclipse guided editor is
</font> <font size="2">trying to validate the DSL rule without applying the DSL translation. So I deliberately changed my DSL so that the left-hand-side just happened to be a valid technical rule</font></font></div>
<div><font size="2"><font size="2">condition:</font></font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2"><font size="2">[condition][]<font size="2">String()</font>=String()</font></font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">I also changed the rule in the guided editor to</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">
<div><font size="2">When</font></div>
<div><font size="2">&nbsp;&nbsp;&nbsp; String()</font></div>
<div><font size="2">Then</font></div></font></div>
<div><font size="2"></font>&nbsp;</div>
<div>This was validated without any issues, but in theory is exactly the same rule as in point 3 as, apart from keywords, it shouldn&#39;t matter what is on the left-hand -side of the DSL definition.</div>
<div>&nbsp;</div>
<div>As I said at the beginning, the dsl and rule in point 1 and 3 work fine with the normal drl editor in the eclipse plugin, and within the guided editor in the BRMS. </div>
<div>&nbsp;</div>
<div>I also tried adding the expander definition to point to my DSL file in the rule.package file, but that made no difference either.</div>
<div>&nbsp;</div>
<div>Regards</div>
<div>Shahad</div>
<div>&nbsp;</div>
<div><font size="2"></font>&nbsp;</div>