Array types are not supported for the fields of types declared in DRL.<br>A java.util.ArrayList (no generic parameters) should work.<br><br>-W<br><br><div class="gmail_quote">On 26 April 2011 23:59, fulton <span dir="ltr"><<a href="mailto:fulton.gee@lmco.com">fulton.gee@lmco.com</a>></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 am currently using Drools Server to accept JSON-formatted insertion<br>
messages from a PHP application. Within the DRL file, I am currently<br>
declaring the insertion object (let's use Person, for example) using<br>
"Declare", e.g.,<br>
<br>
declare Person<br>
name: String<br>
address: AddressType<br>
end<br>
<br>
declare AddressType<br>
...<br>
end<br>
<br>
My question is, how do you declare an array object (e.g., "Hobbies") that<br>
can be nested within Person. I have scanned the Internet (once again!) for<br>
longer than I care to admit and have found no examples for this simple<br>
usage. I have unsuccessfully tried multiple variations in defining an<br>
array, but have given up. My current intention is to avoid using externally<br>
defined Java, if possible, and I would like to be able to define the<br>
insertion object within the DRL to enable quick changes in the incoming JSON<br>
format, if necessary (I know this might not be "best practice"!). Could<br>
someone please provide me with a quick example.<br>
<br>
Thanks! Fulton<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-declare-an-array-attribute-within-an-object-in-a-DRL-file-tp2867666p2867666.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-declare-an-array-attribute-within-an-object-in-a-DRL-file-tp2867666p2867666.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></blockquote></div><br>