[
https://issues.jboss.org/browse/DROOLS-420?page=com.atlassian.jira.plugin...
]
Mike Rodriguez commented on DROOLS-420:
---------------------------------------
This was discovered when upgrading to 5.6.0.Final from 5.5.0.Final. I was not seeing a
5.6.0.Final affects version when making this Jira.
According to
[
this|http://drools.46999.n3.nabble.com/Incorrect-resolution-of-global-sym...],
it affects Drools 6.x too.
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: Mark Proctor
Priority: Minor
As described @
[
http://drools.46999.n3.nabble.com/Incorrect-resolution-of-global-symbols-...].
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