[rules-users] Guvnor - will not let you add elements to List in fact object
Nicolas Héron
nicolas.heron.java at gmail.com
Mon May 21 09:40:59 EDT 2012
Hello,
which version of Guvnor do you use ?
Regards
Nicolas Héron
2012/5/21 benfro [via Drools] <ml-node+s46999n4004819h22 at n3.nabble.com>
> 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<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=46999&code=bmljb2xhcy5oZXJvbi5qYXZhQGdtYWlsLmNvbXw0Njk5OXwxMzk3MTU0MDQw>
> .
> 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: 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 at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120521/e2029ab3/attachment-0001.html
More information about the rules-users
mailing list