You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2014/11/12 15:45:56 UTC

svn commit: r1638801 - in /ofbiz/trunk: applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy

Author: jacopoc
Date: Wed Nov 12 14:45:56 2014
New Revision: 1638801

URL: http://svn.apache.org/r1638801
Log:
Enhanced the OFBiz DSL with an alternative way of invoking a service; converted one service call in OrderView.groovy to demonstrate its usage.

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=1638801&r1=1638800&r2=1638801&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy Wed Nov 12 14:45:56 2014
@@ -431,7 +431,7 @@ if (orderHeader) {
 
     // Get a map of returnable items
     returnableItems = [:];
-    returnableItemServiceMap = runService("getReturnableItems", [orderId : orderId]);
+    returnableItemServiceMap = run service: 'getReturnableItems', with: [orderId : orderId]
     if (returnableItemServiceMap.returnableItems) {
         returnableItems = returnableItemServiceMap.returnableItems;
     }

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy?rev=1638801&r1=1638800&r2=1638801&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy Wed Nov 12 14:45:56 2014
@@ -37,6 +37,10 @@ abstract class GroovyBaseScript extends 
         return result;
     }
 
+    Map run(Map args) throws ExecutionServiceException {
+        return runService((String)args.get('service'), (Map)args.get('with', new HashMap()));
+    }
+
     Map makeValue(String entityName) throws ExecutionServiceException {
         return result = binding.getVariable('delegator').makeValue(entityName);
     }