[rules-users] Fwd: assertion of object

Mark Proctor mproctor at codehaus.org
Sun Sep 23 18:55:27 EDT 2007


Have you thought of inserting your data, rather than setting it as a 
global? It looks like statoNodo should be inserted and not a global.

Also each rule will still use the same instance, if you need another 
instance why not clone the object in the first line of the consequence?

Mark
Raffaele Viola wrote:
> when a condition match call statoNodo.variabiliInOR(....) that add in 
> to the list the first arg
>
> the action function add the list in the azioe with the method 
> azione.setAzione("pio",lista);
>
> My list result is :
> Pisa
> Cagliari
> Pisa
> Cagliari
>
> package org.drools.examples.decisiontable;
> #generated from Decision Table
> import com.RuleEngine.ControlloreNodo.*;
> import com.RuleEngine.ControlloreNodo.OggettiControllo.Azione;
> import com.RuleEngine.ControlloreNodo.OggettiStato.StatoNodo;
> import java.util.ArrayList;
>
> global StatoNodo statoNodo;
> global Azione azione;
> global ArrayList lista;
>
> #From row number: 13
> rule "Pricing bracket_13"
>    
>     salience 1
>     when
>         eval(statoNodo.variabiliInOR("Pisa",lista,1))
>     then
>         azione.setAzione("ciao",lista);
> end
>
> #From row number: 14
> rule "Pricing bracket_14"
>    
>     salience 3
>     when
>         eval(statoNodo.variabiliInOR("Cagliari,Pisa",lista,1))
>     then
>         azione.setAzione("pio",lista);
> end
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070923/5b71bab9/attachment.html 


More information about the rules-users mailing list