Hello,
which version of Guvnor do you use ?
Regards
Nicolas Héron

2012/5/21 benfro [via Drools] <[hidden email]>
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

Nicolas Héron


View this message in context: Re: Guvnor - will not let you add elements to List in fact object
Sent from the Drools: User forum mailing list archive at Nabble.com.