You have to write java (or mvel) in the THEN part. Have you tried this?<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">[when] IMRR action requested is in one of {acts} = Action(action in {acts})<br>

[then] permitted =Decisions dec = new Decision(); dec.setDecision(&quot;Granted&quot;)</span></div><div><br></div><div>Best,<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>

- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">On Tue, Aug 3, 2010 at 5:18 PM, bbarani <span dir="ltr">&lt;<a href="mailto:bbarani@gmail.com">bbarani@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Hi,<br>
<br>
I am trying to execute a simple DSL as below. Decisions is the bean class<br>
which I have imported in to Guvnor<br>
<br>
[when] IMRR action requested is in one of {acts} = Action(action in {acts})<br>
[then] permitted =dec:Decisions dec.setDecision(&quot;Granted&quot;)<br>
<br>
Now I want the object for decision to be created and the value set in a<br>
single mapping. I tried the above code and got the error as below.<br>
<br>
 [NamedParameterRule] Unable to build expression for &#39;consequence&#39;:<br>
java.lang.Class cannot be cast to org.mvel2.util.MethodStub &#39;<br>
System.out.println(&quot;Rule Fired From Guvnor&quot;);<br>
                dec: Decisions () dec.setDecision(&quot;Granted&quot;)&#39;<br>
<br>
If I create the object in [when] clause it works fine. Any idea when this<br>
error would pop up?? and how to resolve this?<br>
<br>
Thanks,<br>
Barani<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Not-able-to-create-object-in-then-clause-in-DSL-using-Guvnor-tp1020366p1020366.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Not-able-to-create-object-in-then-clause-in-DSL-using-Guvnor-tp1020366p1020366.html</a><br>


Sent from the Drools - User 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></blockquote></div><br></div>