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

michi at wyona.com michi at wyona.com
Tue May 6 13:44:47 CEST 2008


Author: michi
Date: 2008-05-06 13:44:47 +0200 (Tue, 06 May 2008)
New Revision: 36377

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java
Log:
node is actually sufficient

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 11:29:45 UTC (rev 36376)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java	2008-05-06 11:44:47 UTC (rev 36377)
@@ -297,7 +297,18 @@
      */
     public static void setWorkflowVariable(Resource resource, String name, String value) throws WorkflowException {
         try {
-            Node node = resource.getRealm().getRepository().getNode(resource.getPath());
+            setWorkflowVariable(resource.getRealm().getRepository().getNode(resource.getPath()), name, value);
+        } catch (Exception e) {
+            log.error(e, e);
+            throw new WorkflowException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     *
+     */
+    public static void setWorkflowVariable(Node node, String name, String value) throws WorkflowException {
+        try {
             node.setProperty(name, value);
         } catch (Exception e) {
             log.error(e, e);
@@ -307,7 +318,15 @@
     
     public static void removeWorkflowVariable(Resource resource, String name) throws WorkflowException {
         try {
-            Node node = resource.getRealm().getRepository().getNode(resource.getPath());
+            removeWorkflowVariable(resource.getRealm().getRepository().getNode(resource.getPath()), name);
+        } catch (Exception e) {
+            log.error(e, e);
+            throw new WorkflowException(e.getMessage(), e);
+        }
+    }
+    
+    public static void removeWorkflowVariable(Node node, String name) throws WorkflowException {
+        try {
             node.removeProperty(name);
         } catch (Exception e) {
             log.error(e, e);



More information about the Yanel-commits mailing list