You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2012/05/12 23:22:14 UTC

svn commit: r1337686 - in /ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow: ./ client/ definition/ impl/

Author: doogie
Date: Sat May 12 21:22:14 2012
New Revision: 1337686

URL: http://svn.apache.org/viewvc?rev=1337686&view=rev
Log:
DEPRECATION: specialpurpose/workflow: findByPrimaryKey variants replaced
with findOne

Modified:
    ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java
    ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowServices.java
    ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java
    ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java
    ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java
    ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java
    ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java?rev=1337686&r1=1337685&r2=1337686&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java Sat May 12 21:22:14 2012
@@ -205,7 +205,7 @@ public class WfApplicationServices {
             throws GenericServiceException {
         try {
             GenericValue application =
-                delegator.findByPrimaryKey("ApplicationSandbox", UtilMisc.toMap("applicationId", applicationId));
+                delegator.findOne("ApplicationSandbox", UtilMisc.toMap("applicationId", applicationId), false);
             return application;
         } catch (GenericEntityException ee) {
             throw new GenericServiceException(ee.getMessage(), ee);
@@ -238,7 +238,7 @@ public class WfApplicationServices {
             throws GenericServiceException {
         try {
             GenericValue application =
-                delegator.findByPrimaryKey("ApplicationSandbox", UtilMisc.toMap("applicationId", applicationId));
+                delegator.findOne("ApplicationSandbox", UtilMisc.toMap("applicationId", applicationId), false);
             return application.getRelatedOne("RuntimeData");
         } catch (GenericEntityException ee) {
             throw new GenericServiceException(ee.getMessage(), ee);
@@ -250,7 +250,7 @@ public class WfApplicationServices {
         Map<String, Object> expresions = null;
         // look for the 1st application.
         final GenericValue workEffort =
-            delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", application.get("workEffortId")));
+            delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", application.get("workEffortId")), false);
         String packageId = (String) workEffort.get("workflowPackageId");
         String packageVersion = (String) workEffort.get("workflowPackageVersion");
         String processId = (String) workEffort.get("workflowProcessId");

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowServices.java?rev=1337686&r1=1337685&r2=1337686&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowServices.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowServices.java Sat May 12 21:22:14 2012
@@ -66,7 +66,7 @@ public class WorkflowServices {
 
         // if we passed in an activity id, lets get the process id instead
         try {
-            GenericValue testObject = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId));
+            GenericValue testObject = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false);
             if (testObject == null) {
                 result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
                 result.put(ModelService.ERROR_MESSAGE, "Not a valid workflow runtime identifier");
@@ -498,7 +498,7 @@ public class WorkflowServices {
      */
     public static GenericValue getOwner(Delegator delegator, String workEffortId) {
         try {
-            GenericValue we = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId));
+            GenericValue we = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false);
 
             if (we != null && we.getString("workEffortParentId") == null) {
                 List<GenericValue> workEffortList = delegator.findByAnd("WorkEffortPartyAssignment",

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java?rev=1337686&r1=1337685&r2=1337686&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java Sat May 12 21:22:14 2012
@@ -244,9 +244,9 @@ public class XpdlReader {
             String message = "";
 
             if (prefix.equals("package")) {
-                GenericValue gvCheck = valueObject.getDelegator().findByPrimaryKey("WorkflowPackage",
+                GenericValue gvCheck = valueObject.getDelegator().findOne("WorkflowPackage",
                         UtilMisc.toMap("packageId", valueObject.getString("packageId"),
-                            "packageVersion", valueObject.getString("packageVersion")));
+                            "packageVersion", valueObject.getString("packageVersion")), false);
 
                 if (gvCheck != null) {
                     message = "[xpdl] Package: " + valueObject.getString("packageId") +
@@ -254,11 +254,11 @@ public class XpdlReader {
                             ") has already been imported. Will not update/import.";
                 }
             } else if (prefix.equals("process")) {
-                GenericValue gvCheck = valueObject.getDelegator().findByPrimaryKey("WorkflowProcess",
+                GenericValue gvCheck = valueObject.getDelegator().findOne("WorkflowProcess",
                         UtilMisc.toMap("packageId", valueObject.getString("packageId"),
                             "packageVersion", valueObject.getString("packageVersion"),
                             "processId", valueObject.getString("processId"),
-                            "processVersion", valueObject.getString("processVersion")));
+                            "processVersion", valueObject.getString("processVersion")), false);
 
                 if (gvCheck != null) {
                     message = "[xpdl] Process: " + valueObject.getString("processId") +
@@ -1049,7 +1049,7 @@ public class XpdlReader {
             GenericValue testValue = null;
 
             try {
-                testValue = delegator.findByPrimaryKey("WorkflowParticipant", UtilMisc.toMap("participantId", participantId));
+                testValue = delegator.findOne("WorkflowParticipant", UtilMisc.toMap("participantId", participantId), false);
             } catch (GenericEntityException e) {
                 Debug.logWarning(e, module);
             }

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java?rev=1337686&r1=1337685&r2=1337686&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java Sat May 12 21:22:14 2012
@@ -124,7 +124,7 @@ public class WfActivityImpl extends WfEx
                     Map<String, Object> performerFields = UtilMisc.toMap("packageId", (Object) valueObject.getString("packageId"),
                             "packageVersion", valueObject.getString("packageVersion"), "processId", "_NA_",
                             "processVersion", "_NA_", "participantId", valueObject.getString("performerParticipantId"));
-                    performer = delegator.findByPrimaryKey("WorkflowParticipant", performerFields);
+                    performer = delegator.findOne("WorkflowParticipant", performerFields, false);
                 }
             } catch (GenericEntityException e) {
                 throw new WfException(e.getMessage(), e);
@@ -168,11 +168,11 @@ public class WfActivityImpl extends WfEx
 
             try {
                 Map<String, Object> fields1 = UtilMisc.toMap("partyId", (Object) performer.getString("partyId"));
-                GenericValue v1 = getDelegator().findByPrimaryKey("Party", fields1);
+                GenericValue v1 = getDelegator().findOne("Party", fields1, false);
 
                 partyType = v1.getRelatedOne("PartyType");
                 Map<String, Object> fields2 = UtilMisc.toMap("partyTypeId", (Object) "PARTY_GROUP");
-                groupType = getDelegator().findByPrimaryKeyCache("PartyType", fields2);
+                groupType = getDelegator().findOne("PartyType", fields2, true);
             } catch (GenericEntityException e) {
                 throw new WfException(e.getMessage(), e);
             }
@@ -786,7 +786,7 @@ public class WfActivityImpl extends WfEx
     private GenericValue getUserLogin(String userId) throws WfException {
         GenericValue userLogin = null;
         try {
-            userLogin = getDelegator().findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userId));
+            userLogin = getDelegator().findOne("UserLogin", UtilMisc.toMap("userLoginId", userId), false);
         } catch (GenericEntityException e) {
             throw new WfException(e.getMessage(), e);
         }

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java?rev=1337686&r1=1337685&r2=1337686&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java Sat May 12 21:22:14 2012
@@ -265,7 +265,7 @@ public class WfAssignmentImpl implements
         fields.put("roleTypeId", resource.resourceRoleId());
         fields.put("fromDate", fromDate);
         try {
-            value = activity.getDelegator().findByPrimaryKey("WorkEffortPartyAssignment", fields);
+            value = activity.getDelegator().findOne("WorkEffortPartyAssignment", fields, false);
         } catch (GenericEntityException e) {
             throw new WfException(e.getMessage(), e);
         }

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java?rev=1337686&r1=1337685&r2=1337686&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java Sat May 12 21:22:14 2012
@@ -524,7 +524,7 @@ public abstract class WfExecutionObjectI
         if (activityId != null)
             fields.put("activityId", activityId);
         try {
-            value = getDelegator().findByPrimaryKey(entityName, fields);
+            value = getDelegator().findOne(entityName, fields, false);
         } catch (GenericEntityException e) {
             throw new WfException(e.getMessage(), e);
         }
@@ -535,8 +535,8 @@ public abstract class WfExecutionObjectI
         GenericValue value = null;
 
         try {
-            value = getDelegator().findByPrimaryKey("WorkEffort",
-                        UtilMisc.toMap("workEffortId", workEffortId));
+            value = getDelegator().findOne("WorkEffort",
+                        UtilMisc.toMap("workEffortId", workEffortId), false);
         } catch (GenericEntityException e) {
             throw new WfException(e.getMessage(), e);
         }
@@ -627,7 +627,7 @@ public abstract class WfExecutionObjectI
     private GenericValue getWorkEffort(String workEffortId) throws WfException {
         GenericValue we = null;
         try {
-            we = getDelegator().findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId));
+            we = getDelegator().findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false);
         } catch (GenericEntityException e) {
             throw new WfException("Problem getting WorkEffort entity (" + workEffortId + ")", e);
         }

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java?rev=1337686&r1=1337685&r2=1337686&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java Sat May 12 21:22:14 2012
@@ -151,7 +151,7 @@ public class WfProcessImpl extends WfExe
                 Map<String, Object> fields = UtilMisc.toMap("packageId", (Object) processDef.getString("packageId"), "packageVersion",
                         processDef.getString("packageVersion"), "processId", processDef.getString("processId"),
                         "processVersion", processDef.getString("processVersion"), "activityId", activityId);
-                start = getDelegator().findByPrimaryKey("WorkflowActivity", fields);
+                start = getDelegator().findOne("WorkflowActivity", fields, false);
 
                 // here we must check and make sure this activity is defined to as a starting activity
                 if (!start.getBoolean("canStart").booleanValue())