[Yanel-commits] rev 36372 - public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow

michi at wyona.com michi at wyona.com
Tue May 6 12:01:24 CEST 2008


Author: michi
Date: 2008-05-06 12:01:23 +0200 (Tue, 06 May 2008)
New Revision: 36372

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java
Log:
set workflow state refactored

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java	2008-05-06 09:48:27 UTC (rev 36371)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java	2008-05-06 10:01:23 UTC (rev 36372)
@@ -344,9 +344,23 @@
         }
     }
 
+    /**
+     *
+     */
     public static void setWorkflowState(Resource resource, String state, String revision) throws WorkflowException {
         try {
-            Node node = resource.getRealm().getRepository().getNode(resource.getPath());
+            setWorkflowState(resource.getRealm().getRepository().getNode(resource.getPath()), state, revision);
+        } catch (Exception e) {
+            log.error(e, e);
+            throw new WorkflowException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     *
+     */
+    public static void setWorkflowState(Node node, String state, String revision) throws WorkflowException {
+        try {
             Revision rev = node.getRevision(revision); 
             rev.setProperty(WORKFLOW_STATE_PROPERTY, state);
             rev.setProperty(WORKFLOW_DATE_PROPERTY, new Date());



More information about the Yanel-commits mailing list