Reverted: Test Integration failed due to fix done in 1807908. OFBIZ-8323

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1807915 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rishi Solanki
2017-09-09 16:01:39 +00:00
parent ec9cba10ed
commit c0f2e5ee8f
@@ -112,18 +112,22 @@ public final class EntityAutoEngine extends GenericAsyncEngine {
switch (modelService.invoke) {
case "create":
result = invokeCreate(dctx, parameters, modelService, modelEntity, allPksInOnly, pkFieldNameOutOnly);
result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage("ServiceUiLabels", "EntityCreatedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
break;
case "update":
result = invokeUpdate(dctx, parameters, modelService, modelEntity, allPksInOnly);
result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage("ServiceUiLabels", "EntityUpdatedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
break;
case "delete":
result = invokeDelete(dctx, parameters, modelService, modelEntity, allPksInOnly);
result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage("ServiceUiLabels", "EntityDeletedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
break;
case "expire":
result = invokeExpire(dctx, parameters, modelService, modelEntity, allPksInOnly);
if (ServiceUtil.isSuccess(result)) {
result = invokeUpdate(dctx, parameters, modelService, modelEntity, allPksInOnly);
}
result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage("ServiceUiLabels", "EntityExpiredSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
break;
default:
break;
@@ -144,6 +148,7 @@ public final class EntityAutoEngine extends GenericAsyncEngine {
private static Map<String, Object> invokeCreate(DispatchContext dctx, Map<String, Object> parameters, ModelService modelService, ModelEntity modelEntity, boolean allPksInOnly, List<String> pkFieldNameOutOnly)
throws GeneralException {
Locale locale = (Locale) parameters.get("locale");
Map<String, Object> result = ServiceUtil.returnSuccess();
GenericValue newEntity = dctx.getDelegator().makeValue(modelEntity.getEntityName());
@@ -355,7 +360,6 @@ public final class EntityAutoEngine extends GenericAsyncEngine {
}
}
newEntity.create();
Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityCreatedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
result.put("crudValue", newEntity);
return result;
}
@@ -468,7 +472,6 @@ public final class EntityAutoEngine extends GenericAsyncEngine {
lookedUpValue.store();
result.put("crudValue", lookedUpValue);
result.put(ModelService.SUCCESS_MESSAGE,ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityUpdatedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale)));
return result;
}
@@ -499,8 +502,7 @@ public final class EntityAutoEngine extends GenericAsyncEngine {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ServiceValueNotFoundForRemove", locale));
}
lookedUpValue.remove();
Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityDeletedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
return result;
return ServiceUtil.returnSuccess();
}
/**
@@ -564,7 +566,6 @@ public final class EntityAutoEngine extends GenericAsyncEngine {
}
if (Debug.infoOn())
Debug.logInfo(" parameters OUT : " + parameters, module);
Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityExpiredSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
return result;
return ServiceUtil.returnSuccess();
}
}