This class is used to hold Groovy Programs. The code must start with method declarations. The outer class wrapper is built for you. You must at least the following method:
Object run(Map args) { // your code here }You can have additional methods, as well as write classes in between the methods. The code in the methods can be written as Java, or if you wish to use the excellent Groovy short-cuts, go for it. Check out the Groovy short-hand notation for Map access which is described below.For example, Maps can be accessed like this (the following 3 are equivalent):
1) input.get('BU') 2) input['BU'] 3) input.BUThere are variables available to you to access in your expression supplied by ncube. The passed in Map contains the following keys: input which is the input coordinate Map that was used to get to the the cell containing the expression. output is a Map that your expression can write to. This allows the program calling into the ncube to get multiple return values, with possible structure to each one (a graph return). ncube is the current ncube of the cell containing the expression. ncubeMgr is a reference to the NCubeManager class so that you can access other ncubes. stack which is a List of StackEntry's where element 0 is the StackEntry for the currently executing cell. Element 1 would be the cell that called into the current cell (if it was during the same execution cycle). The StackEntry contains the name of the cube as one field, and the coordinate that called into this cell.
Fields inherited from class | Fields |
---|---|
class GroovyBase |
CLASS_NAME_FOR_L2_CALC, L2CacheKey, fullClassName |
class UrlCommandCell |
EXTENSION_SEPARATOR, cache |
Constructor and description |
---|
GroovyMethod
(java.lang.String cmd, java.lang.String url = null, boolean cacheable = false) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected java.lang.String |
buildGroovy(java.util.Map<java.lang.String, java.lang.Object> ctx, java.lang.String className, java.lang.String theirGroovy) |
|
protected java.lang.Object |
invokeRunMethod(NCubeGroovyExpression instance) |