<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi All, <br>
<br>
I am trying to figure out how to do a pattern match against a
collection and an array. Here is one of the domain model classes:<br>
<br>
<small><font face="Courier New, Courier, monospace">public class
DecisionRequest extends Payload {<br>
<br>
&nbsp;&nbsp;&nbsp; public void addRequestObject(String key, Object value){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this.payload.put(key, value);<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; public Object getRequestObject(String key){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return this.payload.get(key);<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; <br>
<b>&nbsp;&nbsp;&nbsp; public Map&lt;String, Object&gt; getRequestObjects(){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return Collections.unmodifiableMap(this.payload);<br>
&nbsp;&nbsp;&nbsp; }</b><br>
<br>
}<br>
</font></small><br>
Here is my rule code for now trying to access the values in the Map
returned by <small><font face="Courier New, Courier, monospace"><b>public
Map&lt;String, Object&gt; getRequestObjects(). As you can see,
getRequestObjects does not have a setter so it isn't recognized a a
javabean property. I have tried eval etc...</b></font></small><br>
<br>
<small><font face="Courier New, Courier, monospace">global
DecisionRequest request;<br>
global DecisionResponse response;<br>
<br>
rule "Explode Globals"<br>
&nbsp;&nbsp;&nbsp; ruleflow-group "Data Prep"<br>
&nbsp;&nbsp;&nbsp; when<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $market : Market() from collect( request.requestsObjects.values
)<b> &lt;&lt; property values isn't recognized? (expecting type
LEFT_PARENT, mismatched token error) <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </b>$series : CandleSeries () from collect (
$market.candleSeries )<b> &lt;&lt; candleSeries returns a
CandleSeries[] (expecting type RIGHT_PARENT, mismatched token error)<br>
&nbsp;&nbsp;</b>&nbsp; then <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; insert ( $series );<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; insert ( $market );<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
end<br>
<br>
What would be the right way to pattern match against these values?<br>
<br>
Thanks for any help<br>
HC<br>
</font></small>
</body>
</html>