<br> No good. This is a bug. May I ask you please to open a JIRA for it? I will fix asap.<br><br> Meanwhile, as a workaround, add a space before the retract call:<br><br><span class="q"><font face="Courier New" size="2">
[consequence][]Manually release the
Order=setManualRelease(drools.getRule().getName());</font><font color="red" face="Courier New" size="2"><b><i> retract(theOrder);</i></b></font><font size="3">
</font></span><br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/9/13, <a href="mailto:Christopher.Mathrusse@sybase.com">Christopher.Mathrusse@sybase.com</a> <<a href="mailto:Christopher.Mathrusse@sybase.com">
Christopher.Mathrusse@sybase.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><font face="sans-serif" size="2">I did make certain that my rule file
had the extension of .dslr. I discovered this early on and realized the
importance when I renamed it. Of course I renamed it back to .dslr once
I saw the difference.</font>
<br>
<br><font face="sans-serif" size="2">The DRL preview of my rule is
as follows:</font>
<span class="q"><br>
<br><font color="#a00000" face="Courier New" size="2"><b>rule</b></font><font face="Courier New" size="2">
</font><font color="#008000" face="Courier New" size="2">"Maximum Order
Amount Exceeded"</font>
<br><font color="#a00000" face="Courier New" size="2"><b>salience</b></font><font face="Courier New" size="2">
9800</font>
<br><font face="Courier New" size="2"> </font><font color="#a00000" face="Courier New" size="2"><b>when</b></font>
<br></span><font face="Courier New" size="2">
theOrder : Order( amount >= 100000 )</font>
<br><font face="Courier New" size="2"> </font><font color="#a00000" face="Courier New" size="2"><b>then</b></font><font face="Courier New" size="2">
</font>
<br><font face="Courier New" size="2"> theOrder.setManualRelease(drools.getRule().getName());</font><font color="#a00000" face="Courier New" size="2"><b>retract</b></font><font face="Courier New" size="2">(theOrder);
</font>
<br><font face="Courier New" size="2">
</font>
<br><font color="#a00000" face="Courier New" size="2"><b>end</b></font>
<br>
<br>
<br><font face="sans-serif" size="2">Thanks once again for all the help...</font>
<br>
<br>
<br>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td width="40%"><span class="q"><font face="sans-serif" size="1"><b>"Edson Tirelli"
<<a href="mailto:tirelli@post.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tirelli@post.com</a>></b> </font>
<br><font face="sans-serif" size="1">Sent by: <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users-bounces@lists.jboss.org</a></font>
</span><p><font face="sans-serif" size="1">09/13/2007 04:39 AM</font>
</p><div><span class="e" id="q_114ffba7ccd71757_5"><table border="1">
<tbody><tr valign="top">
<td bgcolor="white">
<div align="center"><font face="sans-serif" size="1">Please respond to<br>
Rules Users List <<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a>></font></div></td></tr></tbody></table>
<br>
</span></div></td><td width="59%">
<table width="100%">
<tbody><tr>
<td>
<div align="right"><font face="sans-serif" size="1">To</font></div>
</td><td valign="top"><font face="sans-serif" size="1">"Rules Users List"
<<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a>></font>
</td></tr><tr>
<td>
<div align="right"><font face="sans-serif" size="1">cc</font></div>
</td><td valign="top">
<br></td></tr><tr>
<td>
<div align="right"><font face="sans-serif" size="1">Subject</font></div>
</td><td valign="top"><font face="sans-serif" size="1">Re: [rules-users] Assistance
with DSL syntax</font></td></tr></tbody></table>
<br>
<table>
<tbody><tr valign="top">
<td>
<br></td><td><br></td></tr></tbody></table>
<br></td></tr></tbody></table><div><span class="e" id="q_114ffba7ccd71757_7">
<br>
<br>
<br><font size="3"><br>
No, you need to identify which object are you trying to retract,
since you may have multiple facts constrained in the LHS.<br>
<br>
Regarding your problem, make sure your rules file has the
extension ".dslr" so that eclipse selects the correct editor
when opening the file. Then click in the DRL preview in the editor bottom
tab. Can you please show me the result of the DRL preview? <br>
<br>
Thanks<br>
Edson<br>
</font>
<br><font size="3">2007/9/12, </font><a href="mailto:Christopher.Mathrusse@sybase.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>Christopher.Mathrusse@sybase.com
</u></font></a><font size="3">
<</font><a href="mailto:Christopher.Mathrusse@sybase.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>
Christopher.Mathrusse@sybase.com</u></font></a><font size="3">>:</font>
<br><font face="sans-serif" size="2"><br>
I was just looking for a more "short hand" syntax, one where
I would not need to declare <i>"theOrder".</i></font><font size="3">
<br>
</font><font face="sans-serif" size="2"><br>
On the same subject though, I compiled my rules with the DRL/DSL editors
in Eclipse (very nice by the way) and I am getting a compilation error
being caused by my DSL entry:</font><font size="3"> <br>
</font><font face="Courier New" size="2"><br>
[consequence][]Manually release the Order=setManualRelease(drools.getRule().getName());</font><font color="red" face="Courier New" size="2"><b><i>retract(theOrder);</i></b></font><font size="3">
<br>
<br>
</font><font face="sans-serif" size="2"><br>
It seems that there is an issue with the </font><font color="red" face="Courier New" size="2"><b><i>retract(theOrder);</i></b></font><font face="sans-serif" size="2">statement.</font><font size="3">
<br>
</font><font color="red" face="sans-serif" size="2"><i><br>
The method retract(Order) is undefined for the type Rule_Maximum_Order_Amount_Exceeded_0
</i></font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
Might you have any idea as to why this would be occurring or exactly what
the message is meaning?</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
Thanks for the help...</font><font size="3"> </font><font face="sans-serif" size="2"><br>
</font><font size="3"><br>
<br>
<br>
</font>
<table width="100%">
<tbody><tr valign="top">
<td width="45%"><font face="sans-serif" size="1"><b>"Edson Tirelli"
<</b></font><a href="mailto:tirelli@post.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" face="sans-serif" size="1"><b><u>tirelli@post.com</u></b></font></a><font face="sans-serif" size="1">
<b>></b>
<br>
Sent by: </font><a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" face="sans-serif" size="1"><u>rules-users-bounces@lists.jboss.org
</u></font></a><font size="3">
</font>
<p><font face="sans-serif" size="1">09/12/2007 05:55 PM</font><font size="3">
</font>
<br>
<table border="4" width="100%">
<tbody><tr valign="top">
<td bgcolor="white" width="100%">
<div align="center"><font face="sans-serif" size="1">Please respond to<br>
Rules Users List <</font><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" face="sans-serif" size="1"><u>rules-users@lists.jboss.org
</u></font></a><font face="sans-serif" size="1">></font></div></td></tr></tbody></table>
</p><p>
</p></td><td width="54%">
<br>
<table width="100%">
<tbody><tr>
<td width="14%">
<div align="right"><font face="sans-serif" size="1">To</font></div>
</td><td valign="top" width="85%"><font face="sans-serif" size="1">"Rules Users
List" <</font><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" face="sans-serif" size="1"><u>rules-users@lists.jboss.org</u></font>
</a><font face="sans-serif" size="1">></font><font size="3">
</font>
</td></tr><tr>
<td>
<div align="right"><font face="sans-serif" size="1">cc</font></div>
</td><td valign="top">
<br></td></tr><tr>
<td>
<div align="right"><font face="sans-serif" size="1">Subject</font></div>
</td><td valign="top"><font face="sans-serif" size="1">Re: [rules-users] Assistance
with DSL syntax</font></td></tr></tbody></table>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td width="49%">
<br></td><td width="50%"><br></td></tr></tbody></table>
<br></td></tr></tbody></table>
<br><font size="3"><br>
<br>
<br>
<br>
Yes, that is correct. <br>
Why do you mean by a "cleaner" way?<br>
<br>
[]s<br>
Edson<br>
<br>
2007/9/12, </font><a href="mailto:Christopher.Mathrusse@sybase.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>Christopher.Mathrusse@sybase.com
</u></font></a><font size="3"><</font><a href="mailto:Christopher.Mathrusse@sybase.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>Christopher.Mathrusse@sybase.com
</u></font></a><font size="3">>: </font><font face="sans-serif" size="2"><br>
<br>
I'm using a DSL with my DRL file and I've read through the documentation
but I've gotten hung-up on the syntax. Below is a rule from my DRL and
the expansion in my DSL.</font><font size="3"> </font><font face="sans-serif" size="2"><br>
<br>
My rule in the DRL:</font><font size="3"> </font><font color="#a00000" face="Courier New" size="2"><b><br>
rule</b></font><font face="Courier New" size="2"> </font><font color="#008000" face="Courier New" size="2">"Maximum
Order Amount Exceeded"</font><font size="3"> </font><font color="#a00000" face="Courier New" size="2"><b><br>
salience</b></font><font face="Courier New" size="2"> 9800</font><font size="3">
</font><font face="Courier New" size="2"><br>
</font><font color="#a00000" face="Courier New" size="2"><b>when</b></font><font size="3">
</font><font face="Courier New" size="2"><br>
There </font><font color="#a00000" face="Courier New" size="2"><b>is</b></font><font face="Courier New" size="2">
an Order </font><font color="#a00000" face="Courier New" size="2"><b>with</b></font><font size="3">
</font><font face="Courier New" size="2"><br>
- an amount
that exceeds 100000 </font><font size="3"> </font><font face="Courier New" size="2"><br>
</font><font color="#a00000" face="Courier New" size="2"><b>then</b></font><font face="Courier New" size="2">
<br>
Manually release the
Order</font><font size="3"> </font><font face="Courier New" size="2"><br>
</font><font color="#a00000" face="Courier New" size="2"><b><br>
end</b></font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
<br>
My DSL:</font><font size="3"> </font><font face="Courier New" size="2"><br>
[condition][]There is an Order with=Order()</font><font size="3"> </font><font face="Courier New" size="2"><br>
[condition][]- an amount that exceeds {number}=amount >= {number}</font><font size="3">
</font><font face="Courier New" size="2"><br>
[consequence][]Manually release the Order=setManualRelease(drools.getRule().getName());</font><font size="3">
</font><font face="sans-serif" size="2"><br>
<br>
What I would like to do is add to my consequence the following in red:</font><font size="3">
</font><font face="Courier New" size="2"><br>
[consequence][]Manually release the Order=setManualRelease(drools.getRule().getName());</font><font color="red" face="Courier New" size="2"><b><i>retract(theOrder);</i></b></font><font size="3">
<br>
</font><font face="sans-serif" size="2"><br>
<br>
I know that I would need to modify my condition statement to be able to
use the variable <b><i>theOrder</i></b> in my call to retract:</font><font size="3">
</font><font face="Courier New" size="2"><br>
[condition][]There is an Order with=</font><font color="red" face="Courier New" size="2"><b><i>theOrder
</i></b></font><font face="Courier New" size="2">: Order()</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><br>
<br>
but is there a cleaner way to achieve this?</font><font size="3"> <br>
<br>
_______________________________________________<br>
rules-users mailing list</font><font color="blue" size="3"><u><br>
</u></font><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>rules-users@lists.jboss.org</u></font></a><font color="blue" size="3">
<u><br>
</u></font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>https://lists.jboss.org/mailman/listinfo/rules-users
</u></font></a><font size="3"><br>
</font>
<br><font size="3"><br>
<br>
<br>
-- <br>
Edson Tirelli<br>
Software Engineer - JBoss Rules Core Developer<br>
Office: +55 11 3529-6000<br>
Mobile: +55 11 9287-5646 </font>
<br><font size="3"> JBoss, a division of Red Hat @ </font><a href="http://www.jboss.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>www.jboss.com</u></font></a>
<font size="3">
</font><font size="2"><tt>_______________________________________________<br>
rules-users mailing list</tt></font><font color="blue" size="2"><tt><u><br>
</u></tt></font><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="2"><tt><u>rules-users@lists.jboss.org</u></tt></font></a><font color="blue" size="2">
<tt><u><br>
</u></tt></font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="2"><tt><u>https://lists.jboss.org/mailman/listinfo/rules-users
</u></tt></font></a><font size="3"><br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list</font><font color="blue" size="3"><u><br>
</u></font><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>rules-users@lists.jboss.org</u></font></a><font color="blue" size="3">
<u><br>
</u></font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>https://lists.jboss.org/mailman/listinfo/rules-users
</u></font></a><font size="3"><br>
</font>
<br></span></div><font size="3"></font><div><span class="e" id="q_114ffba7ccd71757_9"><font size="3"><br>
<br>
<br>
-- <br>
Edson Tirelli<br>
Software Engineer - JBoss Rules Core Developer<br>
Office: +55 11 3529-6000<br>
Mobile: +55 11 9287-5646 <br></font></span></div>
<font size="3"> JBoss, a division of Red Hat @ </font><a href="http://www.jboss.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><font color="blue" size="3"><u>www.jboss.com</u></font></a><font size="3">
</font><font size="2"><tt>_______________________________________________<span class="q"><br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</span></tt></font>
<br>
<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646
<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>