...
calling services:
Code Block Map runService(String serviceName, Map inputMap)
Code Block Map run(Map args)
Info The "run" method is implemented using named parameters and supports service calls with the following style:
Code Block result = run service: 'createProduct', with: [productId: 'WG-1111']
The DSL valid the map passed before run the service, so you can call directly like
Code Block result = run service: 'createProduct', with: parameters
retrieving data
Code Block EntityQuery select(...)
Code Block EntityQuery from(...)
Info The "select" and "from" methods can be used in the following ways:
Code Block record = select().from('Product').where(productId, 'WG-1111').queryOne() // selects all the columns of the record record = from('Product').where(productId, 'WG-1111').queryOne() // same as above record = from('Product').where(context).queryOne() // same as above if productId is present in context or present in context.parameters record = select('internalName').from('Product').where(productId, 'WG-1111').queryOne() // selects one column of the record
For more details refer to the Javadocs of EntityQuery.
modifying data:
Code Block GenericValue makeValue(String entityName)
and then call the methods on the GenericValue object (remove/store etc...)
logging (they all accept a GString i.e. $notation):
Code Block logInfo(String message)
Code Block logWarning(String message)
Code Block logError(String message)
returning from the service or event (the methods simply return a Map for services or a string for events but you still have to use the "return" keyword to return the map back; when used by events the error method adds also the error message, if specified, to the request object):
Code Block def success(String message)
Code Block Map failure(String message)
Code Block def error(String message)
...