<!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>
public void addRequestObject(String key, Object value){<br>
this.payload.put(key, value);<br>
}<br>
<br>
public Object getRequestObject(String key){<br>
return this.payload.get(key);<br>
}<br>
<br>
<b> public Map<String, Object> getRequestObjects(){<br>
return Collections.unmodifiableMap(this.payload);<br>
}</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<String, Object> 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>
ruleflow-group "Data Prep"<br>
when<br>
$market : Market() from collect( request.requestsObjects.values
)<b> << property values isn't recognized? (expecting type
LEFT_PARENT, mismatched token error) <br>
</b>$series : CandleSeries () from collect (
$market.candleSeries )<b> << candleSeries returns a
CandleSeries[] (expecting type RIGHT_PARENT, mismatched token error)<br>
</b> then <br>
insert ( $series );<br>
insert ( $market );<br>
<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>