// Create map of parent scope objects
Map<String, Object> parentScopeObjects = new HashMap<String, Object>();
parentScopeObjects.put(SCRIPTOBJ_WGASERVICESCONTEXT, _contextProvider);
// Call action
Object result = context.callCustomAction(action, params, parentScopeObjects);
if (context.isdefined("actionresult")) {
ExpressionResult expressionResult = (ExpressionResult) context.item("actionresult");
if (expressionResult.isError()) {
WGExpressionException ex = expressionResult.getException();