]
Edson Tirelli commented on JBRULES-577:
---------------------------------------
I'm adding the syntax sugar for memberOf and not memberOf.
It is important to note that the requirement for the constraint to be time consistent is
the same.
Please add "contained by" syntax for constraints
------------------------------------------------
Key: JBRULES-577
URL:
http://jira.jboss.com/jira/browse/JBRULES-577
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Drl Parser/Builder
Reporter: Dirk Bergstrom
Assigned To: Edson Tirelli
I'd like to be able to write a constraint to determine if a field's value is a
member of some collection. This is the inverse of the "contains" keyword. The
proposed syntax is:
[bindingVar :] <fieldName> in <someCollection>
(I'm not picky about the keyword, other possibilities are "containedBy" or
"memberOf", but "in" is a single word)
Use case:
I have a container class with a field that exposes a collection of record
numbers. In the working memory, I have a bunch of record objects, and one
container object. I want to write a rule that fires when it encounters a
container that has records matching some criteria:
when
Container( $recordNums : records )
Record( number in $recordNums, otherField == "somevalue" )
then
doStuff();
The current workaround is:
Record( num : number -> ( $recordNums.contains(num) ) )
Which is problematic, as the predicate may not be time-constant.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: