[rules-users] newbie, Expressing a rule in different ways

rouvas at di.uoa.gr rouvas at di.uoa.gr
Sun Jan 31 07:30:44 EST 2010


Wolfgang Laun wrote:
> 2010/1/31 <rouvas at di.uoa.gr>
>
>> Wolfang,
>>
>> thank you very much for your reply.
>>
>> Your assumptions are correct and your explanation makes sense.
>> Unfortunately, I cannot understand why this happens.
>>
>>
> It may very well be an implementation restriction; whether it can be
> removed easily I'm not prepared to say. (@Edson?)

Fair enough.

>
>
>> The IUEcop has the following structure (in rough terms)
>>  IUEcop
>>   +- (various objects as properties)
>>   +- list of traderAuthorisation
>>   +- list of warehouseAuthorisation
>>   +- list of temporaryAuthorisation
>>
>>
>> A more general issue with my understanding has to do with handling of
>> deeply nested objects. In my case, the "traderAuthorisation" object has
>> itself another set of object properties and lists that I would like to
>> refer to in my rules. Are you aware of any relevant documentation?
>>
>
> Nested objects that are not facts but shared between fact objects should
> not
> cause any problems; especially the MVEL syntax is provided for easy
> access to properties of a property.
>
> If such an object is shared among several fact objects, you'll have a
> problem whenever such a shared object is updated by code on a RHS:
> To trigger reevaluation of rules, the engine would have to be
> notified about all objects referring to the shared object as being
> updated.

Although in my case the objects are not shared, I understand the issues
involved.

>
> Lists is adding another twist, even though the "from" CE appears
> to simplify handling of Iterable properties and works well enough.
> The recommended (see Drools Expert, section 4.8.2.8, Conditional
> Element "from") alternative is to add List elements as WM elements
> of their own,

I was hoping to avoid this.
This is how I was doing things in Prolog, but I was hoping that
object-orientation would help tackling this issue.

Anyway, thanks a lot for your help.

-Stathis

> even though this may require the addition of linking
> information to the list elements. (In your case: a TraderAuthorisation
> would have to contain a reference to the IUEcop object it belongs
> to.) You'll have to balance the additionally required coding effort
> for this against the greater complexity of rules using "from".
>
> -W
>
>
>> Thank you very much for your time,
>> -Stathis
>>
>>
>





More information about the rules-users mailing list