[rules-users] condition altered while unmarshalling a drl to guided rule

Sumit Dhaniya sumitdhaniya at gmail.com
Wed Jul 16 09:27:53 EDT 2014


I created a guided rule and when I open it again some conditions which I
wrote using the --Text-- option from drop down are altered. 
It seems the issue is only with unmarshalling because condition remains
unaltered in rdrl file until you save it again so everything is fine if you
change it every time you make any change to the rule or save it.

Below is the scenario to reproduce(use 6.1CR2) :-

1) Made a Maven-ized JAR containing the following classes:

package com.demo;

import java.util.List;

public class Foo {

    private List myList;

    public List getMyList() {
        return myList;
    }

    public void setMyList( List myList ) {
        this.myList = myList;
    }
}

public class Bar {

    private String myString;

    public String getMyString() {
        return myString;
    }

    public void setMyString( String myString ) {
        this.myString = myString;
    }
}

2) Uploaded JAR to the workbench's Artifact Repository

3) Added a project dependency on this artifact

4) Added an Import Suggestion for java.util.List

5) Created a new Guided Rule

6) Imported Foo,Bar and java.util.List (Config tab)

7) Created the following rule:

package org.mortgages;

import java.lang.Number;
import java.util.List;
import org.anstis.MyListClass;

rule "r1"
  dialect "mvel"
when
 $foo : Foo()
 Bar : Bar( myString == $foo.myList.get(1))
then
end

8) Validate rule :- will be vaidated
9) Save and close rule

Now when rule will be opened again this get(1) will change to get moreover
while creating rule get(index) method is not specified in dropdown so
selected -- Text -- option to create the rule.

DRL remains in valid format until overwritten in another save.



--
View this message in context: http://drools.46999.n3.nabble.com/condition-altered-while-unmarshalling-a-drl-to-guided-rule-tp4030375.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list