Hi,
The following rule is working well.
rule
"foo"
when
Message(_initialStubRate ==
"1.0") ||
Message(_initialStubRate ==
"2.0") || (
Message(_initialStubRate >=
"4.0") &&
Message(_initialStubRate <=
"44.0")
) ||
Message(_initialStubRate ==
"52.0")
then
System.out.println("foo");
End
To make this logic more amenable to being generically rendered via .DRT template, I want to simplify this rule . Consider the following re-factoring.
rule
"bar"
when
Message(_initialStubRate
in (
'1.0',"2.0",
"4.0","5.0","6.0","7.0","8.0","9.0","10.0",
"11.0",
"12.0","13.0",
"14.0","15.0","16.0","17.0","18.0","19.0","20.0",
"21.0",
"22.0","23.0",
"24.0","25.0","26.0","27.0","28.0","29.0","30.0",
"31.0",
"32.0","33.0",
"34.0","35.0","36.0","37.0","38.0","39.0","40.0",
"41.0",
"42.0","43.0",
"44.0",
"52.0")
)
then
System.out.println("bar");
end
This re-facotred rule produces a syntax error in Eclipse’s .DRL view.
BuildError: Unable to Analyse Expression
_initialStubRate == "1.0" || _initialStubRate == "2.0" || _initialStubRate == "4.0" || _initialStubRate == "5.0" || _initialStubRate == "6.0" || _initialStubRate == "7.0" || _initialStubRate == "8.0" || _initialStubRate == "9.0" || _initialStubRate == "10.0"
|| _initialStubRate == "11.0" || _initialStubRate == "12.0" || _initialStubRate == "13.0" || _initialStubRate == "14.0" || _initialStubRate == "15.0" || _initialStubRate == "16.0" || _initialStubRate == "17.0" || _initialStubRate == "18.0" || _initialStubRate
== "19.0" || _initialStubRate == "20.0" || _initialStubRate == "21.0" || _initialStubRate == "22.0" || _initialStubRate == "23.0" || _initialStubRate == "24.0" || _initialStubRate == "25.0" || _initialStubRate == "26.0" || _initialStubRate == "27.0" || _initialStubRate
== "28.0" || _initialStubRate == "29.0" || _initialStubRate == "30.0" || _initialStubRate == "31.0" || _initialStubRate == "32.0" || _initialStubRate == "33.0" || _initialStubRate == "34.0" || _initialStubRate == "35.0" || _initialStubRate == "36.0" || _initialStubRate
== "37.0" || _initialStubRate == "38.0" || _initialStubRate == "39.0" || _initialStubRate == "40.0" || _initialStubRate == "41.0" || _initialStubRate == "42.0" || _initialStubRate == "43.0" || _initialStubRate == "44.0" || _initialStubRate == "52.0":
[Error: no such identifier: _initialStubRate]
[Near : {... _initialStubRate == "1.0" || _ ....}]
^
[Line: 1, Column: 1]
What could be wrong?
Ben D Cotton III
Morgan Stanley & Co.
OTC Derivatives Clearing Technology
1221 AOTA Rockefeller Ctr - Flr 27
New York, NY 10020
(212)762.9094
ben.cotton@ms.com