[rules-users] Problem in DSL with Type constraints

Wolfgang Laun wolfgang.laun at gmail.com
Fri Apr 1 02:15:24 EDT 2011


There is a disclaimer in the Expert documentation that inserting
constraints doesn't work for the more "exotic" forms. Basically, a
hyphenated line is inserted into the last line where there are
parentheses. This is done using very simple regex matching, which is
bound to fail for anything more complex than a simple pattern.
-W

2011/3/31 Leonardo Gomes <leonardo.f.gomes at gmail.com>:
> Small correction.
>
> This: [condition][RestrictedLocation]- test=$test : test
>
> should actually be:
>>
>> [condition][RestrictedLocation]- test=$test == test
>
> but I still have the problem :)
>
>
> On Thu, Mar 31, 2011 at 6:02 PM, Leonardo Gomes <leonardo.f.gomes at gmail.com>
> wrote:
>>
>> Hi,
>>
>> Given the following DSL definition:
>>
>>> [condition][RestrictedLocation]Is restricted by = ArrayList(size >= 1)
>>> from collect(RestrictedLocation() from $restrictedLocationList)
>>> [condition][RestrictedLocation]- test=$test : test
>>
>> and the following rule:
>>
>>> rule "Test"
>>> when
>>>     Is restricted by
>>>         - test
>>> then
>>> ...
>>> end
>>
>> I'm getting the following DRL:
>>
>>
>>> rule "Test"
>>> when
>>>     ArrayList(size >= 1) from collect( RestrictedLocation(, $test : test
>>> ) from $restrictedLocationList)
>>> then
>>> ...
>>> end
>>
>> Note the comma before the restriction: ** (, **
>>
>> Anyone would know how to fix that?
>>
>> Thanks a lot,
>> Leonardo.
>>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>




More information about the rules-users mailing list