Do you mean you cannot insert NameValue facts into working memory?
 
If this is the case, then you might have to use eval or MVEL dialect. Based
upon your model below I assumed you could insert NameValues:-
 
LineItem-->getParameters() returns Parameter[]

Parameter->getNameValueArray() return NameValue[]

Each NameValue has name and value attribute


  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 03 October 2007 13:23
To: Rules Users List
Subject: RE: [rules-users] Arrays help



Yes that's the simple one, but I can't send the NameValue, I will send only
the LineItem

 


  _____  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anstis, Michael
(M.)
Sent: Wednesday, October 03, 2007 5:36 PM
To: Rules Users List
Subject: RE: [rules-users] Arrays help

 

I forgot to mention, this assumes you want to maintain the relationships. If
you're not interested in these but merely want to process all NameValue
objects then a simple rule works fine:-

 

rule "don't worry about preserving relationships"

    when

        $n : NameValue ( )

    then

        ....

end

 

Simply assert all NameValue objects.

 


  _____  


From: Anstis, Michael (M.) 
Sent: 03 October 2007 12:48
To: 'Rules Users List'
Subject: RE: [rules-users] Arrays help

There are a number of ways...

 

Java dialect [requires LineItem, Parameter and NameValue to be asserted into
working memory]

 

rule "a - requires object model change for parent property"

    when

        $l : LineItem( )

        $p : Parameter ( parent == $l )

        $n : NameValue( parent == $p )

    then

        ...

end

 

rule "b"

    when

        $n : NameValue( )

        $p : Parameter ( nameValues contains $n )

        $l : LineItem( parameters contains $p )

    then

        ...

end

 

MVEL dialect

 

rule "c"

    dialect mvel

    when

        $n :
my-mvel-syntax-lets-me-down-but-I-know-you-can-traverse-object-graphs-using-
it

    then

        ...

end

 

 


  _____  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 03 October 2007 12:37
To: Rules Users List
Subject: [rules-users] Arrays help

Hi All,

  I have a object graph like this

LineItem has array of Parameter and each Parameter has array of  NameValue
and Namevalue object has name and value.

Now I have LineItem object in working memory, how to test the value of each
value of NameValue object.

 

LineItem-->getParameters() returns Parameter[]

Parameter->getNameValueArray() return NameValue[]

Each NameValue has name and value attribute

Any help?

 

Ta

Sougata


This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message.

 

This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message.

        

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to