[jboss-jira] [JBoss JIRA] Closed: (JBRULES-658) Unable to invoke global variable Service from an embedded Function()

Mark Proctor (JIRA) jira-events at lists.jboss.org
Thu Apr 12 09:47:58 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBRULES-658?page=all ]

Mark Proctor closed JBRULES-658.
--------------------------------

    Resolution: Won't Fix

That is expected beviour. Functions are just java static methods, if you want access to that DRL global pass it as a parameter.

> Unable to invoke global variable Service from an embedded Function()
> --------------------------------------------------------------------
>
>                 Key: JBRULES-658
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-658
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Drl Parser/Builder
>         Environment: Windows
>            Reporter: James DePaul
>         Assigned To: Mark Proctor
>            Priority: Minor
>
> Trying to invoke a service referenced in a global variable works when invoked from the <consequence> block, but NOT from the function imbeded in the Rule definition - see code sample below:
> rule "Shipper Match"
> 	salience 90
> 	when
> 		shipperGI : GateIn ( customerId == "NISSAN", primaryShipperId == "YELLOW" ) 
> 	then
> 		myService.sendNotification(shipperGI, Constants.SHIPPER_MATCH);	// <-- This WORKS
> 		// notifyPartNer(shipperGI, COnstants.SHIPPER_MATCH); <-- This DOES NOT work!
> end
> // Match found - notify customer
> function void notifyPartner(GateIn _event, String _action ) {
> 	System.out.println("Invoking Service for action = " + _action );
> 	//myService.sendNotification(_event, _action);
> }

-- 
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