[rules-users] Guvnor - will not let you add elements to List in fact object

Bengt-Erik Fröberg bengt-erik.froberg at databyran.se
Mon May 21 09:43:33 EDT 2012


Hi

We use Guvnor 5.3.0 on Jboss 4.2.2

Regards

benfro

From: Nicolas Héron [mailto:nicolas.heron.java at gmail.com]
Sent: den 21 maj 2012 15:41
To: rules-users at lists.jboss.org
Subject: Re: [rules-users] Guvnor - will not let you add elements to List in fact object

Hello,
which version of Guvnor do you use ?
Regards
Nicolas Héron
2012/5/21 benfro [via Drools] <[hidden email]</user/SendEmail.jtp?type=node&node=4004857&i=0>>
Hi

We have a fact model object according to

public class RuleAnalysisResult implements Serializable {



    private static final long serialVersionUID = 1L;



    private static final Logger LOGGER = Logger.getLogger(RuleAnalysisResult.class);



    private String value;



    private String definitionCode;



    private List<RuleAnalysisResult> elements = new ArrayList<RuleAnalysisResult>();



    public RuleAnalysisResult() {

    }



    /**

     * Drools needs this one

     */

    public RuleAnalysisResult(String value, String definitionCode) {

        this.value = value;

        this.definitionCode = definitionCode;

    }



    public RuleAnalysisResult(String value, String definitionCode, RuleAnalysisResult... results) {

        this.value = value;

        this.definitionCode = definitionCode;

        if (results != null) {

            elements.addAll(Arrays.asList(results));

        }

    }



    public String getDefinitionCode() {

        return definitionCode;

    }



    public void setDefinitionCode(String definitionCode) {

        this.definitionCode = definitionCode;

    }



    public void addElement(RuleAnalysisResult... result) {

        elements.addAll(Arrays.asList(result));

    }



    public List<RuleAnalysisResult> getElements() {

        return elements;

    }



    public void setElements(List<RuleAnalysisResult> elements) {

        this.elements = elements;

    }



    public String getValue() {

        return value;

    }



    public void setValue(String value) {

        this.value = value;

    }



    public int getElementSize() {

        return elements.size();

    }



    public int getIntValue() {

        LOGGER.info(value);

        return Integer.parseInt(value);

    }



    public double getDoubleValue() {

        LOGGER.info(value);

        return Double.parseDouble(value);

    }

}

When using Guvnor we try (in vain) to add elements to its List of children according to


This result in errors running the test scenario.


Anybody recognize this? Is this not the way to insert elements in a fact's collection?

Sincerely

benfro

________________________________
If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/Guvnor-will-not-let-you-add-elements-to-List-in-fact-object-tp4004819.html
To unsubscribe from Drools, click here.
NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

Nicolas Héron

________________________________
View this message in context: Re: Guvnor - will not let you add elements to List in fact object<http://drools.46999.n3.nabble.com/Guvnor-will-not-let-you-add-elements-to-List-in-fact-object-tp4004819p4004857.html>
Sent from the Drools: User forum mailing list archive<http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html> at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120521/db42ee03/attachment.html 


More information about the rules-users mailing list