public boolean exec(MethodContext methodContext) {
if (this.methodName != null && this.methodName.length() > 0) {
String methodName = methodContext.expandString(this.methodName);
String xmlResource = methodContext.expandString(this.xmlResource);
SimpleMethod simpleMethodToCall = null;
try {
simpleMethodToCall = getSimpleMethodToCall(methodContext.getLoader());
} catch (MiniLangException e) {
String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [error getting methods from resource: " + e.getMessage() + "]";
Debug.logError(e, errMsg, module);
methodContext.setErrorReturn(errMsg, simpleMethod);
return false;
}
if (simpleMethodToCall == null) {
String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process, could not find SimpleMethod " + methodName + " in XML document in resource: " + xmlResource;
methodContext.setErrorReturn(errMsg, simpleMethod);
return false;
}
String returnVal = simpleMethodToCall.exec(methodContext);
if (Debug.verboseOn()) Debug.logVerbose("Called inline simple-method named [" + methodName + "] in resource [" + xmlResource + "], returnVal is [" + returnVal + "]", module);
if (returnVal != null && returnVal.equals(simpleMethodToCall.getDefaultErrorCode())) {
// in this case just set the error code just in case it hasn't already been set, the error messages will already be in place...
if (methodContext.getMethodType() == MethodContext.EVENT) {
methodContext.putEnv(simpleMethod.getEventResponseCodeName(), simpleMethod.getDefaultErrorCode());
} else if (methodContext.getMethodType() == MethodContext.SERVICE) {
methodContext.putEnv(simpleMethod.getServiceResponseMessageName(), simpleMethod.getDefaultErrorCode());