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

Michael Anstis michael.anstis at gmail.com
Thu Jul 17 11:56:16 EDT 2014


Fixed.

6.2.0-SNAPSHOT (master branch) has improved Expression handling.

6.1.0.Final will include the fix for this issue; but other aspects of
Expression handling are not as developed as 6.2.0-SNAPSHOT.


On 16 July 2014 16:40, Michael Anstis <michael.anstis at gmail.com> wrote:

> https://issues.jboss.org/browse/GUVNOR-2109
>
> Working on a fix.
>
>
> On 16 July 2014 14:27, Sumit Dhaniya <sumitdhaniya at gmail.com> wrote:
>
>> 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.
>> _______________________________________________
>> 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/20140717/d16721e8/attachment.html 


More information about the rules-users mailing list