MVEL を使用してマルチマップに対してルールを評価するにはどうすればよいのでしょうか。
すなわち:
rule-> "foo" == "200"
foo
コンテキスト内の の可能な値[100, 200, 300]
。
どれが可能な値になるのかわからないので、それらをルールの一部として含めることはできません。
理想的には、次のようなことができるようになりたいです。
List<String> valueList = new ArrayList<String>();
valueList.add("100");
valueList.add("200");
List<String> otherList = new ArrayList<String>();
otherList.add("otherValue");
Map<String, List<String>> context = new HashMap<String, List<String>>();
context.put("foo", valueList);
context.put("other", otherList);
MVEL.eval("foo == 200", context)