You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/09/05 13:01:44 UTC

[1/2] syncope git commit: [SYNCOPE-880] Identity Recertification

Repository: syncope
Updated Branches:
  refs/heads/master a99618d94 -> f17be3cf9


[SYNCOPE-880] Identity Recertification


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2191c595
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2191c595
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2191c595

Branch: refs/heads/master
Commit: 2191c595f5a7a42e26e7658c80d959f0cb9af330
Parents: a99618d
Author: Nicola Scendoni <sc...@gmail.com>
Authored: Thu Jun 23 12:45:11 2016 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Mon Sep 5 12:10:28 2016 +0200

----------------------------------------------------------------------
 .../core/persistence/api/entity/user/User.java  |   8 ++
 .../persistence/jpa/entity/user/JPAUser.java    |  30 ++++++
 .../main/resources/domains/MasterContent.xml    |   3 +
 .../persistence/jpa/inner/PlainSchemaTest.java  |   2 +-
 .../core/persistence/jpa/inner/TaskTest.java    |   2 +-
 .../test/resources/domains/MasterContent.xml    |  13 ++-
 .../java/job/IdentityRecertification.java       | 105 +++++++++++++++++++
 .../activiti/ActivitiUserWorkflowAdapter.java   |  20 +++-
 .../core/workflow/activiti/task/Recertify.java  |  59 +++++++++++
 .../src/main/resources/userWorkflow.bpmn20.xml  |  57 +++++++++-
 .../core/workflow/api/UserWorkflowAdapter.java  |   5 +
 .../java/DefaultUserWorkflowAdapter.java        |   5 +
 .../src/main/resources/userWorkflow.bpmn20.xml  |  55 +++++++++-
 .../syncope/fit/core/RecertificationITCase.java |  51 +++++++++
 pom.xml                                         |  10 ++
 .../configurationparameters.adoc                |   4 +-
 .../identityrecertification.adoc                |  50 +++++++++
 .../systemadministration.adoc                   |   2 +
 18 files changed, 473 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
index fa81fd1..d3259e7 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
@@ -96,4 +96,12 @@ public interface User extends
 
     List<? extends Role> getRoles();
 
+    String getLastRecertificator();
+
+    void setLastRecertificator(String lastRecertificator);
+
+    Date getLastRecertification();
+
+    void setLastRecertification(Date lastRecertificion);
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
index 7969824..1cb4d86 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
@@ -136,6 +136,7 @@ public class JPAUser
     @Temporal(TemporalType.TIMESTAMP)
     private Date lastLoginDate;
 
+ 
     /**
      * Change password date.
      */
@@ -184,6 +185,14 @@ public class JPAUser
     @Column(nullable = true)
     private String securityAnswer;
 
+    @Column(nullable = true)
+    private String lastRecertificator;
+
+    @Column(nullable = true)
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date lastRecertification;
+
+    
     @Override
     public AnyType getType() {
         return ApplicationContextProvider.getBeanFactory().getBean(AnyTypeDAO.class).findUser();
@@ -489,4 +498,25 @@ public class JPAUser
     public List<? extends UMembership> getMemberships() {
         return memberships;
     }
+
+    @Override
+    public String getLastRecertificator() {
+        return lastRecertificator;
+    }
+
+    @Override
+    public void setLastRecertificator(final String lastRecertificator) {
+        this.lastRecertificator = lastRecertificator;
+    }
+
+    @Override
+    public Date getLastRecertification() {
+        return lastRecertification;
+    }
+
+    @Override
+    public void setLastRecertification(final Date lastRecertification) {
+        this.lastRecertification = lastRecertification;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
index c534a44..e730aed 100644
--- a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
@@ -138,6 +138,9 @@ under the License.
   <PlainSchema id="email" type="String" anyTypeClass_id="BaseUser"
                mandatoryCondition="false" multivalue="0" uniqueConstraint="0" readonly="0"
                validatorClass="org.apache.syncope.core.persistence.jpa.attrvalue.validation.EmailAddressValidator"/>
+
+  <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task"  active="1"
+        jobDelegateClassName="org.apache.syncope.core.provisioning.java.job.IdentityRecertification" cronExpression="0 0 0 0 0 0"/>
   
   <!-- Password reset notifications -->
   <MailTemplate id="requestPasswordReset"

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainSchemaTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainSchemaTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainSchemaTest.java
index 722eb5f..918f9fc 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainSchemaTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainSchemaTest.java
@@ -47,7 +47,7 @@ public class PlainSchemaTest extends AbstractTest {
     @Test
     public void findAll() {
         List<PlainSchema> schemas = plainSchemaDAO.findAll();
-        assertEquals(38, schemas.size());
+        assertEquals(39, schemas.size());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
index ca11c3f..c77b312 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
@@ -97,7 +97,7 @@ public class TaskTest extends AbstractTest {
     public void findAll() {
         assertEquals(5, taskDAO.findAll(TaskType.PROPAGATION).size());
         assertEquals(1, taskDAO.findAll(TaskType.NOTIFICATION).size());
-        assertEquals(1, taskDAO.findAll(TaskType.SCHEDULED).size());
+        assertEquals(2, taskDAO.findAll(TaskType.SCHEDULED).size());
         assertEquals(10, taskDAO.findAll(TaskType.PULL).size());
         assertEquals(11, taskDAO.findAll(TaskType.PUSH).size());
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
index 610c1cf..1fae96b 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -125,6 +125,15 @@ under the License.
   <CPlainAttrValue id="e5fa94db-b524-4309-908d-8198d0b3f779"
                    attribute_id="bcfd7efc-0605-4b5e-b4bb-85c1d5f6493a" booleanValue="0"/>
   
+  <!-- Identity Recertification interval in days -->                   
+  <SyncopeSchema id="identity.recertification.day.interval"/>
+  <PlainSchema id="identity.recertification.day.interval" type="Long"
+               mandatoryCondition="false" multivalue="0" uniqueConstraint="0" readonly="0"/>
+  <CPlainAttr id="bcfd7efc-0605-4b5e-b4bb-85c1d5f64bbb"
+              owner_id="cd64d66f-6fff-4008-b966-a06b1cc1436d" schema_id="identity.recertification.day.interval"/>
+  <CPlainAttrValue id="e5fa94db-b524-4309-908d-8198d0b3f77b"
+                   attribute_id="bcfd7efc-0605-4b5e-b4bb-85c1d5f64bbb" longValue="365"/>
+    
   <!-- sample policies -->
   <PullPolicy id="66691e96-285f-4464-bc19-e68384ea4c85" description="a pull policy"
               specification='{"conflictResolutionAction":"IGNORE"}'/>
@@ -461,7 +470,7 @@ under the License.
   <SyncopeSchema id="mderToBePropagated"/>
   <DerSchema id="mderToBePropagated" expression="mderived_sx + '-' + mderived_dx" 
              anyTypeClass_id="generic membership"/>
-        
+         
   <SyncopeSchema id="model"/>
   <PlainSchema id="model" type="String" anyTypeClass_id="minimal printer"
                mandatoryCondition="false" multivalue="0" uniqueConstraint="0" readonly="0"/>
@@ -1052,6 +1061,8 @@ under the License.
                        template='{"@class":"org.apache.syncope.common.lib.to.GroupTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"GROUP","realm":null,"status":null,"name":null,"userOwner":null,"groupOwner":null,"udynMembershipCond":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"plainAttrs":[]}'/>
   <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec597979" name="SampleJob Task"  active="1"
         jobDelegateClassName="org.apache.syncope.fit.core.reference.TestSampleJobDelegate" cronExpression="0 0 0 1 * ?"/>
+  <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task"  active="1"
+        jobDelegateClassName="org.apache.syncope.core.provisioning.java.job.IdentityRecertification" cronExpression="0 0 0 1 * ?"/>
   <Task DTYPE="PropagationTask" id="d6c2d6d3-6329-44c1-9187-f1469ead1cfa" operation="UPDATE"
         objectClassName="__ACCOUNT__" resource_id="ws-target-resource-nopropagation" anyTypeKind="USER" entityKey="1417acbe-cbf6-4277-9372-e75e04f97000"
         attributes='[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"fullname","value":["fullname"]},{"name":"type","value":["type"]}]'/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
new file mode 100755
index 0000000..463495e
--- /dev/null
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.java.job;
+
+import java.util.Date;
+import org.apache.syncope.core.persistence.api.dao.ConfDAO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.conf.CPlainAttr;
+import org.apache.syncope.core.persistence.api.entity.task.TaskExec;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.workflow.api.UserWorkflowAdapter;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class IdentityRecertification extends AbstractSchedTaskJobDelegate {
+
+    @Autowired
+    private UserDAO userDao;
+
+    @Autowired 
+    private UserWorkflowAdapter engine;
+    
+    @Autowired
+    private ConfDAO confDAO;
+
+    private long recertificationTimeLong = -1;
+
+    public static final String RECERTIFICATION_TIME = "identity.recertification.day.interval";
+
+    @Override
+    protected String doExecute(final boolean dryRun) throws JobExecutionException {
+
+        LOG.info("TestIdentityRecertification {} running [SchedTask {}]", (dryRun
+              ? "dry "
+              : ""), task.getKey());
+        init();
+
+        if (recertificationTimeLong == -1) {
+            LOG.debug("Identity Recertification disabled");
+            return ("IDENTITY RECERT DISABLED");
+        }
+
+        for (User u :userDao.findAll()) {
+            LOG.debug("Processing user: {}", u.getUsername());
+
+            if (u.getWorkflowId() != null && !u.getWorkflowId().equals("")
+                    && toBeRecertified(u) && !dryRun) {
+                engine.requestCertify(u);
+            } else {
+                LOG.warn("Workflow for user: {} is null or empty", u.getUsername());
+            }
+        }
+
+        return (dryRun
+                ? "DRY "
+                : "") + "RUNNING";
+    }
+
+    public void init() {
+        CPlainAttr recertificationTime = confDAO.find(RECERTIFICATION_TIME);
+        if (recertificationTime == null || recertificationTime.getValues().get(0).getLongValue() == null) {
+            recertificationTimeLong = -1;
+            return;
+        }
+        recertificationTimeLong = recertificationTime.getValues().get(0).getLongValue() * 1000 * 60 * 60 * 24;
+    }
+
+    public boolean toBeRecertified(final User user) {
+
+        Date lastCertificationDate = user.getLastRecertification();
+
+        if (lastCertificationDate != null) {
+            if (lastCertificationDate.getTime() + recertificationTimeLong < System.currentTimeMillis()) {
+                LOG.debug("User:  {}  to be recertified", user.getUsername());
+                return true;
+            } else {
+                LOG.debug("User: {} do not needs to be recertified", user.getUsername());
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @Override
+    protected boolean hasToBeRegistered(final TaskExec execution) {
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
index e74aade..27b377f 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
@@ -195,7 +195,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
      * Saves resources to be propagated and password for later - after form submission - propagation.
      *
      * @param user user
-     * @param password pasword
+     * @param password password
      * @param propByRes current propagation actions against resources
      */
     protected void saveForFormSubmit(final User user, final String password, final PropagationByResource propByRes) {
@@ -349,11 +349,29 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
+    public WorkflowResult<String> requestCertify(final User user) {
+        String authUser = AuthContextUtils.getUsername();
+        engine.getRuntimeService().setVariable(user.getWorkflowId(), FORM_SUBMITTER, authUser);
+
+        LOG.debug("Executing request-certify");
+        Set<String> performedTasks = doExecuteTask(user, "request-certify", null);
+                
+        PropagationByResource propByRes = engine.getRuntimeService().getVariable(
+                user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
+
+        saveForFormSubmit(
+                user, null, propByRes);
+                
+        return new WorkflowResult<>(user.getKey(), null, performedTasks);
+    }
+
+    @Override
     protected WorkflowResult<String> doSuspend(final User user) {
         Set<String> performedTasks = doExecuteTask(user, "suspend", null);
         updateStatus(user);
         User updated = userDAO.save(user);
 
+
         return new WorkflowResult<>(updated.getKey(), null, performedTasks);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java
new file mode 100644
index 0000000..13908b2
--- /dev/null
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.workflow.activiti.task;
+
+import java.util.Date;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
+import org.apache.syncope.core.persistence.api.entity.EntityFactory;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.workflow.activiti.ActivitiUserWorkflowAdapter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Recertify extends AbstractActivitiServiceTask {
+
+    @Autowired
+    protected UserDAO userDAO;
+
+    @Autowired
+    protected EntityFactory entityFactory;
+
+    @Autowired
+    protected AnyUtilsFactory anyUtilsFactory;
+
+    @Override
+    protected void doExecute(final String executionId) {
+
+        LOG.debug("Processing Recertification {}", executionId);
+        User user = engine.getRuntimeService().
+                getVariable(executionId, ActivitiUserWorkflowAdapter.USER, User.class);
+        String submitter = engine.getRuntimeService().
+                getVariable(executionId, ActivitiUserWorkflowAdapter.FORM_SUBMITTER, String.class);
+
+        LOG.debug("Saving Recertification information for user {}", user.getUsername());
+
+        user.setLastRecertificator(submitter);
+        user.setLastRecertification(new Date(System.currentTimeMillis()));
+
+        userDAO.save(user);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml b/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
index 510ce9f..f33f958 100644
--- a/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
+++ b/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
@@ -82,12 +82,47 @@ under the License.
     
     <serviceTask id="delete" name="Delete" activiti:expression="#{delete.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
+    <!-- Recertification tasks -->
+    <userTask id="RecertificationRequest" name="Recertification Request" activiti:formKey="recertify">
+      <extensionElements>
+        <activiti:formProperty id="fullname" name="Identity" type="string" expression="${user.getPlainAttr('fullname').getUniqueValue().getStringValue()}" writable="false"/> 
+        <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+        <activiti:formProperty id="approve" name="Recertify?" type="boolean" required="true"/>
+        <activiti:formProperty id="rejectReason" name="Reason for not recertifying" type="string" variable="rejectReason"/>
+      </extensionElements>
+    </userTask>
+    <serviceTask id="recertify-task" name="Recertify" activiti:expression="#{recertify.execute(execution.processInstanceId)}"/>
+    <sequenceFlow id="recert-request-start-flow" sourceRef="activeGw" targetRef="RecertificationRequest">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'request-certify'}]]></conditionExpression>
+    </sequenceFlow>
+    <exclusiveGateway id="recert-condition"/>
+    <sequenceFlow id="recert-flow1" sourceRef="RecertificationRequest" targetRef="recertify-task"/>
+    <sequenceFlow id="recert-flow2" sourceRef="recertify-task" targetRef="recert-condition"/>
+    <sequenceFlow id="recert-approved-flow" sourceRef="recert-condition" targetRef="active">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="recert-denied-flow" sourceRef="recert-condition" targetRef="suspend">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+    </sequenceFlow>
+    <!-- End Recertification flow -->
     <endEvent id="theEnd"/>
   </process>
   
   <bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
     <bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
-      <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
+      <bpmndi:BPMNShape bpmnElement="RecertificationRequest" id="BPMNShape_RecertificationRequest">
+        <omgdc:Bounds height="80.0" width="100.0" x="1370.0" y="375.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="recertify-task" id="BPMNShape_recertify-task">
+        <omgdc:Bounds height="80.0" width="100.0" x="1230.0" y="375.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
+        <omgdc:Bounds height="28.0" width="28.0" x="2080.0" y="451.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
+        <omgdc:Bounds height="39.99999999999994" width="40.0" x="1178.1817939458806" y="475.4545368832992"/>
+      </bpmndi:BPMNShape>
+     <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
         <omgdc:Bounds height="30.0" width="30.0" x="540.0" y="525.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
@@ -135,6 +170,26 @@ under the License.
       <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
         <omgdc:Bounds height="80.0" width="100.0" x="828.286878319943" y="500.0"/>
       </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
+        <omgdi:waypoint x="1194.0489013105641" y="511.3216442479827"/>
+        <omgdi:waypoint x="1194.0489013105641" y="541.0"/>
+        <omgdi:waypoint x="1130.0" y="541.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
+        <omgdi:waypoint x="1280.0" y="455.0"/>
+        <omgdi:waypoint x="1280.0" y="495.45453688329917"/>
+        <omgdi:waypoint x="1218.1817939458806" y="495.45453688329917"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
+        <omgdi:waypoint x="1370.0" y="415.0"/>
+        <omgdi:waypoint x="1330.0" y="415.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
+        <omgdi:waypoint x="1198.1817939458806" y="475.4545368832992"/>
+        <omgdi:waypoint x="1198.1817939458806" y="313.6363529725508"/>
+        <omgdi:waypoint x="1540.0" y="313.6363529725508"/>
+        <omgdi:waypoint x="1540.0" y="370.0"/>
+      </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
         <omgdi:waypoint x="1990.0" y="290.0"/>
         <omgdi:waypoint x="1990.0" y="261.0"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
index 91487ee..6a02d50 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
@@ -22,6 +22,7 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.common.lib.patch.UserPatch;
 import org.apache.syncope.core.provisioning.api.WorkflowResult;
 import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
 
 /**
  * Interface for calling underlying workflow implementations.
@@ -60,6 +61,10 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
     WorkflowResult<Pair<String, Boolean>> create(
             UserTO userTO, boolean disablePwdPolicyCheck, final Boolean enabled, boolean storePassword);
 
+
+    WorkflowResult<String> requestCertify(final User user);
+
+    
     /**
      * Execute a task on an user.
      *

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
index 2df0b77..878fe1b 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
@@ -207,4 +207,9 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         throw new WorkflowException(new UnsupportedOperationException("Not supported."));
     }
 
+    @Override
+    public WorkflowResult<String> requestCertify(final User user) {
+        throw new UnsupportedOperationException("Not supported."); 
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
index 0c1dd97..521affe 100644
--- a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
+++ b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
@@ -187,6 +187,29 @@ try {
     <sequenceFlow id="flow8ter" sourceRef="rejectUpdate" targetRef="active"/>
     <serviceTask id="update" name="Update" activiti:expression="#{update.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow9" sourceRef="update" targetRef="active"/>
+    <!-- Recertification tasks -->
+    <userTask id="RecertificationRequest" name="Recertification Request" activiti:candidateGroups="managingDirector" activiti:formKey="recertify">
+      <extensionElements>
+        <activiti:formProperty id="fullname" name="Identity" type="string" expression="${user.getPlainAttr('fullname').getUniqueValue().getStringValue()}" writable="false"/> 
+        <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+        <activiti:formProperty id="approve" name="Recertify?" type="boolean" required="true"/>
+        <activiti:formProperty id="rejectReason" name="Reason for not recertifying" type="string" variable="rejectReason"/>
+      </extensionElements>
+    </userTask>
+    <serviceTask id="recertify-task" name="Recertify" activiti:expression="#{recertify.execute(execution.processInstanceId)}"/>
+    <sequenceFlow id="recert-request-start-flow" sourceRef="activeGw" targetRef="RecertificationRequest">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'request-certify'}]]></conditionExpression>
+    </sequenceFlow>
+    <exclusiveGateway id="recert-condition"/>
+    <sequenceFlow id="recert-flow1" sourceRef="RecertificationRequest" targetRef="recertify-task"/>
+    <sequenceFlow id="recert-flow2" sourceRef="recertify-task" targetRef="recert-condition"/>
+    <sequenceFlow id="recert-approved-flow" sourceRef="recert-condition" targetRef="active">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="recert-denied-flow" sourceRef="recert-condition" targetRef="suspend">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+    </sequenceFlow>
+    <!-- End Recertification flow -->
     <serviceTask id="suspend" name="Suspend" activiti:expression="#{suspend.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow10" sourceRef="suspend" targetRef="suspended"/>
     <userTask id="suspended" name="Suspended"/>
@@ -255,6 +278,15 @@ try {
   
   <bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
     <bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
+      <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
+        <omgdc:Bounds height="40.0" width="40.0" x="1439.4825360864054" y="12.176664483986166"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="recertify-task" id="BPMNShape_recertify-task">
+        <omgdc:Bounds height="80.0" width="100.0" x="1110.0" y="15.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="RecertificationRequest" id="BPMNShape_RecertificationRequest">
+        <omgdc:Bounds height="80.0" width="100.0" x="930.0" y="15.0"/>
+      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
         <omgdc:Bounds height="30.0" width="30.0" x="0.0" y="512.0"/>
       </bpmndi:BPMNShape>
@@ -648,6 +680,27 @@ try {
         <omgdi:waypoint x="2040.0" y="388.0"/>
         <omgdi:waypoint x="2078.1893792531678" y="388.0"/>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
+        <omgdi:waypoint x="1210.0" y="51.18953815900822"/>
+        <omgdi:waypoint x="1440.8987892500566" y="33.59291764763734"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
+        <omgdi:waypoint x="1030.0" y="55.0"/>
+        <omgdi:waypoint x="1110.0" y="55.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
+        <omgdi:waypoint x="1479.438749881016" y="32.13287827859691"/>
+        <omgdi:waypoint x="1540.0" y="32.0"/>
+        <omgdi:waypoint x="1540.0" y="100.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
+        <omgdi:waypoint x="1450.9385750878846" y="43.63270348546535"/>
+        <omgdi:waypoint x="1102.3741233704363" y="511.0"/>
+      </bpmndi:BPMNEdge>
+       <bpmndi:BPMNEdge bpmnElement="recert-request-start-flow" id="BPMNEdge_recert-request-start-flow">
+        <omgdi:waypoint x="1410.4864864864865" y="529.5135135135135"/>
+        <omgdi:waypoint x="1016.2886597938144" y="95.0"/>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
-</definitions>
+</definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java
new file mode 100755
index 0000000..9416d79
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.fit.core;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
+import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class RecertificationITCase extends AbstractTaskITCase{
+
+    @Test
+    public void recertification() {
+        execTask(taskService, "e95555d2-1b09-42c8-b25b-f4c4ec598989", "JOB_FIRED", 10, false);
+
+        List<WorkflowFormTO> forms = userWorkflowService.getForms();
+        assertFalse(forms.isEmpty());
+        for (WorkflowFormTO f : forms) {
+            userWorkflowService.claimForm(f.getTaskId());
+            WorkflowFormPropertyTO w = f.getPropertyMap().get("approve");
+            w.setValue("true");
+            userWorkflowService.submitForm(f);
+        }
+
+        forms = userWorkflowService.getForms();
+        assertTrue(forms.isEmpty());
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4978f52..b79667f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -197,6 +197,16 @@ under the License.
       <url>http://people.apache.org/~anzelld/</url>
     </developer>
     <developer>
+      <id>nscendoni</id>
+      <name>Nicola Scendoni</name>
+      <organization>The Apache Software Foundation</organization>
+      <organizationUrl>http://www.apache.org/</organizationUrl>
+      <roles>
+        <role>committer</role>
+      </roles>
+      <url></url>
+    </developer>
+    <developer>
       <id>coheigea</id>
       <name>Colm O hEigeartaigh</name>
       <organization>Talend</organization>

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
index 3fb6d15..96a6ca7 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
@@ -39,6 +39,6 @@ application) is allowed;
 * `authentication.statuses` - the list of <<workflow,workflow>> statuses for which users are allowed to authenticate;
 * `log.lastlogindate` - whether the system updates the `lastLoginDate` field of users upon authentication;
 * `tasks.interruptMaxRetries` - how many attempts shall be made when interrupting a running <<task,task>>;
-* `return.password.value` - whether the hashed password value shall be returned when reading users.
-
+* `return.password.value` - whether the hashed password value shall be returned when reading users;
+* `identity.recertification.day.interval` - Number of days bewteen identity recertifications.
 Besides this default set, new configuration parameters can be defined to support <<customization,custom>> code.

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc
new file mode 100644
index 0000000..138ad51
--- /dev/null
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc
@@ -0,0 +1,50 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+==== Identity Recertification
+
+Recertification is the process to review all the identities and access within one organization. This is a tipical countermeasure against the  __privilege creep__, that is the rentention of accounts during time even when the user change his role, or even his job. Ths good practice is recomendded and often required by international or organizational standards.
+
+Tipically every "object" within one IDM system needs to be periodically re-certified:
+
+* Identities: Is the user still valid for the organization?
+* Accounts: Is thie user still using this account?
+* Group Membership/Entitlements: Does the user require this functionality?
+
+One simple scheduled job to implement Identity Recertification is provided. The class name is: __org.apache.syncope.core.provisioning.java.job.IdentityRecertification__ .
+It can be used as base to implement more complex recertification processes.
+It go through all the users and check if they have been recertified the past __identity.recertification.day.interval__ days. This is a global Parameter that can be set using Syncope Console or REST webservices.
+The recertificaton task implemented by default set two attributes for each users:
+- lastRertificator: the name of the user that re-certified the user
+- lastRecertiication: the date when the re-certification is performed
+This task is implement by the class: __org.apache.syncope.core.workflow.activiti.task.Recertify__
+The certificator can be defined modifying the task: "Create Recertification". Actviti is very flexible, and allows to define approver user, groups, or even to use expression language to define approvers from attributes from the user, for example the user manager.
+
+Example 1: Certifier users are members of managingDirector group:
+=====================================================================
+    <userTask id="createApproval" name="Create approval"
+              activiti:candidateGroups="managingDirector" 
+              activiti:formKey="createApproval">
+=====================================================================
+
+Example 2: Certifier user is the user manager defined in the user attribute: __lastRecertificator__
+=====================================================================
+    < userTask id = "createApproval" name = "Create Recertification"
+               activiti:candidateGroups="${user.lastRecertificator}" 
+               activiti:formKey="createApproval">
+=====================================================================

http://git-wip-us.apache.org/repos/asf/syncope/blob/2191c595/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
index 016c391..e7e61d8 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
@@ -70,4 +70,6 @@ include::connectorbundles.adoc[]
 
 include::emailconfiguration.adoc[]
 
+include::identityrecertification.adoc[]
+
 include::configurationparameters.adoc[]


[2/2] syncope git commit: [SYNCOPE-880] Cleanup, finalize, rework - This closes #26

Posted by il...@apache.org.
[SYNCOPE-880] Cleanup, finalize, rework - This closes #26


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/f17be3cf
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/f17be3cf
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/f17be3cf

Branch: refs/heads/master
Commit: f17be3cf91d484595a632d01761a62b1b1d29b34
Parents: 2191c59
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Mon Sep 5 15:01:08 2016 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Mon Sep 5 15:01:23 2016 +0200

----------------------------------------------------------------------
 .../persistence/jpa/entity/user/JPAUser.java    |  56 +-
 .../main/resources/domains/MasterContent.xml    |  13 +-
 .../test/resources/domains/MasterContent.xml    |   4 +-
 .../java/job/IdentityRecertification.java       |  90 +--
 .../activiti/ActivitiUserWorkflowAdapter.java   |   8 +-
 .../core/workflow/activiti/task/Recertify.java  |   1 -
 .../src/main/resources/userWorkflow.bpmn20.xml  |  13 +-
 .../core/workflow/api/UserWorkflowAdapter.java  |  10 +-
 .../java/DefaultUserWorkflowAdapter.java        |   2 +-
 .../src/main/resources/userWorkflow.bpmn20.xml  | 611 +++++++++----------
 .../syncope/fit/core/RecertificationITCase.java |  15 +-
 pom.xml                                         |   1 -
 .../reference-guide/concepts/workflow.adoc      |  55 ++
 .../configurationparameters.adoc                |   4 +-
 .../identityrecertification.adoc                |  50 --
 .../systemadministration.adoc                   |   2 -
 16 files changed, 473 insertions(+), 462 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
index 1cb4d86..eb865ab 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
@@ -136,7 +136,6 @@ public class JPAUser
     @Temporal(TemporalType.TIMESTAMP)
     private Date lastLoginDate;
 
- 
     /**
      * Change password date.
      */
@@ -144,6 +143,13 @@ public class JPAUser
     @Temporal(TemporalType.TIMESTAMP)
     private Date changePwdDate;
 
+    @Column(nullable = true)
+    private String lastRecertificator;
+
+    @Column(nullable = true)
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date lastRecertification;
+
     @Basic
     @Min(0)
     @Max(1)
@@ -185,14 +191,6 @@ public class JPAUser
     @Column(nullable = true)
     private String securityAnswer;
 
-    @Column(nullable = true)
-    private String lastRecertificator;
-
-    @Column(nullable = true)
-    @Temporal(TemporalType.TIMESTAMP)
-    private Date lastRecertification;
-
-    
     @Override
     public AnyType getType() {
         return ApplicationContextProvider.getBeanFactory().getBean(AnyTypeDAO.class).findUser();
@@ -397,6 +395,26 @@ public class JPAUser
     }
 
     @Override
+    public String getLastRecertificator() {
+        return lastRecertificator;
+    }
+
+    @Override
+    public void setLastRecertificator(final String lastRecertificator) {
+        this.lastRecertificator = lastRecertificator;
+    }
+
+    @Override
+    public Date getLastRecertification() {
+        return lastRecertification;
+    }
+
+    @Override
+    public void setLastRecertification(final Date lastRecertification) {
+        this.lastRecertification = lastRecertification;
+    }
+
+    @Override
     public String getUsername() {
         return username;
     }
@@ -499,24 +517,4 @@ public class JPAUser
         return memberships;
     }
 
-    @Override
-    public String getLastRecertificator() {
-        return lastRecertificator;
-    }
-
-    @Override
-    public void setLastRecertificator(final String lastRecertificator) {
-        this.lastRecertificator = lastRecertificator;
-    }
-
-    @Override
-    public Date getLastRecertification() {
-        return lastRecertification;
-    }
-
-    @Override
-    public void setLastRecertification(final Date lastRecertification) {
-        this.lastRecertification = lastRecertification;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
index e730aed..05f3921 100644
--- a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
@@ -125,6 +125,15 @@ under the License.
   <CPlainAttrValue id="e5fa94db-b524-4309-908d-8198d0b3f779"
                    attribute_id="bcfd7efc-0605-4b5e-b4bb-85c1d5f6493a" booleanValue="0"/>
 
+  <!-- Identity Recertification interval in days -->                   
+  <SyncopeSchema id="identity.recertification.day.interval"/>
+  <PlainSchema id="identity.recertification.day.interval" type="Long"
+               mandatoryCondition="false" multivalue="0" uniqueConstraint="0" readonly="0"/>
+  <CPlainAttr id="bcfd7efc-0605-4b5e-b4bb-85c1d5f64bbb"
+              owner_id="cd64d66f-6fff-4008-b966-a06b1cc1436d" schema_id="identity.recertification.day.interval"/>
+  <CPlainAttrValue id="e5fa94db-b524-4309-908d-8198d0b3f77b"
+                   attribute_id="bcfd7efc-0605-4b5e-b4bb-85c1d5f64bbb" longValue="-1"/>
+  
   <AnyType id="USER" kind="USER"/>
   <AnyTypeClass id="BaseUser"/>
   <AnyType_AnyTypeClass anyType_id="USER" anyTypeClass_id="BaseUser"/>
@@ -139,8 +148,8 @@ under the License.
                mandatoryCondition="false" multivalue="0" uniqueConstraint="0" readonly="0"
                validatorClass="org.apache.syncope.core.persistence.jpa.attrvalue.validation.EmailAddressValidator"/>
 
-  <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task"  active="1"
-        jobDelegateClassName="org.apache.syncope.core.provisioning.java.job.IdentityRecertification" cronExpression="0 0 0 0 0 0"/>
+  <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task"  active="0"
+        jobDelegateClassName="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
   
   <!-- Password reset notifications -->
   <MailTemplate id="requestPasswordReset"

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
index 1fae96b..123da30 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -133,7 +133,7 @@ under the License.
               owner_id="cd64d66f-6fff-4008-b966-a06b1cc1436d" schema_id="identity.recertification.day.interval"/>
   <CPlainAttrValue id="e5fa94db-b524-4309-908d-8198d0b3f77b"
                    attribute_id="bcfd7efc-0605-4b5e-b4bb-85c1d5f64bbb" longValue="365"/>
-    
+
   <!-- sample policies -->
   <PullPolicy id="66691e96-285f-4464-bc19-e68384ea4c85" description="a pull policy"
               specification='{"conflictResolutionAction":"IGNORE"}'/>
@@ -1062,7 +1062,7 @@ under the License.
   <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec597979" name="SampleJob Task"  active="1"
         jobDelegateClassName="org.apache.syncope.fit.core.reference.TestSampleJobDelegate" cronExpression="0 0 0 1 * ?"/>
   <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task"  active="1"
-        jobDelegateClassName="org.apache.syncope.core.provisioning.java.job.IdentityRecertification" cronExpression="0 0 0 1 * ?"/>
+        jobDelegateClassName="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
   <Task DTYPE="PropagationTask" id="d6c2d6d3-6329-44c1-9187-f1469ead1cfa" operation="UPDATE"
         objectClassName="__ACCOUNT__" resource_id="ws-target-resource-nopropagation" anyTypeKind="USER" entityKey="1417acbe-cbf6-4277-9372-e75e04f97000"
         attributes='[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"fullname","value":["fullname"]},{"name":"type","value":["type"]}]'/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
index 463495e..65584db 100755
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
@@ -19,6 +19,7 @@
 package org.apache.syncope.core.provisioning.java.job;
 
 import java.util.Date;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.core.persistence.api.dao.ConfDAO;
 import org.apache.syncope.core.persistence.api.dao.UserDAO;
 import org.apache.syncope.core.persistence.api.entity.conf.CPlainAttr;
@@ -30,71 +31,76 @@ import org.springframework.beans.factory.annotation.Autowired;
 
 public class IdentityRecertification extends AbstractSchedTaskJobDelegate {
 
-    @Autowired
-    private UserDAO userDao;
+    private static final String RECERTIFICATION_TIME = "identity.recertification.day.interval";
 
-    @Autowired 
-    private UserWorkflowAdapter engine;
-    
     @Autowired
     private ConfDAO confDAO;
 
-    private long recertificationTimeLong = -1;
+    @Autowired
+    private UserDAO userDAO;
 
-    public static final String RECERTIFICATION_TIME = "identity.recertification.day.interval";
+    @Autowired
+    private UserWorkflowAdapter uwfAdapter;
 
-    @Override
-    protected String doExecute(final boolean dryRun) throws JobExecutionException {
+    private long recertificationTime = -1;
 
-        LOG.info("TestIdentityRecertification {} running [SchedTask {}]", (dryRun
-              ? "dry "
-              : ""), task.getKey());
-        init();
+    protected void init() {
+        synchronized (this) {
+            if (recertificationTime == -1) {
+                CPlainAttr recertificationTimeAttr = confDAO.find(RECERTIFICATION_TIME);
+                if (recertificationTimeAttr == null
+                        || recertificationTimeAttr.getValues().get(0).getLongValue() == null) {
 
-        if (recertificationTimeLong == -1) {
-            LOG.debug("Identity Recertification disabled");
-            return ("IDENTITY RECERT DISABLED");
+                    recertificationTime = -1;
+                    return;
+                }
+
+                recertificationTime = recertificationTimeAttr.getValues().get(0).getLongValue() * 1000 * 60 * 60 * 24;
+            }
         }
+    }
 
-        for (User u :userDao.findAll()) {
-            LOG.debug("Processing user: {}", u.getUsername());
+    protected boolean isToBeRecertified(final User user) {
+        Date lastCertificationDate = user.getLastRecertification();
 
-            if (u.getWorkflowId() != null && !u.getWorkflowId().equals("")
-                    && toBeRecertified(u) && !dryRun) {
-                engine.requestCertify(u);
+        if (lastCertificationDate != null) {
+            if (lastCertificationDate.getTime() + recertificationTime < System.currentTimeMillis()) {
+                LOG.debug("{} is to be recertified", user);
+                return true;
             } else {
-                LOG.warn("Workflow for user: {} is null or empty", u.getUsername());
+                LOG.debug("{} do not need to be recertified", user);
+                return false;
             }
         }
 
-        return (dryRun
-                ? "DRY "
-                : "") + "RUNNING";
+        return true;
     }
 
-    public void init() {
-        CPlainAttr recertificationTime = confDAO.find(RECERTIFICATION_TIME);
-        if (recertificationTime == null || recertificationTime.getValues().get(0).getLongValue() == null) {
-            recertificationTimeLong = -1;
-            return;
-        }
-        recertificationTimeLong = recertificationTime.getValues().get(0).getLongValue() * 1000 * 60 * 60 * 24;
-    }
+    @Override
+    protected String doExecute(final boolean dryRun) throws JobExecutionException {
+        LOG.info("IdentityRecertification {} running [SchedTask {}]", (dryRun
+                ? "dry "
+                : ""), task.getKey());
 
-    public boolean toBeRecertified(final User user) {
+        init();
+        if (recertificationTime == -1) {
+            LOG.debug("Identity Recertification disabled");
+            return ("IDENTITY RECERTIFICATION DISABLED");
+        }
 
-        Date lastCertificationDate = user.getLastRecertification();
+        for (User user : userDAO.findAll()) {
+            LOG.debug("Processing user: {}", user.getUsername());
 
-        if (lastCertificationDate != null) {
-            if (lastCertificationDate.getTime() + recertificationTimeLong < System.currentTimeMillis()) {
-                LOG.debug("User:  {}  to be recertified", user.getUsername());
-                return true;
+            if (StringUtils.isNotBlank(user.getWorkflowId()) && isToBeRecertified(user) && !dryRun) {
+                uwfAdapter.requestCertify(user);
             } else {
-                LOG.debug("User: {} do not needs to be recertified", user.getUsername());
-                return false;
+                LOG.warn("Workflow for {} is null or empty", user);
             }
         }
-        return true;
+
+        return (dryRun
+                ? "DRY "
+                : "") + "RUNNING";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
index 27b377f..d524831 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
@@ -355,13 +355,12 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
 
         LOG.debug("Executing request-certify");
         Set<String> performedTasks = doExecuteTask(user, "request-certify", null);
-                
+
         PropagationByResource propByRes = engine.getRuntimeService().getVariable(
                 user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
 
-        saveForFormSubmit(
-                user, null, propByRes);
-                
+        saveForFormSubmit(user, null, propByRes);
+
         return new WorkflowResult<>(user.getKey(), null, performedTasks);
     }
 
@@ -371,7 +370,6 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         updateStatus(user);
         User updated = userDAO.save(user);
 
-
         return new WorkflowResult<>(updated.getKey(), null, performedTasks);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java
index 13908b2..d597a9a 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/Recertify.java
@@ -41,7 +41,6 @@ public class Recertify extends AbstractActivitiServiceTask {
 
     @Override
     protected void doExecute(final String executionId) {
-
         LOG.debug("Processing Recertification {}", executionId);
         User user = engine.getRuntimeService().
                 getVariable(executionId, ActivitiUserWorkflowAdapter.USER, User.class);

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml b/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
index f33f958..fadeb80 100644
--- a/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
+++ b/core/workflow-activiti/src/main/resources/userWorkflow.bpmn20.xml
@@ -83,7 +83,7 @@ under the License.
     <serviceTask id="delete" name="Delete" activiti:expression="#{delete.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
     <!-- Recertification tasks -->
-    <userTask id="RecertificationRequest" name="Recertification Request" activiti:formKey="recertify">
+    <userTask id="recertificationRequest" name="Recertification Request" activiti:formKey="recertify">
       <extensionElements>
         <activiti:formProperty id="fullname" name="Identity" type="string" expression="${user.getPlainAttr('fullname').getUniqueValue().getStringValue()}" writable="false"/> 
         <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
@@ -92,11 +92,11 @@ under the License.
       </extensionElements>
     </userTask>
     <serviceTask id="recertify-task" name="Recertify" activiti:expression="#{recertify.execute(execution.processInstanceId)}"/>
-    <sequenceFlow id="recert-request-start-flow" sourceRef="activeGw" targetRef="RecertificationRequest">
+    <sequenceFlow id="recert-request-start-flow" sourceRef="activeGw" targetRef="recertificationRequest">
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'request-certify'}]]></conditionExpression>
     </sequenceFlow>
     <exclusiveGateway id="recert-condition"/>
-    <sequenceFlow id="recert-flow1" sourceRef="RecertificationRequest" targetRef="recertify-task"/>
+    <sequenceFlow id="recert-flow1" sourceRef="recertificationRequest" targetRef="recertify-task"/>
     <sequenceFlow id="recert-flow2" sourceRef="recertify-task" targetRef="recert-condition"/>
     <sequenceFlow id="recert-approved-flow" sourceRef="recert-condition" targetRef="active">
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
@@ -110,19 +110,16 @@ under the License.
   
   <bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
     <bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
-      <bpmndi:BPMNShape bpmnElement="RecertificationRequest" id="BPMNShape_RecertificationRequest">
+      <bpmndi:BPMNShape bpmnElement="recertificationRequest" id="BPMNShape_recertificationRequest">
         <omgdc:Bounds height="80.0" width="100.0" x="1370.0" y="375.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="recertify-task" id="BPMNShape_recertify-task">
         <omgdc:Bounds height="80.0" width="100.0" x="1230.0" y="375.0"/>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
-        <omgdc:Bounds height="28.0" width="28.0" x="2080.0" y="451.0"/>
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
         <omgdc:Bounds height="39.99999999999994" width="40.0" x="1178.1817939458806" y="475.4545368832992"/>
       </bpmndi:BPMNShape>
-     <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
+      <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
         <omgdc:Bounds height="30.0" width="30.0" x="540.0" y="525.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
index 6a02d50..d348b24 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
@@ -61,10 +61,14 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
     WorkflowResult<Pair<String, Boolean>> create(
             UserTO userTO, boolean disablePwdPolicyCheck, final Boolean enabled, boolean storePassword);
 
+    /**
+     * Request certification for the given user.
+     * 
+     * @param user user to be subject to recertification
+     * @return user just updated
+     */
+    WorkflowResult<String> requestCertify(User user);
 
-    WorkflowResult<String> requestCertify(final User user);
-
-    
     /**
      * Execute a task on an user.
      *

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
index 878fe1b..ff8bc45 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
@@ -209,7 +209,7 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
 
     @Override
     public WorkflowResult<String> requestCertify(final User user) {
-        throw new UnsupportedOperationException("Not supported."); 
+        throw new UnsupportedOperationException("Not supported.");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
index 521affe..aa811cf 100644
--- a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
+++ b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
@@ -69,7 +69,7 @@ try {
     execution.setVariable("task", null);
   }
 }]]></script>
-    </scriptTask>   
+    </scriptTask>
     <sequenceFlow id="sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991" sourceRef="CreateApprovalEvaluation" targetRef="createApprovalGW"/>
     <exclusiveGateway id="createApprovalGW" default="sid-76B82B68-099D-4729-B8CF-D028386FE900"/>
     <sequenceFlow id="sid-76B82B68-099D-4729-B8CF-D028386FE900" sourceRef="createApprovalGW" targetRef="createApproval"/>
@@ -187,21 +187,20 @@ try {
     <sequenceFlow id="flow8ter" sourceRef="rejectUpdate" targetRef="active"/>
     <serviceTask id="update" name="Update" activiti:expression="#{update.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow9" sourceRef="update" targetRef="active"/>
-    <!-- Recertification tasks -->
-    <userTask id="RecertificationRequest" name="Recertification Request" activiti:candidateGroups="managingDirector" activiti:formKey="recertify">
+    <userTask id="recertificationRequest" name="Recertification Request" activiti:candidateGroups="managingDirector" activiti:formKey="recertify">
       <extensionElements>
-        <activiti:formProperty id="fullname" name="Identity" type="string" expression="${user.getPlainAttr('fullname').getUniqueValue().getStringValue()}" writable="false"/> 
+        <activiti:formProperty id="fullname" name="Identity" type="string" expression="${user.getPlainAttr('fullname').getUniqueValue().getStringValue()}" writable="false"/>
         <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
         <activiti:formProperty id="approve" name="Recertify?" type="boolean" required="true"/>
         <activiti:formProperty id="rejectReason" name="Reason for not recertifying" type="string" variable="rejectReason"/>
       </extensionElements>
     </userTask>
+    <sequenceFlow id="recert-flow1" sourceRef="recertificationRequest" targetRef="recertify-task"/>
     <serviceTask id="recertify-task" name="Recertify" activiti:expression="#{recertify.execute(execution.processInstanceId)}"/>
-    <sequenceFlow id="recert-request-start-flow" sourceRef="activeGw" targetRef="RecertificationRequest">
+    <sequenceFlow id="recert-request-start-flow" sourceRef="activeGw" targetRef="recertificationRequest">
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'request-certify'}]]></conditionExpression>
     </sequenceFlow>
     <exclusiveGateway id="recert-condition"/>
-    <sequenceFlow id="recert-flow1" sourceRef="RecertificationRequest" targetRef="recertify-task"/>
     <sequenceFlow id="recert-flow2" sourceRef="recertify-task" targetRef="recert-condition"/>
     <sequenceFlow id="recert-approved-flow" sourceRef="recert-condition" targetRef="active">
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
@@ -260,446 +259,444 @@ try {
       ]]></script>
     </scriptTask>
     <sequenceFlow id="flow14ter" sourceRef="rejectDelete" targetRef="active"/>
-
     <serviceTask id="generateToken4PasswordReset" name="Generate token" activiti:expression="#{generateToken.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow15" sourceRef="generateToken4PasswordReset" targetRef="notify4RequestPasswordReset"/>
     <serviceTask id="notify4RequestPasswordReset" name="Notification" activiti:expression="#{notify.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow16" sourceRef="notify4RequestPasswordReset" targetRef="active"/>
-    
     <serviceTask id="checkToken4ConfirmPasswordReset" name="Check token, remove and update password" activiti:expression="#{passwordReset.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow17" sourceRef="checkToken4ConfirmPasswordReset" targetRef="notify4ConfirmPasswordReset"/>
     <serviceTask id="notify4ConfirmPasswordReset" name="Notification" activiti:expression="#{notify.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow18" sourceRef="notify4ConfirmPasswordReset" targetRef="active"/>
-    
     <serviceTask id="delete" name="Delete" activiti:expression="#{delete.execute(execution.processInstanceId)}"/>
     <sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
     <endEvent id="theEnd"/>
   </process>
-  
   <bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
     <bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
-      <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
-        <omgdc:Bounds height="40.0" width="40.0" x="1439.4825360864054" y="12.176664483986166"/>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="recertify-task" id="BPMNShape_recertify-task">
-        <omgdc:Bounds height="80.0" width="100.0" x="1110.0" y="15.0"/>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="RecertificationRequest" id="BPMNShape_RecertificationRequest">
-        <omgdc:Bounds height="80.0" width="100.0" x="930.0" y="15.0"/>
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
-        <omgdc:Bounds height="30.0" width="30.0" x="0.0" y="512.0"/>
+        <omgdc:Bounds height="30.0" width="30.0" x="335.0" y="253.87982696585692"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
-        <omgdc:Bounds height="60.0" width="100.0" x="80.0" y="497.0"/>
+        <omgdc:Bounds height="60.0" width="100.00000000000011" x="300.0" y="323.1197797747269"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="createGW" id="BPMNShape_createGW">
-        <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="507.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="330.0" y="507.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="createApproval" id="BPMNShape_createApproval">
-        <omgdc:Bounds height="60.0" width="100.0" x="320.0" y="560.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="420.0" y="560.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="CreateApprovalEvaluation" id="BPMNShape_CreateApprovalEvaluation">
+        <omgdc:Bounds height="80.0" width="100.0" x="420.0" y="732.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="createApprovalGW" id="BPMNShape_createApprovalGW">
-        <omgdc:Bounds height="40.0" width="40.0" x="470.0" y="570.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="570.0" y="570.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="enableGW" id="BPMNShape_enableGW">
-        <omgdc:Bounds height="40.0" width="40.0" x="590.0" y="429.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="690.0" y="429.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
-        <omgdc:Bounds height="60.0" width="100.0" x="710.0" y="610.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="810.0" y="610.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="generateToken" id="BPMNShape_generateToken">
-        <omgdc:Bounds height="60.0" width="100.0" x="710.0" y="213.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="810.0" y="213.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="created" id="BPMNShape_created">
-        <omgdc:Bounds height="60.0" width="100.0" x="852.0" y="213.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="952.0" y="213.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="optinGW" id="BPMNShape_optinGW">
-        <omgdc:Bounds height="40.0" width="40.0" x="1002.0" y="223.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="1102.0" y="223.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="removeToken" id="BPMNShape_removeToken">
-        <omgdc:Bounds height="60.0" width="100.0" x="1080.0" y="213.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1180.0" y="213.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="active" id="BPMNShape_active">
-        <omgdc:Bounds height="60.0" width="100.0" x="1030.0" y="511.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1130.0" y="511.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="activeGw" id="BPMNShape_activeGw">
-        <omgdc:Bounds height="40.0" width="40.0" x="1400.0" y="520.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="1500.0" y="520.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="updateApproval" id="BPMNShape_updateApproval">
-        <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="740.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1590.0" y="740.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="UpdateApprovalEvaluation" id="BPMNShape_UpdateApprovalEvaluation">
+        <omgdc:Bounds height="80.0" width="100.0" x="1590.0" y="824.5833282470703"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="updateApprovalGW" id="BPMNShape_updateApprovalGW">
-        <omgdc:Bounds height="40.0" width="40.0" x="1670.0" y="750.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="1770.0" y="750.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="rejectUpdate" id="BPMNShape_rejectUpdate">
-        <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="840.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1890.0" y="840.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="update" id="BPMNShape_update">
-        <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="700.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1890.0" y="700.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="recertificationRequest" id="BPMNShape_recertificationRequest">
+        <omgdc:Bounds height="80.0" width="100.0" x="1964.8786471876083" y="499.9999999999999"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="recertify-task" id="BPMNShape_recertify-task">
+        <omgdc:Bounds height="80.0" width="100.00000000000045" x="2106.1893792531678" y="500.0000000000001"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
+        <omgdc:Bounds height="40.0" width="40.0" x="2136.189379253168" y="410.85416175189727"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
-        <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="100.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1590.0" y="100.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="suspended" id="BPMNShape_suspended">
-        <omgdc:Bounds height="60.0" width="100.0" x="1640.0" y="120.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1740.0" y="120.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
-        <omgdc:Bounds height="40.0" width="40.0" x="1820.0" y="180.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="1920.0" y="180.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="reactivate" id="BPMNShape_reactivate">
-        <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="110.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="2040.0" y="110.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="reject" id="BPMNShape_reject">
-        <omgdc:Bounds height="60.0" width="100.0" x="560.0" y="659.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="660.0" y="659.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="rejected" id="BPMNShape_rejected">
-        <omgdc:Bounds height="60.0" width="100.0" x="710.0" y="770.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="810.0" y="770.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="rejectedGw" id="BPMNShape_rejectedGw">
-        <omgdc:Bounds height="40.0" width="40.0" x="890.0" y="780.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="990.0" y="780.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="deleteApproval" id="BPMNShape_deleteApproval">
-        <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="280.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1590.0" y="280.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="deleteApprovalGW" id="BPMNShape_deleteApprovalGW">
-        <omgdc:Bounds height="40.0" width="40.0" x="1670.0" y="300.0"/>
+        <omgdc:Bounds height="40.0" width="40.0" x="1770.0" y="300.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="rejectDelete" id="BPMNShape_rejectDelete">
-        <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="240.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1890.0" y="240.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
-        <omgdc:Bounds height="59.99999999999994" width="100.0" x="1543.209935088986" y="452.6749142927693"/>
+        <omgdc:Bounds height="59.99999999999994" width="100.0" x="1643.209935088986" y="452.6749142927693"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
-        <omgdc:Bounds height="60.00000000000006" width="100.0" x="1748.9712597675173" y="452.6749142927692"/>
+        <omgdc:Bounds height="60.00000000000006" width="100.0" x="1848.971259767517" y="452.6749142927692"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
-        <omgdc:Bounds height="60.0" width="100.0" x="1543.209935088986" y="561.167207412115"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1643.209935088986" y="561.167207412115"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
-        <omgdc:Bounds height="60.0" width="100.0" x="1748.971259767517" y="561.167207412115"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="1848.971259767517" y="561.167207412115"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
-        <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="358.0"/>
+        <omgdc:Bounds height="60.0" width="100.0" x="2220.0" y="358.0"/>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
-        <omgdc:Bounds height="28.0" width="28.0" x="2078.1893792531678" y="374.0"/>
+        <omgdc:Bounds height="28.0" width="28.0" x="2358.1893792531678" y="374.0"/>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="CreateApprovalEvaluation" id="BPMNShape_CreateApprovalEvaluation">
-        <omgdc:Bounds height="80.0" width="100.0" x="320.0" y="732.0"/>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="UpdateApprovalEvaluation" id="BPMNShape_UpdateApprovalEvaluation">
-        <omgdc:Bounds height="80.0" width="100.0" x="1490.0" y="824.5833282470703"/>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
-        <omgdi:waypoint x="1940.0" y="129.51612903225805"/>
-        <omgdi:waypoint x="1928.0" y="127.0"/>
-        <omgdi:waypoint x="1378.0" y="40.0"/>
-        <omgdi:waypoint x="1097.8443113772455" y="511.0"/>
+      <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1556.0" y="540.0"/>
+        <omgdi:waypoint x="1556.0" y="730.0"/>
+        <omgdi:waypoint x="1890.0" y="730.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
-        <omgdi:waypoint x="1740.0" y="150.0"/>
-        <omgdi:waypoint x="1752.0" y="150.0"/>
-        <omgdi:waypoint x="1752.0" y="200.0"/>
-        <omgdi:waypoint x="1820.0" y="200.0"/>
+      <bpmndi:BPMNEdge bpmnElement="sid-76B82B68-099D-4729-B8CF-D028386FE900" id="BPMNEdge_sid-76B82B68-099D-4729-B8CF-D028386FE900">
+        <omgdi:waypoint x="570.0" y="590.0"/>
+        <omgdi:waypoint x="520.0" y="590.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
-        <omgdi:waypoint x="1590.0" y="130.0"/>
-        <omgdi:waypoint x="1602.0" y="130.0"/>
-        <omgdi:waypoint x="1602.0" y="150.0"/>
-        <omgdi:waypoint x="1640.0" y="150.0"/>
+      <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1693.0" y="540.0"/>
+        <omgdi:waypoint x="1693.0868474125596" y="561.167207412115"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="sid-E58BBC2D-8831-4CF2-A798-14B258FE569B" id="BPMNEdge_sid-E58BBC2D-8831-4CF2-A798-14B258FE569B">
-        <omgdi:waypoint x="1670.4333333333334" y="770.4333333333333"/>
-        <omgdi:waypoint x="1590.0" y="770.1661129568106"/>
+      <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
+        <omgdi:waypoint x="990.0" y="800.0"/>
+        <omgdi:waypoint x="910.0" y="800.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
-        <omgdi:waypoint x="510.0" y="590.0"/>
-        <omgdi:waypoint x="522.0" y="590.0"/>
-        <omgdi:waypoint x="522.0" y="689.0"/>
-        <omgdi:waypoint x="560.0" y="689.0"/>
+      <bpmndi:BPMNEdge bpmnElement="sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991" id="BPMNEdge_sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991">
+        <omgdi:waypoint x="496.3736263736264" y="732.0"/>
+        <omgdi:waypoint x="582.0529801324503" y="602.0529801324503"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
-        <omgdi:waypoint x="1710.0" y="770.0"/>
-        <omgdi:waypoint x="1752.0" y="770.0"/>
-        <omgdi:waypoint x="1752.0" y="730.0"/>
-        <omgdi:waypoint x="1790.0" y="730.0"/>
+      <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1552.0" y="540.0"/>
+        <omgdi:waypoint x="1552.0" y="680.0"/>
+        <omgdi:waypoint x="2174.4835898825067" y="680.0"/>
+        <omgdi:waypoint x="2260.186670193408" y="418.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="rejected2Delete" id="BPMNEdge_rejected2Delete">
-        <omgdi:waypoint x="930.0" y="800.0"/>
-        <omgdi:waypoint x="972.0" y="800.0"/>
-        <omgdi:waypoint x="1223.0" y="1000.5833740234375"/>
-        <omgdi:waypoint x="1990.0" y="1000.5833740234375"/>
-        <omgdi:waypoint x="1990.0" y="418.0"/>
+      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2OptIn" id="BPMNEdge_createApprovalGW2OptIn">
+        <omgdi:waypoint x="730.0" y="449.0"/>
+        <omgdi:waypoint x="860.0" y="449.0"/>
+        <omgdi:waypoint x="860.0" y="273.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
-        <omgdi:waypoint x="1710.0" y="770.0"/>
-        <omgdi:waypoint x="1752.0" y="770.0"/>
-        <omgdi:waypoint x="1752.0" y="870.0"/>
-        <omgdi:waypoint x="1790.0" y="870.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="350.0" y="283.8798269658569"/>
+        <omgdi:waypoint x="350.0" y="323.1197797747269"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
-        <omgdi:waypoint x="1840.0" y="900.0"/>
-        <omgdi:waypoint x="1840.0" y="924.5833740234375"/>
-        <omgdi:waypoint x="1238.0" y="924.5833740234375"/>
-        <omgdi:waypoint x="1114.0" y="837.5833740234375"/>
-        <omgdi:waypoint x="1083.4391678338632" y="571.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="350.00000000000006" y="383.1197797747269"/>
+        <omgdi:waypoint x="350.0" y="507.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
-        <omgdi:waypoint x="1643.209935088986" y="591.167207412115"/>
-        <omgdi:waypoint x="1748.971259767517" y="591.167207412115"/>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="470.0" y="620.0"/>
+        <omgdi:waypoint x="470.0" y="732.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
-        <omgdi:waypoint x="1748.971259767517" y="619.2818713118841"/>
-        <omgdi:waypoint x="1673.0" y="662.0"/>
-        <omgdi:waypoint x="1130.0" y="551.2023608768972"/>
+      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
+        <omgdi:waypoint x="910.0" y="640.0"/>
+        <omgdi:waypoint x="922.0" y="640.0"/>
+        <omgdi:waypoint x="1059.0" y="640.0"/>
+        <omgdi:waypoint x="1143.3333333333333" y="571.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
-        <omgdi:waypoint x="1643.209935088986" y="482.67491429276924"/>
-        <omgdi:waypoint x="1748.9712597675173" y="482.67491429276924"/>
+      <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
+        <omgdi:waypoint x="1810.0" y="770.0"/>
+        <omgdi:waypoint x="1852.0" y="770.0"/>
+        <omgdi:waypoint x="1852.0" y="730.0"/>
+        <omgdi:waypoint x="1890.0" y="730.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
-        <omgdi:waypoint x="1748.9712597675173" y="459.5618225523418"/>
-        <omgdi:waypoint x="1592.0" y="387.0"/>
-        <omgdi:waypoint x="1130.0" y="525.9609375"/>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="910.0" y="243.0"/>
+        <omgdi:waypoint x="952.0" y="243.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
-        <omgdi:waypoint x="660.0" y="689.0"/>
-        <omgdi:waypoint x="672.0" y="689.0"/>
-        <omgdi:waypoint x="672.0" y="800.0"/>
-        <omgdi:waypoint x="710.0" y="800.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
+        <omgdi:waypoint x="1002.0" y="273.0"/>
+        <omgdi:waypoint x="1002.0" y="310.0"/>
+        <omgdi:waypoint x="1122.0" y="310.0"/>
+        <omgdi:waypoint x="1122.0" y="263.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
-        <omgdi:waypoint x="760.0" y="770.0"/>
-        <omgdi:waypoint x="760.0" y="732.0"/>
-        <omgdi:waypoint x="910.0" y="732.0"/>
-        <omgdi:waypoint x="910.0" y="780.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
+        <omgdi:waypoint x="1224.96644295302" y="273.0"/>
+        <omgdi:waypoint x="1185.03355704698" y="511.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
-        <omgdi:waypoint x="510.0" y="590.0"/>
-        <omgdi:waypoint x="522.0" y="590.0"/>
-        <omgdi:waypoint x="522.0" y="449.0"/>
-        <omgdi:waypoint x="590.0" y="449.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+        <omgdi:waypoint x="1230.0" y="540.8529411764706"/>
+        <omgdi:waypoint x="1500.058651026393" y="540.0586510263929"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
-        <omgdi:waypoint x="270.0" y="527.0"/>
-        <omgdi:waypoint x="282.0" y="527.0"/>
-        <omgdi:waypoint x="282.0" y="449.0"/>
-        <omgdi:waypoint x="590.0" y="449.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+        <omgdi:waypoint x="1990.0" y="730.0"/>
+        <omgdi:waypoint x="2037.0" y="730.0"/>
+        <omgdi:waypoint x="2037.0" y="946.0"/>
+        <omgdi:waypoint x="1336.0" y="946.0"/>
+        <omgdi:waypoint x="1180.0" y="844.0"/>
+        <omgdi:waypoint x="1180.0" y="571.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
-        <omgdi:waypoint x="1440.0" y="540.0"/>
-        <omgdi:waypoint x="1593.0" y="540.0"/>
-        <omgdi:waypoint x="1593.100069528527" y="512.6749142927692"/>
+      <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1552.0" y="540.0"/>
+        <omgdi:waypoint x="1552.0" y="130.0"/>
+        <omgdi:waypoint x="1590.0" y="130.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
-        <omgdi:waypoint x="1042.0" y="243.0"/>
-        <omgdi:waypoint x="1080.0" y="243.0"/>
+      <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
+        <omgdi:waypoint x="2156.189379253168" y="500.0000000000001"/>
+        <omgdi:waypoint x="2156.189379253168" y="450.85416175189727"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
-        <omgdi:waypoint x="270.0" y="527.0"/>
-        <omgdi:waypoint x="282.0" y="527.0"/>
-        <omgdi:waypoint x="282.0" y="590.0"/>
-        <omgdi:waypoint x="320.0" y="590.0"/>
+      <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
+        <omgdi:waypoint x="2064.8786471876083" y="540.0"/>
+        <omgdi:waypoint x="2106.1893792531678" y="540.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="sid-76B82B68-099D-4729-B8CF-D028386FE900" id="BPMNEdge_sid-76B82B68-099D-4729-B8CF-D028386FE900">
-        <omgdi:waypoint x="470.0" y="590.0"/>
+      <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
+        <omgdi:waypoint x="2156.189379253168" y="410.85416175189727"/>
+        <omgdi:waypoint x="2156.189379253168" y="53.25887430323031"/>
+        <omgdi:waypoint x="1640.0" y="53.2588743032303"/>
+        <omgdi:waypoint x="1640.0" y="100.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Active" id="BPMNEdge_createApprovalGW2Active">
+        <omgdi:waypoint x="730.0" y="449.0"/>
+        <omgdi:waypoint x="861.0" y="449.0"/>
+        <omgdi:waypoint x="861.0" y="541.0"/>
+        <omgdi:waypoint x="1130.0" y="541.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1554.0" y="540.0"/>
+        <omgdi:waypoint x="1554.0" y="770.0"/>
+        <omgdi:waypoint x="1590.0" y="770.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
+        <omgdi:waypoint x="370.0" y="527.0"/>
+        <omgdi:waypoint x="382.0" y="527.0"/>
+        <omgdi:waypoint x="382.0" y="590.0"/>
         <omgdi:waypoint x="420.0" y="590.0"/>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2" id="BPMNEdge_sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2">
-        <omgdi:waypoint x="1690.5" y="789.5"/>
-        <omgdi:waypoint x="1690.5" y="821.5833740234375"/>
-        <omgdi:waypoint x="1990.0" y="821.5833740234375"/>
-        <omgdi:waypoint x="1990.0" y="418.0"/>
+        <omgdi:waypoint x="1790.0" y="790.0"/>
+        <omgdi:waypoint x="1790.0" y="821.0"/>
+        <omgdi:waypoint x="2270.0" y="821.0"/>
+        <omgdi:waypoint x="2270.0" y="418.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
-        <omgdi:waypoint x="1790.0" y="260.7451923076923"/>
-        <omgdi:waypoint x="1424.0" y="193.0"/>
-        <omgdi:waypoint x="1109.655172413793" y="511.0"/>
+      <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
+        <omgdi:waypoint x="1810.0" y="320.0"/>
+        <omgdi:waypoint x="1852.0" y="320.0"/>
+        <omgdi:waypoint x="1852.0" y="388.0"/>
+        <omgdi:waypoint x="2220.0" y="388.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2OptIn" id="BPMNEdge_createApprovalGW2OptIn">
-        <omgdi:waypoint x="630.0" y="449.0"/>
-        <omgdi:waypoint x="760.0" y="449.0"/>
-        <omgdi:waypoint x="760.0" y="273.0"/>
+      <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
+        <omgdi:waypoint x="610.0" y="590.0"/>
+        <omgdi:waypoint x="622.0" y="590.0"/>
+        <omgdi:waypoint x="622.0" y="689.0"/>
+        <omgdi:waypoint x="660.0" y="689.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Activate" id="BPMNEdge_createApprovalGW2Activate">
-        <omgdi:waypoint x="630.0" y="449.0"/>
-        <omgdi:waypoint x="672.0" y="449.0"/>
-        <omgdi:waypoint x="672.0" y="640.0"/>
-        <omgdi:waypoint x="710.0" y="640.0"/>
+      <bpmndi:BPMNEdge bpmnElement="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" id="BPMNEdge_sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F">
+        <omgdi:waypoint x="1690.0" y="833.0555521647135"/>
+        <omgdi:waypoint x="1777.7342416529327" y="777.7342416529327"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
-        <omgdi:waypoint x="1440.0" y="540.0"/>
-        <omgdi:waypoint x="1454.0" y="540.0"/>
-        <omgdi:waypoint x="1454.0" y="310.0"/>
-        <omgdi:waypoint x="1490.0" y="310.0"/>
+      <bpmndi:BPMNEdge bpmnElement="rejected2Delete" id="BPMNEdge_rejected2Delete">
+        <omgdi:waypoint x="1030.0" y="800.0"/>
+        <omgdi:waypoint x="1072.0" y="800.0"/>
+        <omgdi:waypoint x="1323.0" y="1000.0"/>
+        <omgdi:waypoint x="2270.0" y="1000.0"/>
+        <omgdi:waypoint x="2270.0" y="418.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow14bis" id="BPMNEdge_flow14bis">
-        <omgdi:waypoint x="1590.0" y="310.0"/>
-        <omgdi:waypoint x="1602.0" y="310.0"/>
-        <omgdi:waypoint x="1602.0" y="320.0"/>
-        <omgdi:waypoint x="1670.0" y="320.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
+        <omgdi:waypoint x="1890.0" y="260.7451923076923"/>
+        <omgdi:waypoint x="1524.0" y="193.0"/>
+        <omgdi:waypoint x="1209.655172413793" y="511.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
-        <omgdi:waypoint x="1710.0" y="320.0"/>
-        <omgdi:waypoint x="1752.0" y="320.0"/>
-        <omgdi:waypoint x="1752.0" y="388.0"/>
-        <omgdi:waypoint x="1940.0" y="388.0"/>
+      <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
+        <omgdi:waypoint x="1960.0" y="200.0"/>
+        <omgdi:waypoint x="2270.0" y="200.0"/>
+        <omgdi:waypoint x="2270.0" y="358.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
-        <omgdi:waypoint x="1440.0" y="540.0"/>
-        <omgdi:waypoint x="1452.0" y="540.0"/>
-        <omgdi:waypoint x="1452.0" y="680.0"/>
-        <omgdi:waypoint x="1955.0" y="680.0"/>
-        <omgdi:waypoint x="1986.4041095890411" y="418.0"/>
+      <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
+        <omgdi:waypoint x="1810.0" y="320.0"/>
+        <omgdi:waypoint x="1852.0" y="320.0"/>
+        <omgdi:waypoint x="1852.0" y="270.0"/>
+        <omgdi:waypoint x="1890.0" y="270.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" id="BPMNEdge_sid-A2BDF803-688C-4A4D-9D33-6D859C029245">
-        <omgdi:waypoint x="1540.0" y="800.0"/>
-        <omgdi:waypoint x="1540.0" y="824.5833282470703"/>
+      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
+        <omgdi:waypoint x="610.0" y="590.0"/>
+        <omgdi:waypoint x="622.0" y="590.0"/>
+        <omgdi:waypoint x="622.0" y="449.0"/>
+        <omgdi:waypoint x="690.0" y="449.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" id="BPMNEdge_sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58">
-        <omgdi:waypoint x="490.0" y="610.0"/>
-        <omgdi:waypoint x="490.0" y="859.0"/>
-        <omgdi:waypoint x="910.0" y="859.0"/>
-        <omgdi:waypoint x="910.0" y="820.0"/>
+      <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
+        <omgdi:waypoint x="1102.0" y="243.0"/>
+        <omgdi:waypoint x="1052.0" y="243.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
-        <omgdi:waypoint x="1440.0" y="540.0"/>
-        <omgdi:waypoint x="1454.0" y="540.0"/>
-        <omgdi:waypoint x="1454.0" y="770.0"/>
-        <omgdi:waypoint x="1490.0" y="770.0"/>
+      <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
+        <omgdi:waypoint x="1960.0" y="200.0"/>
+        <omgdi:waypoint x="2002.0" y="200.0"/>
+        <omgdi:waypoint x="2002.0" y="140.0"/>
+        <omgdi:waypoint x="2040.0" y="140.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Active" id="BPMNEdge_createApprovalGW2Active">
-        <omgdi:waypoint x="630.0" y="449.0"/>
-        <omgdi:waypoint x="761.0" y="449.0"/>
-        <omgdi:waypoint x="761.0" y="541.0"/>
-        <omgdi:waypoint x="1030.0" y="541.0"/>
+      <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1554.0" y="540.0"/>
+        <omgdi:waypoint x="1554.0" y="310.0"/>
+        <omgdi:waypoint x="1590.0" y="310.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
-        <omgdi:waypoint x="1860.0" y="200.0"/>
-        <omgdi:waypoint x="1902.0" y="200.0"/>
-        <omgdi:waypoint x="1902.0" y="140.0"/>
-        <omgdi:waypoint x="1940.0" y="140.0"/>
+      <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
+        <omgdi:waypoint x="2137.1194728625946" y="429.9240681424709"/>
+        <omgdi:waypoint x="1593.2010935079752" y="365.2037059337773"/>
+        <omgdi:waypoint x="1230.0" y="519.7275134518939"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" id="BPMNEdge_sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F">
-        <omgdi:waypoint x="1590.0" y="833.0555521647135"/>
-        <omgdi:waypoint x="1677.7342416529327" y="777.7342416529327"/>
+      <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
+        <omgdi:waypoint x="1743.209935088986" y="591.167207412115"/>
+        <omgdi:waypoint x="1848.971259767517" y="591.167207412115"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
-        <omgdi:waypoint x="1440.0" y="540.0"/>
-        <omgdi:waypoint x="1456.0" y="540.0"/>
-        <omgdi:waypoint x="1456.0" y="730.0"/>
-        <omgdi:waypoint x="1790.0" y="730.0"/>
+      <bpmndi:BPMNEdge bpmnElement="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" id="BPMNEdge_sid-A2BDF803-688C-4A4D-9D33-6D859C029245">
+        <omgdi:waypoint x="1640.0" y="800.0"/>
+        <omgdi:waypoint x="1640.0" y="824.5833282470703"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
-        <omgdi:waypoint x="1440.0" y="540.0"/>
-        <omgdi:waypoint x="1452.0" y="540.0"/>
-        <omgdi:waypoint x="1452.0" y="130.0"/>
-        <omgdi:waypoint x="1490.0" y="130.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
+        <omgdi:waypoint x="1848.971259767517" y="619.2818713118841"/>
+        <omgdi:waypoint x="1773.0" y="662.0"/>
+        <omgdi:waypoint x="1230.0" y="551.2023608768972"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
-        <omgdi:waypoint x="1860.0" y="200.0"/>
-        <omgdi:waypoint x="1990.0" y="200.0"/>
-        <omgdi:waypoint x="1990.0" y="358.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
+        <omgdi:waypoint x="760.0" y="689.0"/>
+        <omgdi:waypoint x="772.0" y="689.0"/>
+        <omgdi:waypoint x="772.0" y="800.0"/>
+        <omgdi:waypoint x="810.0" y="800.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
-        <omgdi:waypoint x="370.0" y="620.0"/>
-        <omgdi:waypoint x="370.0" y="732.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
+        <omgdi:waypoint x="860.0" y="770.0"/>
+        <omgdi:waypoint x="860.0" y="732.0"/>
+        <omgdi:waypoint x="1010.0" y="732.0"/>
+        <omgdi:waypoint x="1010.0" y="780.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
-        <omgdi:waypoint x="180.0" y="527.0"/>
-        <omgdi:waypoint x="230.0" y="527.0"/>
+      <bpmndi:BPMNEdge bpmnElement="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" id="BPMNEdge_sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58">
+        <omgdi:waypoint x="590.0" y="610.0"/>
+        <omgdi:waypoint x="590.0" y="859.0"/>
+        <omgdi:waypoint x="1010.0" y="859.0"/>
+        <omgdi:waypoint x="1010.0" y="820.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991" id="BPMNEdge_sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991">
-        <omgdi:waypoint x="396.3736263736264" y="732.0"/>
-        <omgdi:waypoint x="482.05298013245033" y="602.0529801324503"/>
+      <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
+        <omgdi:waypoint x="1743.209935088986" y="482.67491429276924"/>
+        <omgdi:waypoint x="1848.971259767517" y="482.67491429276924"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
-        <omgdi:waypoint x="810.0" y="243.0"/>
-        <omgdi:waypoint x="852.0" y="243.0"/>
+      <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
+        <omgdi:waypoint x="1810.0" y="770.0"/>
+        <omgdi:waypoint x="1852.0" y="770.0"/>
+        <omgdi:waypoint x="1852.0" y="870.0"/>
+        <omgdi:waypoint x="1890.0" y="870.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
-        <omgdi:waypoint x="890.0" y="800.0"/>
-        <omgdi:waypoint x="810.0" y="800.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
+        <omgdi:waypoint x="1848.971259767517" y="459.5618225523418"/>
+        <omgdi:waypoint x="1692.0" y="387.0"/>
+        <omgdi:waypoint x="1230.0" y="525.9609375"/>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Suspended" id="BPMNEdge_createApprovalGW2Suspended">
-        <omgdi:waypoint x="630.0" y="449.0"/>
-        <omgdi:waypoint x="672.0" y="449.0"/>
-        <omgdi:waypoint x="672.0" y="130.0"/>
-        <omgdi:waypoint x="1490.0" y="130.0"/>
+        <omgdi:waypoint x="730.0" y="449.0"/>
+        <omgdi:waypoint x="772.0" y="449.0"/>
+        <omgdi:waypoint x="772.0" y="130.0"/>
+        <omgdi:waypoint x="1590.0" y="130.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
-        <omgdi:waypoint x="810.0" y="640.0"/>
-        <omgdi:waypoint x="822.0" y="640.0"/>
-        <omgdi:waypoint x="959.0" y="640.0"/>
-        <omgdi:waypoint x="1043.3333333333333" y="571.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow14bis" id="BPMNEdge_flow14bis">
+        <omgdi:waypoint x="1690.0" y="310.0"/>
+        <omgdi:waypoint x="1702.0" y="310.0"/>
+        <omgdi:waypoint x="1702.0" y="320.0"/>
+        <omgdi:waypoint x="1770.0" y="320.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
-        <omgdi:waypoint x="30.0" y="527.0"/>
-        <omgdi:waypoint x="80.0" y="527.0"/>
+      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Activate" id="BPMNEdge_createApprovalGW2Activate">
+        <omgdi:waypoint x="730.0" y="449.0"/>
+        <omgdi:waypoint x="772.0" y="449.0"/>
+        <omgdi:waypoint x="772.0" y="640.0"/>
+        <omgdi:waypoint x="810.0" y="640.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
-        <omgdi:waypoint x="1440.0" y="540.0"/>
-        <omgdi:waypoint x="1593.209935088986" y="540.0"/>
-        <omgdi:waypoint x="1593.209935088986" y="561.167207412115"/>
+      <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
+        <omgdi:waypoint x="1142.0" y="243.0"/>
+        <omgdi:waypoint x="1180.0" y="243.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
-        <omgdi:waypoint x="1002.0" y="243.0"/>
-        <omgdi:waypoint x="952.0" y="243.0"/>
+      <bpmndi:BPMNEdge bpmnElement="sid-E58BBC2D-8831-4CF2-A798-14B258FE569B" id="BPMNEdge_sid-E58BBC2D-8831-4CF2-A798-14B258FE569B">
+        <omgdi:waypoint x="1770.0" y="770.0"/>
+        <omgdi:waypoint x="1690.0" y="770.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
-        <omgdi:waypoint x="1124.96644295302" y="273.0"/>
-        <omgdi:waypoint x="1085.03355704698" y="511.0"/>
+      <bpmndi:BPMNEdge bpmnElement="recert-request-start-flow" id="BPMNEdge_recert-request-start-flow">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1964.8786471876083" y="539.9999999999999"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
-        <omgdi:waypoint x="902.0" y="273.0"/>
-        <omgdi:waypoint x="902.0" y="310.0"/>
-        <omgdi:waypoint x="1022.0" y="310.0"/>
-        <omgdi:waypoint x="1022.0" y="263.0"/>
+      <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
+        <omgdi:waypoint x="370.0" y="527.0"/>
+        <omgdi:waypoint x="382.0" y="527.0"/>
+        <omgdi:waypoint x="382.0" y="449.0"/>
+        <omgdi:waypoint x="690.0" y="449.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
-        <omgdi:waypoint x="1710.0" y="320.0"/>
-        <omgdi:waypoint x="1752.0" y="320.0"/>
-        <omgdi:waypoint x="1752.0" y="270.0"/>
-        <omgdi:waypoint x="1790.0" y="270.0"/>
+      <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
+        <omgdi:waypoint x="1540.0" y="540.0"/>
+        <omgdi:waypoint x="1693.0" y="540.0"/>
+        <omgdi:waypoint x="1693.100069528527" y="512.6749142927692"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
-        <omgdi:waypoint x="1890.0" y="730.0"/>
-        <omgdi:waypoint x="1937.0" y="730.0"/>
-        <omgdi:waypoint x="1937.0" y="946.5833740234375"/>
-        <omgdi:waypoint x="1236.0" y="946.5833740234375"/>
-        <omgdi:waypoint x="1080.0" y="844.5833740234375"/>
-        <omgdi:waypoint x="1080.0" y="571.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+        <omgdi:waypoint x="1690.0" y="130.0"/>
+        <omgdi:waypoint x="1702.0" y="130.0"/>
+        <omgdi:waypoint x="1702.0" y="150.0"/>
+        <omgdi:waypoint x="1740.0" y="150.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
-        <omgdi:waypoint x="1130.0" y="540.8529411764706"/>
-        <omgdi:waypoint x="1400.058651026393" y="540.0586510263929"/>
+      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+        <omgdi:waypoint x="1840.0" y="150.0"/>
+        <omgdi:waypoint x="1852.0" y="150.0"/>
+        <omgdi:waypoint x="1852.0" y="200.0"/>
+        <omgdi:waypoint x="1920.0" y="200.0"/>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="flow99" id="BPMNEdge_flow99">
-        <omgdi:waypoint x="2040.0" y="388.0"/>
-        <omgdi:waypoint x="2078.1893792531678" y="388.0"/>
+        <omgdi:waypoint x="2320.0" y="388.0"/>
+        <omgdi:waypoint x="2358.1893792531678" y="388.0"/>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
-        <omgdi:waypoint x="1210.0" y="51.18953815900822"/>
-        <omgdi:waypoint x="1440.8987892500566" y="33.59291764763734"/>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
-        <omgdi:waypoint x="1030.0" y="55.0"/>
-        <omgdi:waypoint x="1110.0" y="55.0"/>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
-        <omgdi:waypoint x="1479.438749881016" y="32.13287827859691"/>
-        <omgdi:waypoint x="1540.0" y="32.0"/>
-        <omgdi:waypoint x="1540.0" y="100.0"/>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
-        <omgdi:waypoint x="1450.9385750878846" y="43.63270348546535"/>
-        <omgdi:waypoint x="1102.3741233704363" y="511.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
+        <omgdi:waypoint x="2040.0" y="129.51612903225805"/>
+        <omgdi:waypoint x="2028.0" y="127.0"/>
+        <omgdi:waypoint x="1478.0" y="40.0"/>
+        <omgdi:waypoint x="1197.8443113772455" y="511.0"/>
       </bpmndi:BPMNEdge>
-       <bpmndi:BPMNEdge bpmnElement="recert-request-start-flow" id="BPMNEdge_recert-request-start-flow">
-        <omgdi:waypoint x="1410.4864864864865" y="529.5135135135135"/>
-        <omgdi:waypoint x="1016.2886597938144" y="95.0"/>
+      <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
+        <omgdi:waypoint x="1940.0" y="900.0"/>
+        <omgdi:waypoint x="1940.0" y="924.0"/>
+        <omgdi:waypoint x="1338.0" y="924.0"/>
+        <omgdi:waypoint x="1214.0" y="837.0"/>
+        <omgdi:waypoint x="1183.445945945946" y="571.0"/>
       </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java
index 9416d79..d053271 100755
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RecertificationITCase.java
@@ -28,7 +28,7 @@ import org.junit.Test;
 import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.JVM)
-public class RecertificationITCase extends AbstractTaskITCase{
+public class RecertificationITCase extends AbstractTaskITCase {
 
     @Test
     public void recertification() {
@@ -36,16 +36,15 @@ public class RecertificationITCase extends AbstractTaskITCase{
 
         List<WorkflowFormTO> forms = userWorkflowService.getForms();
         assertFalse(forms.isEmpty());
-        for (WorkflowFormTO f : forms) {
-            userWorkflowService.claimForm(f.getTaskId());
-            WorkflowFormPropertyTO w = f.getPropertyMap().get("approve");
-            w.setValue("true");
-            userWorkflowService.submitForm(f);
+        for (WorkflowFormTO form : forms) {
+            userWorkflowService.claimForm(form.getTaskId());
+            WorkflowFormPropertyTO property = form.getPropertyMap().get("approve");
+            property.setValue("true");
+            userWorkflowService.submitForm(form);
         }
 
         forms = userWorkflowService.getForms();
         assertTrue(forms.isEmpty());
-
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b79667f..3bc913c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -204,7 +204,6 @@ under the License.
       <roles>
         <role>committer</role>
       </roles>
-      <url></url>
     </developer>
     <developer>
       <id>coheigea</id>

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/src/main/asciidoc/reference-guide/concepts/workflow.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/concepts/workflow.adoc b/src/main/asciidoc/reference-guide/concepts/workflow.adoc
index c85df0a..15e5f2a 100644
--- a/src/main/asciidoc/reference-guide/concepts/workflow.adoc
+++ b/src/main/asciidoc/reference-guide/concepts/workflow.adoc
@@ -155,3 +155,58 @@ the following flow (the actual operations on the admin console for the sample ab
 . administrator A claims the approval and is then allowed to manage it
 . administrator A reviews the updated user, with ongoing modification applied (no actual modification performed yet)
 . administrator A can approve or reject such modification
+
+===== Identity Recertification
+
+Recertification, also referred to as Attestation, is the process of periodically reviewing all the identities and
+granted accesses, within a given organization.
+
+[TIP]
+====
+Recertification is the traditional and most effective countermeasure against __privilege creep__, that is the
+rentention of accounts during time even when the user change his role, or even his job. 
+
+Recertification is a good practice, recommended and often required by international or organizational standards.
+====
+
+Typically, every entity within an Identity Manager needs to be periodically recertified:
+
+* *Identities*: Is the user still valid for the organization?
+* *Accounts*: Is the user still using this account?
+* *Group Memberships / Entitlements*: Does the user require this functionality?
+
+A basic <<tasks-custom,custom task>> implementing identity recertification is provided with the
+ifeval::["{snapshotOrRelease}" == "release"]
+https://github.com/apache/syncope/blob/syncope-{docVersion}/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java[IdentityRecertification^]
+endif::[]
+ifeval::["{snapshotOrRelease}" == "snapshot"]
+https://github.com/apache/syncope/blob/master/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java[IdentityRecertification^]
+endif::[]
+class, which can be used as base to implement more complex recertification processes.
+
+Essentially, this task goes through all the available users and checks whether they where already recertified in the
+past `identity.recertification.day.interval` days - see <<configuration-parameters, below>> for details; when needed,
+it triggers a specific <<approval,approval>>.
+
+The delegated administrator for approving recertifications can be configured by modifying the
+"Recertification Request" task in the workflow definition.
+
+.Certifiers are members of the `managingDirector` group
+====
+[source,xml]
+----
+<userTask id="recertificationRequest" name="Recertification Request"
+          activiti:formKey="recertify"
+          activiti:candidateGroups="managingDirector">
+----
+====
+
+.Certifier is the manager defined in the user's `lastRecertificator` attribute
+====
+[source,xml]
+----
+<userTask id="recertificationRequest" name="Recertification Request"
+          activiti:formKey="recertify"
+          activiti:candidateUser="${user.lastRecertificator}">
+----
+====

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
index 96a6ca7..55fdc6d 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
@@ -40,5 +40,7 @@ application) is allowed;
 * `log.lastlogindate` - whether the system updates the `lastLoginDate` field of users upon authentication;
 * `tasks.interruptMaxRetries` - how many attempts shall be made when interrupting a running <<task,task>>;
 * `return.password.value` - whether the hashed password value shall be returned when reading users;
-* `identity.recertification.day.interval` - Number of days bewteen identity recertifications.
+* `identity.recertification.day.interval` - number of days bewteen
+<<identity-recertification,identity recertifications>>.
+
 Besides this default set, new configuration parameters can be defined to support <<customization,custom>> code.

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc
deleted file mode 100644
index 138ad51..0000000
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/identityrecertification.adoc
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-==== Identity Recertification
-
-Recertification is the process to review all the identities and access within one organization. This is a tipical countermeasure against the  __privilege creep__, that is the rentention of accounts during time even when the user change his role, or even his job. Ths good practice is recomendded and often required by international or organizational standards.
-
-Tipically every "object" within one IDM system needs to be periodically re-certified:
-
-* Identities: Is the user still valid for the organization?
-* Accounts: Is thie user still using this account?
-* Group Membership/Entitlements: Does the user require this functionality?
-
-One simple scheduled job to implement Identity Recertification is provided. The class name is: __org.apache.syncope.core.provisioning.java.job.IdentityRecertification__ .
-It can be used as base to implement more complex recertification processes.
-It go through all the users and check if they have been recertified the past __identity.recertification.day.interval__ days. This is a global Parameter that can be set using Syncope Console or REST webservices.
-The recertificaton task implemented by default set two attributes for each users:
-- lastRertificator: the name of the user that re-certified the user
-- lastRecertiication: the date when the re-certification is performed
-This task is implement by the class: __org.apache.syncope.core.workflow.activiti.task.Recertify__
-The certificator can be defined modifying the task: "Create Recertification". Actviti is very flexible, and allows to define approver user, groups, or even to use expression language to define approvers from attributes from the user, for example the user manager.
-
-Example 1: Certifier users are members of managingDirector group:
-=====================================================================
-    <userTask id="createApproval" name="Create approval"
-              activiti:candidateGroups="managingDirector" 
-              activiti:formKey="createApproval">
-=====================================================================
-
-Example 2: Certifier user is the user manager defined in the user attribute: __lastRecertificator__
-=====================================================================
-    < userTask id = "createApproval" name = "Create Recertification"
-               activiti:candidateGroups="${user.lastRecertificator}" 
-               activiti:formKey="createApproval">
-=====================================================================

http://git-wip-us.apache.org/repos/asf/syncope/blob/f17be3cf/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
index e7e61d8..016c391 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
@@ -70,6 +70,4 @@ include::connectorbundles.adoc[]
 
 include::emailconfiguration.adoc[]
 
-include::identityrecertification.adoc[]
-
 include::configurationparameters.adoc[]