[jboss-jira] [JBoss JIRA] (DROOLS-420) Incorrect resolution of global symbols in LHS rule constraint (Java dialect)

Mario Fusco (JIRA) issues at jboss.org
Fri Jan 31 03:09:29 EST 2014


     [ https://issues.jboss.org/browse/DROOLS-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mario Fusco resolved DROOLS-420.
--------------------------------

    Fix Version/s: 6.1.0.Beta1
       Resolution: Done

    
> Incorrect resolution of global symbols in LHS rule constraint (Java dialect)
> ----------------------------------------------------------------------------
>
>                 Key: DROOLS-420
>                 URL: https://issues.jboss.org/browse/DROOLS-420
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Mike Rodriguez
>            Assignee: Mario Fusco
>            Priority: Minor
>             Fix For: 6.1.0.Beta1
>
>
> As described @ [http://drools.46999.n3.nabble.com/Incorrect-resolution-of-global-symbols-in-LHS-rule-constraint-Java-dialect-tp4027921.html].
> I upgraded from 5.5.0.Final of Drools (rule engine) to 5.6.0.Final and I am now seeing errors with globals.   
> We have rule constraints that access globals in a DRL; like this:   
> {code}some.classpath.package2.MyType ( global_instance.invoke(this) == true ) {code}
> I have {code}some.classpath.package.SomeType global_instance;{code} declared at the top of the DRL, but it doesn't seem to be interpreting it as a global in the rule's restriction. 
> So, putting this into context within, I have a DRL such as: 
> package my.package.example; 
> global some.classpath.package.SomeType global_instance; 
> {code}
> rule "Example rule" 
> when 
>    some.classpath.package2.MyType ( global_instance.invoke(this) == true ) 
> then 
>    // do something 
> end 
> {code}
> I am getting an error from the package builder originating from the "Example rule" specifying something like: 
> "can't find method MyType.global_instance()" 
> Once, again this did work in 5.5.0.Final, but in 5.6.0.Final I am getting a failure trying to build the knowledge package. 
> It looks to me like the {{global_instance}} symbol is not being recognized as a global in the DRL and is trying to be 
> resolved as a method of the MyType class.   
> So I guess it would be trying to do a "MyType.global_instance().invoke(this)" or something. 
> The intent is that {{global_instance}} will be set for a session with an immutable function-type of class 
> (invoke is an instance method though; not static).  The rule restriction uses this function/predicate to determine if some 
> complex criteria is true for `this` MyType instance. 
> I would appreciate any insight into what the issue might be.  I haven't been able to find any threads out there on a similar issue. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list