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

michi at wyona.com michi at wyona.com
Tue May 6 09:39:59 CEST 2008


Author: michi
Date: 2008-05-06 09:39:58 +0200 (Tue, 06 May 2008)
New Revision: 36354

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

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 07:37:56 UTC (rev 36353)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java	2008-05-06 07:39:58 UTC (rev 36354)
@@ -263,9 +263,23 @@
         }
     }
 
+    /**
+     *
+     */
     public static String getWorkflowVariable(Resource resource, String name) throws WorkflowException {
         try {
-            Node node = resource.getRealm().getRepository().getNode(resource.getPath());
+            return getWorkflowVariable(resource.getRealm().getRepository().getNode(resource.getPath()), name);
+        } catch (Exception e) {
+            log.error(e, e);
+            throw new WorkflowException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     *
+     */
+    public static String getWorkflowVariable(Node node, String name) throws WorkflowException {
+        try {
             Property property = node.getProperty(name);
             if (property != null) {
                 return property.getString();
@@ -278,6 +292,9 @@
         }
     }
 
+    /**
+     *
+     */
     public static void setWorkflowVariable(Resource resource, String name, String value) throws WorkflowException {
         try {
             Node node = resource.getRealm().getRepository().getNode(resource.getPath());



More information about the Yanel-commits mailing list