DSL has been designed to cover LHS and RHS. You have two (or, perhaps, three) options:<br><br>1) Define a simple DSL for the RHS, too. It could be as simple as<br>    [then][] print {what}=System.out.println( {what} );<br>
<br>2) Prefix Java code lines with &#39;&gt;&#39; - the expander will simply keep the rest.<br><br>If you can come up with a good use case for applying the DSL expansion only to the LHS and let (or force) the rule author to write the RHS in Java code, you could propose a patch for an expansion option &quot;LHS only&quot;.<br>
<br>-W<br><br><br><br><br><div class="gmail_quote">On 12 December 2011 02:10, Zhao Yi <span dir="ltr">&lt;<a href="mailto:zhaoyi0113@gmail.com">zhaoyi0113@gmail.com</a>&gt;</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">
I want to convert my drl to dsl and dslr. I found that if I choose using dsl,<br>
I couldn&#39;t write java code in rules any more. I must translate everything in<br>
dsl file. Can I combine dsl and drl in dslr file, like below rule. when I am<br>
using dsl, I will get an error: &quot;[10] Unable to expand:<br>
System.out.println(&quot;add caculation start&quot;);&quot;<br>
<br>
rule &quot;add caculation&quot;<br>
        agenda-group &quot;add&quot;<br>
        no-loop true<br>
        dialect &quot;java&quot;<br>
        lock-on-active<br>
        when<br>
                $m: Whether exist event<br>
        then<br>
        System.out.println(&quot;add caculation start&quot;);<br>
        System.out.println(&quot;add caculation end&quot;);<br>
<br>
end<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Can-I-put-java-code-in-dslr-file-tp3578376p3578376.html" target="_blank">http://drools.46999.n3.nabble.com/Can-I-put-java-code-in-dslr-file-tp3578376p3578376.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></span></blockquote></div><br>