<br> Hi Matt,<br><br> If I remember correctly, you need to use \\n to break lines. Also, I think this should work:<br><br>
rd: RuleData(offerId == "{offer}", uc : userContext) not ( Account(where {constraints}) from uc.accounts)<br><br> If it is not working, maybe you can open a jira for it? Meanwhile, as a work around try adding an "and" there:<br>
<br>
rd: RuleData(offerId == "{offer}", uc : userContext) and not ( Account(where {constraints}) from uc.accounts)<br><br> AND is supposed to be implicit, but making it explicit should create no problems.<br><br>
[]s<br> Edson<br><br><div class="gmail_quote">2008/6/12 Matt Geis <<a href="mailto:mgeis@yahoo.com">mgeis@yahoo.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
I'm having a really strange scenario. I have a DSL entry that I need to expand onto two lines. When I write it as plain DRL, on a single line, the rule fails. When I separate it into two lines, it passes. The problem is that I'm having issues getting my DSL to insert a newline char into the drl it generates and split my resulting rule into two constraints.<br>
<br>
Here's what I want to do... (assume the '\n actually works)<br>
<br>
[condition][]offer with code "{offer}" and no accounts present where {constraints}=rd: RuleData(offerId == "{offer}", uc : userContext) \n not ( Account(where {constraints}) from uc.accounts)<br>
<br>
if you put the value into a DRL rule like this, it works:<br>
rd: RuleData(offerId == "{offer}", uc : userContext)<br>
not ( Account(where {constraints}) from uc.accounts)<br>
<br>
<br>
put it in like this... it fails<br>
rd: RuleData(offerId == "{offer}", uc : userContext) not ( Account(where {constraints}) from uc.accounts)<br>
<br>
<br>
I know that in a regex, the backslash is special, just as it is in replacement strings in Matcher.replaceAll(). What I can't figure out is how to split that line. I've tried 1, 2, 3, 4... up to 8 backslashes, and nothing works. I either get an assertion failed at the end of my test, or I get "unrecognized token" on the \ or the n .<br>
<br>
Can someone point me in the right direction? Or, just tell me how to make the rule work all one one line!<br>
<br>
Thanks in advance,<br>
Matt<br>
<br>
<br>
<br>
<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>
</blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<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>