]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrUtils.java
Improve process management
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.jcr / src / main / java / org / argeo / slc / jcr / SlcJcrUtils.java
index 0cda5a86d68e3d6149163633c907cab67bc3474b..ed2294f30087a45066a3799f706fa5d788312401 100644 (file)
@@ -1,5 +1,10 @@
 package org.argeo.slc.jcr;
 
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+import org.argeo.jcr.JcrUtils;
+
 /** Utilities around the SLC JCR model. Note that it relies on fixed base paths. */
 public class SlcJcrUtils {
        public final static Integer AGENT_FACTORY_DEPTH = 3;
@@ -39,6 +44,14 @@ public class SlcJcrUtils {
                return buf.toString();
        }
 
+       /** Create a new execution process path based on the current time */
+       public static String createExecutionProcessPath(String uuid) {
+               Calendar now = new GregorianCalendar();
+               return SlcJcrConstants.PROCESSES_BASE_PATH + '/'
+                               + JcrUtils.dateAsPath(now, true) + uuid;
+
+       }
+
        /** Prevents instantiation */
        private SlcJcrUtils() {