return this.serviceName + "[" + this.serviceMode + (this.persist ? "-persist" : "") + "]";
}
public boolean runAction(String selfService, DispatchContext dctx, Map<String, Object> context, Map<String, Object> result) throws GenericServiceException {
if (serviceName.equals(selfService)) {
throw new GenericServiceException("Cannot invoke self on ECA.");
}
// pull out context parameters needed for this service.
Map<String, Object> actionContext = dctx.getModelService(serviceName).makeValid(context, ModelService.IN_PARAM);
// set the userLogin object in the context
actionContext.put("userLogin", ServiceUtil.getUserLogin(dctx, actionContext, runAsUser));
Map<String, Object> actionResult = null;
LocalDispatcher dispatcher = dctx.getDispatcher();
// if SECAs have been turned off, then just return true which has same effect as if secas ran successfully
if (dispatcher.isEcasDisabled()) {
Debug.logWarning("SECAs have been disabled on purpose and will not be run for [" + serviceName + "]", module);
return true;
}
if (eventName.startsWith("global-")) {
// XA resource ECA
ServiceXaWrapper xaw = new ServiceXaWrapper(dctx);
if (eventName.equals("global-rollback")) {
xaw.setRollbackService(serviceName, context, "async".equals(serviceMode), persist); // using the actual context so we get updates
} else if (eventName.equals("global-commit")) {
xaw.setCommitService(serviceName, context, "async".equals(serviceMode), persist); // using the actual context so we get updates
} else if (eventName.equals("global-commit-post-run")) {
xaw.setCommitService(serviceName, context, "async".equals(serviceMode), persist); // using the actual context so we get updates
}
try {
xaw.enlist();
} catch (XAException e) {
throw new GenericServiceException("Unable to enlist ServiceXaWrapper with transaction", e);
}
} else {
// standard ECA
if (this.serviceMode.equals("sync")) {
if (newTransaction) {