[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1613) In one special case, the naming of a Drools-Function causes an error

Brandon Chapman (JIRA) jira-events at lists.jboss.org
Wed Jun 4 11:40:22 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBRULES-1613?page=comments#action_12415599 ] 
            
Brandon Chapman commented on JBRULES-1613:
------------------------------------------

I am having the same issue. In the below DRL method getRatingInfo is reported as undefined. If I change the rule to use the field name and let drools look up the getter, it does not find it. Changing the name of the object and getter corrects the issue.

rule "test table_106"
	
	when
		sub:SubscriberInfo(eval(getRatingInfo() != null), eval(balanceInfo != null))
	then
		System.out.println("Both are set");
end

> In one special case, the naming of a Drools-Function causes an error
> --------------------------------------------------------------------
>
>                 Key: JBRULES-1613
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1613
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Drl Parser/Builder
>    Affects Versions: 4.0.4
>         Environment: Windows XP SP2, JRE 1.6.0_01-b06, JDK 1.6.0_01
>            Reporter: Michael Katai
>         Assigned To: Mark Proctor
>            Priority: Trivial
>
> In one special case, the naming of two functions in the drl-File causes an error.
> Here my code (simplified):
>   
>   package....
>   import ....
>   rule ...
>     when
>       ....
>     then
>       checkHierachyInstance(...);
>   end
>   function void checkHierachyInstance(...)
>   {
>     checkHierachyInstanceRecursive(...);
>   }
>   function void checkHierachyInstanceRecursive(...)
>   {
>   }
> From this code i get the following runtime-error:
> [ checkHierachyInstance : Function Compilation error
> checkHierachyInstance (line:54): The method checkHierachyInstanceRecursive(Activity, SActivity, int, int) is undefined for the type CheckHierachyInstance ]
> Rule Compilation error :
> [Rule name=action_conditional_starttimereached, agendaGroup=MAIN, salience=0, no-loop=false]
>         action_conditional_starttimereached_5491408023587370397/Rule_action_conditional_starttimereached_0.java (15:857)
>  : The import action_conditional_starttimereached_5491408023587370397.CheckHierachyInstance cannot be resolved
>         action_conditional_starttimereached_5491408023587370397/Rule_action_conditional_starttimereached_0.java (20:1531
> ) : The method checkHierachyInstance(String, Consumer, Activity, SActivity, String) is undefined for the type Rule_actio
> n_conditional_starttimereached_0
> [ checkHierachyInstance : Function Compilation error
> checkHierachyInstance (line:54): The method checkHierachyInstanceRecursive(Activity, SActivity, int, int) is undefined for the type CheckHierachyInstance ]
> As far as i have found out, the error occurs ONLY if I append any character to the functionname "checkHierachyInstance", in my case the word "Recursive". It works if I use a completely different name instead of "checkHierachyInstanceRecursive" or exchange a character in "checkHierachyInstanceRecursive". For example I can use "function void myFunc(...)" or "function void checkHierachyInstancRecursive(...)" instead of "checkHierachyInstanceRecursive" .
> The only combination of function names i'm not allowed to use is checkHierachyInstance and checkHierachyInstanceXXX

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list