Author: sshyrkov
Date: Wed Aug 29 09:20:10 2007
New Revision: 18291

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18291&repname=
=3Djahia
Log:
N-Step Workflow Enhancements: first version
Changes: includes two new actions "Unlock" and "Lock" that can be enabled v=
ia configuration (nstep.properties) on any workflow step (except the first =
one). They are intented to temporary unlock (make editable - put in the sta=
ging state) the content without changing the workflow step

Modified:
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources.properties
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_de.properties
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_en.properties
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_fr.properties
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/services/w=
orkflow/ExternalWorkflow.java
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/services/w=
orkflow/WorkflowEventListener.java
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/workflow/n=
step/NStepWorkflow.java
    branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/webapp/WEB-INF/etc/servic=
es/workflow/nstep.properties

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-wor=
kflowResources.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowResources.properties&rev=
=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources.properties (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources.properties Wed Aug 29 09:20:10 2007
@@ -19,6 +19,8 @@
 process.three_validation_step_workflow.step.third_step =3D Publish modific=
ation on current page
 process.three_validation_step_workflow.step.rollback_to_previous_step =3D =
Rollback to previous step
 process.three_validation_step_workflow.step.rollback_to_author =3D Rollbac=
k to author
+process.three_validation_step_workflow.step.unlock =3D Unlock
+process.three_validation_step_workflow.step.lock =3D Lock
 # This value is of type boolean so its value must be true or false in all =
languages
 process.three_validation_step_workflow.last.step.production.present =3D tr=
ue
 process.three_validation_step_workflow.notification.template.path =3D exte=
rnal_workflows/nstep_workflow_mailnotif.groovy

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-wor=
kflowResources_de.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowResources_de.properties&re=
v=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_de.properties (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_de.properties Wed Aug 29 09:20:10 2007
@@ -18,6 +18,8 @@
 process.three_validation_step_workflow.step.third_step =3D =C3=84nderungen=
 auf der aktuellen Seite ver=C3=B6ffentlichen
 process.three_validation_step_workflow.step.rollback_to_previous_step =3D =
Zur=C3=BCck zum vorausgehenden Schritt
 process.three_validation_step_workflow.step.rollback_to_author =3D Zur=C3=
=BCck zum Autor
+process.three_validation_step_workflow.step.unlock =3D Entsprerren
+process.three_validation_step_workflow.step.lock =3D Sperren
 process.three_validation_step_workflow.notification.template.path =3D exte=
rnal_workflows/nstep_workflow_mailnotif.groovy
 notification.elements.advanced=3DListe der Elemente, die einen Schritt vor=
angekommen sind:
 notification.elements.deleted=3DListe der Elemente, die gel=C3=B6scht wurd=
en:

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-wor=
kflowResources_en.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowResources_en.properties&re=
v=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_en.properties (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_en.properties Wed Aug 29 09:20:10 2007
@@ -19,6 +19,8 @@
 process.three_validation_step_workflow.step.third_step =3D Publish modific=
ation on current page
 process.three_validation_step_workflow.step.rollback_to_previous_step =3D =
Rollback to previous step
 process.three_validation_step_workflow.step.rollback_to_author =3D Rollbac=
k to author
+process.three_validation_step_workflow.step.unlock =3D Unlock
+process.three_validation_step_workflow.step.lock =3D Lock
 process.three_validation_step_workflow.notification.template.path =3D exte=
rnal_workflows/nstep_workflow_mailnotif.groovy
 notification.elements.advanced=3DList of elements which have advanced of o=
ne step :
 notification.elements.deleted=3DList of elements which have been deleted :

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-wor=
kflowResources_fr.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowResources_fr.properties&re=
v=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_fr.properties (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/conf/java/nstep-workflowR=
esources_fr.properties Wed Aug 29 09:20:10 2007
@@ -20,6 +20,8 @@
 process.three_validation_step_workflow.step.rollback_to_previous_step =3D =
Renvoyer =C3=A0 l'=C3=A9tape pr=C3=A9c=C3=A9dente
 process.three_validation_step_workflow.step.rollback_to_author =3D Renvoye=
r au r=C3=A9dacteur
 process.three_validation_step_workflow.notification.template.path=3Dextern=
al_workflows/nstep_workflow_mailnotif.groovy
+process.three_validation_step_workflow.step.unlock =3D D=C3=A9verrouiller
+process.three_validation_step_workflow.step.lock =3D Verrouiller
 notification.elements.advanced=3DListe des =C3=A9l=C3=A9ments qui ont avan=
c=C3=A9 d'une =C3=A9tape :
 notification.elements.deleted=3DListe des =C3=A9l=C3=A9ments qui ont =C3=
=A9t=C3=A9 supprim=C3=A9s :
 notification.elements.finished=3DListe des =C3=A9l=C3=A9ments qui ont =C3=
=A9t=C3=A9 publi=C3=A9s :

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/serv=
ices/workflow/ExternalWorkflow.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/java/org/jahia/services/workflow/ExternalWorkflow.=
java&rev=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/services/w=
orkflow/ExternalWorkflow.java (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/services/w=
orkflow/ExternalWorkflow.java Wed Aug 29 09:20:10 2007
@@ -110,4 +110,22 @@
     ExternalWorkflowInstanceCurrentInfos getCurrentInfo(String processName,
                                                         String objectKey,
                                                         String languageCod=
e);
+
+    /**
+     * Check if the already started process needs to be aborted and restar=
ted
+     * again. This method can be used to check if the object is in the edi=
t mode
+     * in the middle of the workflow process to allow content updates with=
out
+     * restarting the complete workflow.
+     * =

+     * @param processName
+     *            the name of the process
+     * @param objectKey
+     *            the object key
+     * @param languageCode
+     *            the language code
+     * @return <code>true</code> if the workflow needs to be restarted aft=
er
+     *         content update
+     */
+    boolean needToRestartProcess(String processName, String objectKey,
+            String languageCode);
 }

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/serv=
ices/workflow/WorkflowEventListener.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/java/org/jahia/services/workflow/WorkflowEventList=
ener.java&rev=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/services/w=
orkflow/WorkflowEventListener.java (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/services/w=
orkflow/WorkflowEventListener.java Wed Aug 29 09:20:10 2007
@@ -32,7 +32,6 @@
 import org.jahia.services.usermanager.JahiaUser;
 import org.jahia.services.usermanager.JahiaUserManagerService;
 import org.jahia.services.version.ActivationTestResults;
-import org.jahia.services.version.EntryLoadRequest;
 import org.jahia.services.version.JahiaSaveVersion;
 import org.jahia.services.version.StateModificationContext;
 import org.jahia.services.fields.ContentField;
@@ -174,7 +173,7 @@
                         } else {
                             if (!workflow.isProcessStarted(processId,mainO=
bject.getObjectKey().toString(), languageCode)) {
                                 workflow.initProcess(processId,mainObject.=
getObjectKey().toString(), languageCode, jParams);
-                            } else {
+                            } else if (workflow.needToRestartProcess(proce=
ssId, mainObject.getObjectKey().toString(), languageCode)){
                                 workflow.abortProcess(processId,mainObject=
.getObjectKey().toString(), languageCode, jParams);
                                 workflow.initProcess(processId,mainObject.=
getObjectKey().toString(), languageCode, jParams);
                             }

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/work=
flow/nstep/NStepWorkflow.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/java/org/jahia/workflow/nstep/NStepWorkflow.java&r=
ev=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/workflow/n=
step/NStepWorkflow.java (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/java/org/jahia/workflow/n=
step/NStepWorkflow.java Wed Aug 29 09:20:10 2007
@@ -19,6 +19,22 @@
 =

 import groovy.lang.Binding;
 import groovy.util.GroovyScriptEngine;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.Properties;
+import java.util.ResourceBundle;
+import java.util.Set;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jahia.bin.Jahia;
@@ -30,10 +46,13 @@
 import org.jahia.hibernate.manager.SpringContextSingleton;
 import org.jahia.params.ProcessingContext;
 import org.jahia.registries.ServicesRegistry;
+import org.jahia.services.acl.JahiaACLManagerService;
+import org.jahia.services.acl.JahiaBaseACL;
 import org.jahia.services.containers.ContentContainer;
 import org.jahia.services.containers.ContentContainerList;
 import org.jahia.services.fields.ContentField;
 import org.jahia.services.importexport.ProductionJob;
+import org.jahia.services.lock.LockPrerequisites;
 import org.jahia.services.mail.GroovyMimeMessagePreparator;
 import org.jahia.services.mail.MailService;
 import org.jahia.services.pages.ContentPage;
@@ -46,11 +65,8 @@
 import org.jahia.services.version.JahiaVersionService;
 import org.jahia.services.version.StateModificationContext;
 import org.jahia.services.workflow.ExternalWorkflow;
-import org.jahia.services.workflow.WorkflowService;
 import org.jahia.services.workflow.ExternalWorkflowInstanceCurrentInfos;
-import org.jahia.services.acl.JahiaACLManagerService;
-import org.jahia.services.acl.JahiaBaseACL;
-import org.jahia.services.lock.LockPrerequisites;
+import org.jahia.services.workflow.WorkflowService;
 import org.jahia.utils.LanguageCodeConverters;
 import org.jahia.workflow.nstep.model.Workflow;
 import org.jahia.workflow.nstep.model.WorkflowInstance;
@@ -61,11 +77,6 @@
 import org.quartz.JobDetail;
 import org.springframework.orm.ObjectRetrievalFailureException;
 import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.transaction.support.TransactionTemplate;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.*;
 =

 /**
  * NstepWorkflow is a workflow which allows you to define multiple sequent=
ial processes in resource files.
@@ -140,10 +151,10 @@
     private Properties properties =3D null;
     private ResourceBundle resourceBundle;
     private String propertiesRelativePath =3D "/WEB-INF/etc/services/workf=
low/nstep.properties";
-    private final String rollback_action_name =3D "Rollback to previous st=
ep";
-    private final String rollback_author_action_name =3D "Rollback to auth=
or";
-    private PlatformTransactionManager transactionManager;
-    private TransactionTemplate transactionTemplate;
+    private static final String ROLLBACK_ACTION_NAME =3D "Rollback to prev=
ious step";
+    private static final String ROLLBACK_AUTHOR_ACTION_NAME =3D "Rollback =
to author";
+    private static final String UNLOCK_ACTION_NAME =3D "Unlock";
+    private static final String LOCK_ACTION_NAME =3D "Lock";
 // --------------------------- CONSTRUCTORS ---------------------------
 =

     /**
@@ -156,7 +167,6 @@
         try {
             properties =3D new Properties();
             properties.load(new FileInputStream(Jahia.getSettings().getPat=
hResolver().resolvePath(propertiesRelativePath)));
-            transactionTemplate =3D new TransactionTemplate(transactionMan=
ager);
         } catch (IOException e) {
             log.error("Error during parsing of " + propertiesRelativePath,=
 e);
             throw new JahiaException(e.getLocalizedMessage(), e.getMessage=
(), JahiaException.CONFIG_ERROR,
@@ -200,10 +210,9 @@
      * @param transactionManager Value to set for property 'transactionMan=
ager'.
      */
     public void setTransactionManager(PlatformTransactionManager transacti=
onManager) {
-        this.transactionManager =3D transactionManager;
+        // we do not need transaction manager currently
     }
 =

-
     /**
      * Get a list of all processes that can be applied to jahia workflow
      *
@@ -437,11 +446,17 @@
                     // avoid rollback on first two step
                     if (startIndex > 2) {
                         // Add rollback to previous step only if we have a=
lready done step one
-                        list.add(trimActionName(rollback_action_name));
+                        list.add(trimActionName(ROLLBACK_ACTION_NAME));
                     }
                     if (startIndex > 1) {
                         // Add rollback to author (reinit workflow)
-                        list.add(trimActionName(rollback_author_action_nam=
e));
+                        list.add(trimActionName(ROLLBACK_AUTHOR_ACTION_NAM=
E));
+                    }
+                    =

+                    if (isUnlockingEnabled(instance.getWorkflow(), workflo=
wStep)) {
+                        // Add actions for making content editable
+                        list.add(trimActionName(UNLOCK_ACTION_NAME));
+                        list.add(trimActionName(LOCK_ACTION_NAME));
                     }
                 }
             }
@@ -452,6 +467,29 @@
         }
         return list;
     }
+    =

+    /**
+     * Checks if the unlocking/locking is enabled on the specified workflow
+     * step.
+     * =

+     * @param workflow
+     *            current workflow object
+     * @param workflowStep
+     *            current workflow step
+     * @return <code>true</code> if the unlocking/locking is enabled on the
+     *         specified workflow step
+     */
+    private boolean isUnlockingEnabled(Workflow workflow,
+            WorkflowStep workflowStep) {
+        String key =3D new StringBuffer(64).append(
+                trimActionName(workflow.getName()).toLowerCase()).append(
+                ".step.").append(
+                trimActionName(workflowStep.getName()).toLowerCase()).appe=
nd(
+                ".enableUnlocking").toString();
+
+        return (properties.containsKey(key) && "true".equals(properties
+                .getProperty(key)));
+    }
 =

     /**
      * [EMAIL PROTECTED]
@@ -545,7 +583,7 @@
                         boolean isStartStep =3D false;
                         boolean isFinished =3D false;
                         WorkflowInstance instance;
-                        if (rollback_action_name.equals(unTrimmedActionNam=
e)) {
+                        if (ROLLBACK_ACTION_NAME.equals(unTrimmedActionNam=
e)) {
                             isStartStep =3D instanceManager.rollbackWorkfl=
ow(jParams.getUser().getUsername(), objectKey,
                                                                           =
 languageCode);
                             if (isStartStep) {
@@ -556,9 +594,9 @@
                             instance =3D instanceManager.getWorkflowInstan=
ceByObjectKey(objectKey, languageCode);
                             historyManager.saveWorkflowHistory(ServicesReg=
istry.getInstance().getJahiaUserManagerService().lookupUser(
                                     instance.getAuthorEmail()).getUsername=
(),
-                                                               jParams.get=
User().getUsername(), processName, rollback_action_name,
+                                                               jParams.get=
User().getUsername(), processName, ROLLBACK_ACTION_NAME,
                                                                objectKey, =
languageCode, comment);
-                        } else if (rollback_author_action_name.equals(unTr=
immedActionName)) {
+                        } else if (ROLLBACK_AUTHOR_ACTION_NAME.equals(unTr=
immedActionName)) {
                             while (!isStartStep) {
                                 isStartStep =3D instanceManager.rollbackWo=
rkflow(jParams.getUser().getUsername(), objectKey,
                                                                           =
     languageCode);
@@ -569,7 +607,25 @@
                             historyManager.saveWorkflowHistory(ServicesReg=
istry.getInstance().getJahiaUserManagerService().lookupUser(
                                     instance.getAuthorEmail()).getUsername=
(),
                                                                jParams.get=
User().getUsername(),
-                                                               processName=
, rollback_author_action_name, objectKey, languageCode,
+                                                               processName=
, ROLLBACK_AUTHOR_ACTION_NAME, objectKey, languageCode,
+                                                               comment);
+                        } else if (UNLOCK_ACTION_NAME.equals(unTrimmedActi=
onName)) {
+                            changeStatus(languageCode, jParams, objectKey,=
 processName,
+                                    EntryLoadRequest.STAGING_WORKFLOW_STAT=
E);
+                            instance =3D instanceManager.getWorkflowInstan=
ceByObjectKey(objectKey, languageCode);
+                            historyManager.saveWorkflowHistory(ServicesReg=
istry.getInstance().getJahiaUserManagerService().lookupUser(
+                                    instance.getAuthorEmail()).getUsername=
(),
+                                                               jParams.get=
User().getUsername(),
+                                                               processName=
, UNLOCK_ACTION_NAME, objectKey, languageCode,
+                                                               comment);
+                        } else if (LOCK_ACTION_NAME.equals(unTrimmedAction=
Name)) {
+                            changeStatus(languageCode, jParams, objectKey,=
 processName,
+                                    EntryLoadRequest.WAITING_WORKFLOW_STAT=
E);
+                            instance =3D instanceManager.getWorkflowInstan=
ceByObjectKey(objectKey, languageCode);
+                            historyManager.saveWorkflowHistory(ServicesReg=
istry.getInstance().getJahiaUserManagerService().lookupUser(
+                                    instance.getAuthorEmail()).getUsername=
(),
+                                                               jParams.get=
User().getUsername(),
+                                                               processName=
, LOCK_ACTION_NAME, objectKey, languageCode,
                                                                comment);
                         } else {
                             instance =3D instanceManager.getWorkflowInstan=
ceByObjectKey(objectKey, languageCode);
@@ -950,7 +1006,7 @@
             }
         } else {
             JahiaGroup group;
-            if (unTrimmedActionName.equals(rollback_action_name)) {
+            if (unTrimmedActionName.equals(ROLLBACK_ACTION_NAME)) {
                 mailBody =3D getKey("process." + processName + ".mail.body=
.rollback", workflow, jParams, displayName, comment, username, nextStep,
                                   null, contentObjectInstance, mailResourc=
eBundle, false, false, false, false, true);
 // Send mail to group who refuse to validate
@@ -1033,4 +1089,15 @@
     private String untrimActionName(String actioName) {
         return actioName.replaceAll("_", " ").trim();
     }
+
+    /* (non-Javadoc)
+     * @see org.jahia.services.workflow.ExternalWorkflow#needToRestartProc=
ess(java.lang.String, java.lang.String, java.lang.String)
+     */
+    public boolean needToRestartProcess(String processName, String objectK=
ey,
+            String languageCode) {
+
+        // we return false in order to prevent updated object to go back t=
o the first workflow step.
+        return false;
+    }
+    =

 }

Modified: branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/webapp/WEB-INF/etc/=
services/workflow/nstep.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-MINEFI=
-5-0-2-SPBRANCH/core/src/webapp/WEB-INF/etc/services/workflow/nstep.propert=
ies&rev=3D18291&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/webapp/WEB-INF/etc/servic=
es/workflow/nstep.properties (original)
+++ branches/JAHIA-MINEFI-5-0-2-SPBRANCH/core/src/webapp/WEB-INF/etc/servic=
es/workflow/nstep.properties Wed Aug 29 09:20:10 2007
@@ -1,2 +1,4 @@
 workflowsName =3D Three Validation Step Workflow
-three_validation_step_workflow.steps =3D First step, Second step, Third st=
ep
\ No newline at end of file
+three_validation_step_workflow.steps =3D First step, Second step, Third st=
ep
+#three_validation_step_workflow.step.second_step.enableUnlocking =3D true
+three_validation_step_workflow.step.third_step.enableUnlocking =3D true

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to