<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 02/06/2011 08:14, Wolfgang Laun wrote:
<blockquote
cite="mid:BANLkTinOL2LYuFaoiJCioQBrQ7o_oZtM7g@mail.gmail.com"
type="cite">On 1 June 2011 21:43, Simon Chen <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:simonchennj@gmail.com">simonchennj@gmail.com</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
Hi all,<br>
<br>
I am always confused about what we can do in the "then" part
of the rule.<br>
<br>
In particular, I have problem duplicate a list. For example:<br>
<br>
when:<br>
$b: Book( "james" memberOf authors )<br>
then:<br>
Test fact = new Test();<br>
fact.getList().addAll( $b.authors );<br>
insert(fact);<br>
end<br>
<br>
The error message reads like this:<br>
<br>
BuildError: Unable to build expression for 'consequence':
[Error:<br>
Failed to compile: 2 compilation error(s):<br>
- (1,7) unqualified type in strict mode for: $b<br>
- (1,12) unqualified type in strict mode for: authors]<br>
<br>
What is the right way to do this?<br>
</blockquote>
<div><br>
Granted - the error message is a puzzle in itself, but
basically, the RHS must be written according to Java rules.
Hence, if $b is an object of type Book, $b.authors depends on
the (Java!) visibility of member authors. If it isn't public,
you must use the getter.<br>
</div>
</div>
</blockquote>
I believe he's using "mvel" judging by the error.<br>
<br>
mark<br>
<blockquote
cite="mid:BANLkTinOL2LYuFaoiJCioQBrQ7o_oZtM7g@mail.gmail.com"
type="cite">
<div class="gmail_quote">
<div>
<br>
-W<br>
</div>
<blockquote class="gmail_quote" style="border-left: 1px solid
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
<br>
Thanks.<br>
-Simon<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>