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 2015/02/05 17:00:39 UTC

[08/52] syncope git commit: [SYNCOPE-620] Console (JAR) in, now time for console-reference

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/pom.xml b/syncope620/fit/server-reference/pom.xml
new file mode 100644
index 0000000..0fa46dd
--- /dev/null
+++ b/syncope620/fit/server-reference/pom.xml
@@ -0,0 +1,526 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.syncope</groupId>
+    <artifactId>syncope-fit</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+
+  <name>Apache Syncope FIT Server Reference</name>
+  <description>Apache Syncope FIT Server Reference</description>
+  <groupId>org.apache.syncope.fit</groupId>
+  <artifactId>syncope-fit-server-reference</artifactId>
+  <packaging>war</packaging>
+  
+  <properties>
+    <jdbcdriver.groupId>com.h2database</jdbcdriver.groupId>
+    <jdbcdriver.artifactId>h2</jdbcdriver.artifactId>
+    
+    <rootpom.basedir>${basedir}/../..</rootpom.basedir>
+  </properties>
+
+  <dependencies>
+    <dependency> 
+      <groupId>javax.servlet</groupId> 
+      <artifactId>javax.servlet-api</artifactId> 
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet.jsp</groupId>
+      <artifactId>javax.servlet.jsp-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>jstl</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.syncope.server</groupId>
+      <artifactId>syncope-server-rest-cxf</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.syncope.server</groupId>
+      <artifactId>syncope-server-workflow-java</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.syncope.server</groupId>
+      <artifactId>syncope-server-persistence-jpa</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.syncope.fit</groupId>
+      <artifactId>syncope-fit-build-tools</artifactId>
+      <version>${project.version}</version>
+      <type>war</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>net.tirasa.connid.bundles.soap</groupId>
+      <artifactId>wssample</artifactId>
+      <version>${connid.soap.version}</version>
+      <type>war</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.h2database</groupId>
+      <artifactId>h2</artifactId>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.lmax</groupId>
+      <artifactId>disruptor</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>jquery</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>jquery-ui</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>highlightjs</artifactId>
+    </dependency>
+    
+    <!-- TEST -->
+    <dependency>
+      <groupId>org.apache.syncope.ext.camel</groupId>
+      <artifactId>syncope-ext-camel-rest-cxf</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>          
+    </dependency>
+    <dependency>
+      <groupId>org.apache.syncope.client</groupId>
+      <artifactId>syncope-client-lib</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <inherited>true</inherited>
+        <configuration>
+          <failOnMissingWebXml>false</failOnMissingWebXml>
+        </configuration>
+      </plugin>
+                
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <inherited>true</inherited>
+        <executions>
+          <execution>
+            <id>set-bundles</id>
+            <phase>process-test-resources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <inherited>true</inherited>
+        <executions>
+          <execution>
+            <id>setupCSV</id>
+            <phase>pre-integration-test</phase>
+            <configuration>
+              <target>
+                <copy file="${project.build.directory}/test-classes/test.csv" todir="${test.csvdir.path}" overwrite="true"/>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <inherited>true</inherited>
+        <configuration>
+          <systemPropertyVariables>
+            <jaxrsContentType>${jaxrs.content.type}</jaxrsContentType>
+          </systemPropertyVariables>
+        </configuration>
+        <executions>
+          <execution>
+            <id>verify</id>
+            <goals>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      
+      <plugin>
+        <groupId>org.codehaus.cargo</groupId>
+        <artifactId>cargo-maven2-plugin</artifactId>
+        <inherited>true</inherited>
+        <configuration>
+          <container>
+            <dependencies>
+              <dependency>
+                <groupId>com.h2database</groupId>
+                <artifactId>h2</artifactId>
+              </dependency>
+              <dependency>
+                <groupId>${jdbcdriver.groupId}</groupId>
+                <artifactId>${jdbcdriver.artifactId}</artifactId>
+              </dependency>
+            </dependencies>
+          </container>
+          <configuration>
+            <type>standalone</type>
+            <properties>
+              <cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
+              <cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
+              <cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
+
+              <cargo.jvmargs>-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
+            </properties>
+            <configfiles>
+              <configfile>
+                <file>${project.build.directory}/classes/context.xml</file>
+                <todir>conf/</todir>
+                <tofile>context.xml</tofile>
+              </configfile>
+            </configfiles>
+          </configuration>
+          <deployables>
+            <deployable>
+              <groupId>net.tirasa.connid.bundles.soap</groupId>
+              <artifactId>wssample</artifactId>
+              <type>war</type>
+              <properties>
+                <context>wssample</context>
+              </properties>
+            </deployable>
+            <deployable>
+              <groupId>org.apache.syncope.fit</groupId>
+              <artifactId>syncope-fit-build-tools</artifactId>
+              <type>war</type>
+              <properties>
+                <context>syncope-fit-build-tools</context>
+              </properties>
+            </deployable>
+            <deployable>
+              <location>${project.build.directory}/${project.build.finalName}</location>
+              <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
+              <pingTimeout>60000</pingTimeout>
+              <properties>
+                <context>syncope</context>
+              </properties>
+            </deployable>
+          </deployables>
+        </configuration>
+        <executions>
+          <execution>
+            <id>start-container</id>
+            <phase>pre-integration-test</phase>
+            <goals>
+              <goal>start</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>stop-container</id>
+            <phase>post-integration-test</phase>
+            <goals>
+              <goal>stop</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+      </plugin>
+    </plugins>
+    
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+      </resource>
+      <resource>
+        <directory>${basedir}/../../server/persistence-jpa/src/test/resources</directory>
+        <includes>
+          <include>content.xml</include>
+          <include>persistence.properties</include>
+        </includes>
+        <filtering>true</filtering>
+      </resource>
+      <resource>
+        <directory>${basedir}/../../server/misc/src/main/resources</directory>
+        <includes>
+          <include>security.properties</include>
+        </includes>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
+  </build>
+  
+  <profiles>
+    <profile>
+      <id>debug</id>
+
+      <properties>
+        <skipTests>true</skipTests>
+      </properties>
+
+      <build>
+        <defaultGoal>clean verify cargo:run</defaultGoal>
+
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.cargo</groupId>
+            <artifactId>cargo-maven2-plugin</artifactId>
+            <inherited>true</inherited>
+            <configuration>
+              <configuration>
+                <properties>
+                  <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
+                    -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
+                </properties>
+              </configuration>
+            </configuration>
+            <executions>
+              <execution>
+                <id>start-container</id>
+                <phase>none</phase>
+              </execution>
+              <execution>
+                <id>stop-container</id>
+                <phase>none</phase>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
+    <profile>
+      <id>skipTests</id>
+
+      <dependencies>
+        <dependency>
+          <groupId>com.h2database</groupId>
+          <artifactId>h2</artifactId>
+        </dependency>
+      </dependencies>
+
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-failsafe-plugin</artifactId>
+            <inherited>true</inherited>
+            <configuration>
+              <skipTests>${skipTests}</skipTests>
+            </configuration>
+          </plugin>
+
+          <plugin>
+            <groupId>org.codehaus.cargo</groupId>
+            <artifactId>cargo-maven2-plugin</artifactId>
+            <inherited>true</inherited>
+            <configuration>
+              <deployables>
+                <deployable>
+                  <location>${project.build.directory}/${project.build.finalName}.war</location>
+                </deployable>
+              </deployables>
+            </configuration>
+            <executions>
+              <execution>
+                <id>install-container</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>install</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>start-container</id>
+                <phase>none</phase>
+              </execution>
+              <execution>
+                <id>stop-container</id>
+                <phase>none</phase>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
+    <profile>
+      <id>light</id>
+      
+      <build>
+        <resources>
+          <resource>
+            <directory>src/main/resources</directory>
+            <filtering>true</filtering>
+            <excludes>
+              <exclude>workflow.properties</exclude>
+              <exclude>provisioning.properties</exclude>
+            </excludes>
+          </resource>
+          <resource>
+            <directory>src/main/resources/light</directory>
+            <filtering>true</filtering>
+          </resource>
+        </resources>
+      </build>
+    </profile>
+    
+    <profile>
+      <id>all</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.syncope.server</groupId>
+          <artifactId>syncope-server-workflow-activiti</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+          <groupId>org.apache.syncope.ext.camel</groupId>
+          <artifactId>syncope-ext-camel-rest-cxf</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.syncope.ext.camel</groupId>
+          <artifactId>syncope-ext-camel-persistence-jpa</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.syncope.ext.camel</groupId>
+          <artifactId>syncope-ext-camel-provisioning</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+      </dependencies>
+      
+      <build>
+        <plugins>
+          <!-- Adds Activiti test content -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>xml-maven-plugin</artifactId>
+            <inherited>true</inherited>
+            <executions>
+              <execution>
+                <phase>prepare-package</phase>
+                <goals>
+                  <goal>transform</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <transformationSets>
+                <transformationSet>
+                  <dir>${project.build.directory}/classes</dir>
+                  <includes>
+                    <include>content.xml</include>
+                  </includes>
+                  <outputDir>${project.build.directory}/classes</outputDir>
+                  <stylesheet>${basedir}/src/test/resources/addActivitiToContent.xsl</stylesheet>
+                  <outputProperties>
+                    <outputProperty>
+                      <name>indent</name>
+                      <value>yes</value>
+                    </outputProperty>
+                  </outputProperties>
+                </transformationSet>
+              </transformationSets>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
new file mode 100644
index 0000000..da25a34
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
@@ -0,0 +1,75 @@
+/*
+ * 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.server.reference;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.server.provisioning.api.AttributableTransformer;
+
+/**
+ * Class for integration tests: transform (by making it double) any attribute value for defined schema.
+ */
+public class DoubleValueAttributableTransformer implements AttributableTransformer {
+
+    private static final String NAME = "makeItDouble";
+
+    @Override
+    public <T extends AbstractAttributableTO> T transform(final T input) {
+        for (AttrTO attr : input.getPlainAttrs()) {
+            if (NAME.equals(attr.getSchema())) {
+                List<String> values = new ArrayList<>(attr.getValues().size());
+                for (String value : attr.getValues()) {
+                    try {
+                        values.add(String.valueOf(2 * Long.valueOf(value)));
+                    } catch (NumberFormatException e) {
+                        // ignore
+                    }
+                }
+                attr.getValues().clear();
+                attr.getValues().addAll(values);
+            }
+        }
+
+        return input;
+    }
+
+    @Override
+    public <T extends AbstractAttributableMod> T transform(final T input) {
+        for (AttrMod attr : input.getPlainAttrsToUpdate()) {
+            if (NAME.equals(attr.getSchema())) {
+                List<String> values = new ArrayList<>(attr.getValuesToBeAdded().size());
+                for (String value : attr.getValuesToBeAdded()) {
+                    try {
+                        values.add(String.valueOf(2 * Long.valueOf(value)));
+                    } catch (NumberFormatException e) {
+                        // ignore
+                    }
+                }
+                attr.getValuesToBeAdded().clear();
+                attr.getValuesToBeAdded().addAll(values);
+            }
+        }
+
+        return input;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
new file mode 100644
index 0000000..01da2c9
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
@@ -0,0 +1,83 @@
+/*
+ * 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.server.reference;
+
+import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.server.provisioning.api.sync.ProvisioningProfile;
+import org.apache.syncope.server.provisioning.java.sync.DefaultSyncActions;
+import org.identityconnectors.framework.common.objects.SyncDelta;
+import org.quartz.JobExecutionException;
+
+public class TestSyncActions extends DefaultSyncActions {
+
+    private int counter = 0;
+
+    @Override
+    public <T extends AbstractSubjectTO> SyncDelta beforeProvision(
+            final ProvisioningProfile<?, ?> profile,
+            final SyncDelta delta,
+            final T subject) throws JobExecutionException {
+
+        AttrTO attrTO = null;
+        for (int i = 0; i < subject.getPlainAttrs().size(); i++) {
+            if ("fullname".equals(subject.getPlainAttrs().get(i).getSchema())) {
+                attrTO = subject.getPlainAttrs().get(i);
+            }
+        }
+        if (attrTO == null) {
+            attrTO = new AttrTO();
+            attrTO.setSchema("fullname");
+            subject.getPlainAttrs().add(attrTO);
+        }
+        attrTO.getValues().clear();
+        attrTO.getValues().add(String.valueOf(counter++));
+
+        return delta;
+    }
+
+    @Override
+    public <T extends AbstractSubjectTO, K extends AbstractSubjectMod> SyncDelta beforeUpdate(
+            final ProvisioningProfile<?, ?> profile,
+            final SyncDelta delta,
+            final T subject,
+            final K subjectMod) throws JobExecutionException {
+
+        subjectMod.getPlainAttrsToRemove().add("fullname");
+
+        AttrMod fullnameMod = null;
+        for (AttrMod attrMod : subjectMod.getPlainAttrsToUpdate()) {
+            if ("fullname".equals(attrMod.getSchema())) {
+                fullnameMod = attrMod;
+            }
+        }
+        if (fullnameMod == null) {
+            fullnameMod = new AttrMod();
+            fullnameMod.setSchema("fullname");
+            subjectMod.getPlainAttrsToUpdate().add(fullnameMod);
+        }
+
+        fullnameMod.getValuesToBeAdded().clear();
+        fullnameMod.getValuesToBeAdded().add(String.valueOf(counter++));
+
+        return delta;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
new file mode 100644
index 0000000..8454ec6
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
@@ -0,0 +1,37 @@
+/*
+ * 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.server.reference;
+
+import org.apache.syncope.server.persistence.api.dao.search.AttributeCond;
+import org.apache.syncope.server.persistence.api.dao.search.SearchCond;
+import org.apache.syncope.server.provisioning.api.sync.SyncCorrelationRule;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+
+public class TestSyncRule implements SyncCorrelationRule {
+
+    @Override
+    public SearchCond getSearchCond(ConnectorObject connObj) {
+        AttributeCond cond = new AttributeCond();
+        cond.setSchema("email");
+        cond.setType(AttributeCond.Type.EQ);
+        cond.setExpression(connObj.getName().getNameValue());
+
+        return SearchCond.getLeafCond(cond);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/connid.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/connid.properties b/syncope620/fit/server-reference/src/main/resources/connid.properties
new file mode 100644
index 0000000..40d649c
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/connid.properties
@@ -0,0 +1,23 @@
+# 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.
+connid.locations=${connid.location},\
+connid://${testconnectorserver.key}@localhost:${testconnectorserver.port}
+
+## for test only
+testdb.url=${testdb.url}
+connid.soap.version=${connid.soap.version}
+connid.db.table.version=${connid.db.table.version}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/context.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/context.xml b/syncope620/fit/server-reference/src/main/resources/context.xml
new file mode 100644
index 0000000..471d561
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/context.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+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.
+-->
+<Context>
+  <!-- Disable session persistence across Tomcat restarts -->
+  <Manager pathname=""/>
+</Context>

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties b/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
new file mode 100644
index 0000000..2ed4d0d
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
@@ -0,0 +1,18 @@
+# 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.
+userProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultUserProvisioningManager
+roleProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultRoleProvisioningManager

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/light/workflow.properties b/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
new file mode 100644
index 0000000..2c08d50
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
@@ -0,0 +1,20 @@
+# 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.
+wf.directory=${conf.directory}
+jobExecutorActivate=false
+uwfAdapter=org.apache.syncope.server.workflow.java.DefaultUserWorkflowAdapter
+rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/log4j2.xml b/syncope620/fit/server-reference/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..0ed8903
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/log4j2.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<configuration status="WARN">
+
+  <appenders>
+    
+    <RollingRandomAccessFile name="main" fileName="${log.directory}/server.log"
+                             filePattern="${log.directory}/server-%d{yyyy-MM-dd}.log.gz"
+                             immediateFlush="false" append="true">
+      <PatternLayout>
+        <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
+      </PatternLayout>
+      <Policies>
+        <TimeBasedTriggeringPolicy/>
+        <SizeBasedTriggeringPolicy size="250 MB"/>
+      </Policies>
+    </RollingRandomAccessFile>
+
+    <RollingRandomAccessFile name="persistence" fileName="${log.directory}/server-persistence.log"
+                             filePattern="${log.directory}/server-persistence-%d{yyyy-MM-dd}.log.gz"
+                             immediateFlush="false" append="true">
+      <PatternLayout>
+        <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
+      </PatternLayout>
+      <Policies>
+        <TimeBasedTriggeringPolicy/>
+        <SizeBasedTriggeringPolicy size="250 MB"/>
+      </Policies>
+    </RollingRandomAccessFile>
+
+    <RollingRandomAccessFile name="rest" fileName="${log.directory}/server-rest.log"
+                             filePattern="${log.directory}/server-rest-%d{yyyy-MM-dd}.log.gz"
+                             immediateFlush="false" append="true">
+      <PatternLayout>
+        <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
+      </PatternLayout>
+      <Policies>
+        <TimeBasedTriggeringPolicy/>
+        <SizeBasedTriggeringPolicy size="250 MB"/>
+      </Policies>
+    </RollingRandomAccessFile>
+
+    <RollingRandomAccessFile name="connid" fileName="${log.directory}/server-connid.log"
+                             filePattern="${log.directory}/server-connid-%d{yyyy-MM-dd}.log.gz"
+                             immediateFlush="false" append="true">
+      <PatternLayout>
+        <pattern>%d{HH:mm:ss.SSS} %-5level %msg%n</pattern>
+      </PatternLayout>
+      <Policies>
+        <TimeBasedTriggeringPolicy/>
+        <SizeBasedTriggeringPolicy size="250 MB"/>
+      </Policies>
+    </RollingRandomAccessFile>
+
+    <!-- Audit -->    
+    <Jdbc name="audit" tableName="SYNCOPEAUDIT">
+      <ConnectionFactory class="org.apache.syncope.server.logic.audit.AuditConnectionFactory" method="getConnection"/>
+      <Column name="EVENT_DATE" isEventTimestamp="true"/>
+      <Column name="LOGGER_LEVEL" pattern="%level" isUnicode="false"/>
+      <Column name="LOGGER" pattern="%logger" isUnicode="false"/>
+      <Column name="MESSAGE" pattern="%message" isUnicode="false"/>
+      <Column name="THROWABLE" pattern="%ex{full}" isUnicode="false"/>
+    </Jdbc>
+
+  </appenders>
+  
+  <loggers>
+    
+    <asyncLogger name="org.apache.syncope.server.persistence" additivity="false" level="INFO">
+      <appender-ref ref="persistence"/>
+    </asyncLogger>
+    <asyncLogger name="org.springframework.orm" additivity="false" level="INFO">
+      <appender-ref ref="persistence"/>
+    </asyncLogger>
+    
+    <asyncLogger name="org.apache.syncope.server.rest" additivity="false" level="INFO">
+      <appender-ref ref="rest"/>
+    </asyncLogger>
+    <asyncLogger name="org.springframework.web" additivity="false" level="INFO">
+      <appender-ref ref="rest"/>
+    </asyncLogger>
+    <asyncLogger name="org.apache.http" additivity="false" level="INFO">
+      <appender-ref ref="rest"/>
+    </asyncLogger>
+    <asyncLogger name="org.apache.cxf" additivity="false" level="ERROR">
+      <appender-ref ref="rest"/>
+    </asyncLogger>
+    
+    <asyncLogger name="org.identityconnectors" additivity="false" level="DEBUG">
+      <appender-ref ref="connid"/>
+    </asyncLogger>
+    <asyncLogger name="net.tirasa.connid" additivity="false" level="DEBUG">
+      <appender-ref ref="connid"/>
+    </asyncLogger>
+    <asyncLogger name="org.apache.syncope.server.provisioning.api.ConnIdBundleManager" additivity="false" level="INFO">
+      <appender-ref ref="connid"/>
+    </asyncLogger>
+    
+    <asyncLogger name="org.apache.syncope.server.provisioning" additivity="false" level="INFO">
+      <appender-ref ref="main"/>
+    </asyncLogger>
+    <asyncLogger name="org.springframework" additivity="false" level="INFO">
+      <appender-ref ref="main"/>
+    </asyncLogger>
+    <asyncLogger name="org.apache.camel" additivity="false" level="ERROR">
+      <appender-ref ref="main"/>
+    </asyncLogger>
+         
+    <logger name="syncope.audit" additivity="false" level="DEBUG">
+      <appender-ref ref="audit"/>
+    </logger>
+    
+    <root level="INFO">
+      <appender-ref ref="main"/>
+    </root>
+    
+  </loggers>
+</configuration>

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/logic.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/logic.properties b/syncope620/fit/server-reference/src/main/resources/logic.properties
new file mode 100644
index 0000000..2477c4b
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/logic.properties
@@ -0,0 +1,18 @@
+# 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.
+attributableTransformer=org.apache.syncope.fit.server.reference.DoubleValueAttributableTransformer
+logicInvocationHandler=org.apache.syncope.server.logic.LogicInvocationHandler

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/provisioning.properties b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
new file mode 100644
index 0000000..b0c8917
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
@@ -0,0 +1,19 @@
+# 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.
+camel.directory=${conf.directory}
+userProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelUserProvisioningManager
+roleProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelRoleProvisioningManager

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/serverContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/serverContext.xml b/syncope620/fit/server-reference/src/main/resources/serverContext.xml
new file mode 100644
index 0000000..7bf75a1
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/serverContext.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+  <bean id="confDirectoryPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+    <property name="order" value="1"/>
+    <property name="ignoreResourceNotFound" value="true"/>
+    <property name="ignoreUnresolvablePlaceholders" value="true"/>
+    <property name="locations">
+      <list>
+        <value>file:${conf.directory}/persistence.properties</value>
+        <value>file:${conf.directory}/security.properties</value>
+        <value>file:${conf.directory}/connid.properties</value>
+        <value>file:${conf.directory}/mail.properties</value>
+        <value>file:${conf.directory}/logic.properties</value>
+        <value>file:${conf.directory}/workflow.properties</value>
+        <value>file:${conf.directory}/provisioning.properties</value>
+      </list>
+    </property>
+  </bean>
+  <bean id="classpathPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+    <property name="locations">
+      <list>
+        <value>classpath:persistence.properties</value>
+        <value>classpath:security.properties</value>
+        <value>classpath:connid.properties</value>
+        <value>classpath:mail.properties</value>
+        <value>classpath:logic.properties</value>
+        <value>classpath:workflow.properties</value>
+        <value>classpath:provisioning.properties</value>
+      </list>
+    </property>
+  </bean>
+
+  <bean class="org.apache.syncope.server.misc.spring.ApplicationContextProvider"/>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml b/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml
new file mode 100644
index 0000000..d26dbe3
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml
@@ -0,0 +1,577 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" 
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+             xmlns:activiti="http://activiti.org/bpmn" 
+             xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" 
+             xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" 
+             xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" 
+             typeLanguage="http://www.w3.org/2001/XMLSchema" 
+             expressionLanguage="http://www.w3.org/1999/XPath" 
+             targetNamespace="http://activiti.org/bpmn20">
+  
+  <process id="userWorkflow" name="User Workflow" isExecutable="true">
+    <startEvent id="theStart"/>
+    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
+    <serviceTask id="create" name="Create" activiti:expression="#{create.execute(execution.processInstanceId)}"/>
+    <sequenceFlow id="flow2" sourceRef="create" targetRef="createGW"/>
+    <exclusiveGateway id="createGW"/>
+    <sequenceFlow id="createAsAnonymous2Approval" sourceRef="createGW" targetRef="createApproval">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == 'anonymous' || user.getRoleKeys().contains(9)}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.getRoleKeys().contains(9)}]]></conditionExpression>
+    </sequenceFlow>
+    <userTask id="createApproval" name="Create approval" activiti:candidateGroups="7" activiti:formKey="createApproval">
+      <extensionElements>
+        <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+        <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
+        <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+      </extensionElements>
+    </userTask>
+    <sequenceFlow id="flow3" sourceRef="createApproval" targetRef="createApprovalGW"/>
+    <exclusiveGateway id="createApprovalGW"/>
+    <sequenceFlow id="createApprovalGW2EnableGW" sourceRef="createApprovalGW" targetRef="enableGW">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="createApproval2Reject" sourceRef="createApprovalGW" targetRef="reject">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+    </sequenceFlow>
+    <exclusiveGateway id="enableGW"/>
+    <sequenceFlow id="createApprovalGW2OptIn" sourceRef="enableGW" targetRef="generateToken">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.getRoleKeys().contains(11)}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="createApprovalGW2Activate" sourceRef="enableGW" targetRef="activate">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled == null}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="createApprovalGW2Active" sourceRef="enableGW" targetRef="active">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled}]]></conditionExpression>
+    </sequenceFlow>    
+    <sequenceFlow id="createApprovalGW2Suspended" sourceRef="enableGW" targetRef="suspend">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!enabled}]]></conditionExpression>
+    </sequenceFlow>
+    <serviceTask id="activate" name="Activate" activiti:expression="#{autoActivate.execute(execution.processInstanceId)}"/>
+    <sequenceFlow id="flow4" sourceRef="activate" targetRef="active"/>
+    <serviceTask id="generateToken" name="Generate token" activiti:expression="#{generateToken.execute(execution.processInstanceId)}"/>
+    <sequenceFlow id="flow5" sourceRef="generateToken" targetRef="created"/>
+    <userTask id="created" name="Created"/>
+    <sequenceFlow id="flow6" sourceRef="created" targetRef="optinGW"/>
+    <exclusiveGateway id="optinGW"/>
+    <sequenceFlow id="created2Activate" sourceRef="optinGW" targetRef="removeToken">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.checkToken(token)}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="created2Created" sourceRef="optinGW" targetRef="created">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.checkToken(token)}]]></conditionExpression>
+    </sequenceFlow>
+    <scriptTask id="removeToken" name="Remove Token and Activate" scriptFormat="groovy" activiti:autoStoreVariables="false">
+      <script>
+        user.removeToken()    
+      </script>
+    </scriptTask>
+    <sequenceFlow id="flow7" sourceRef="removeToken" targetRef="active"/>
+    <userTask id="active" name="Active"/>
+    <sequenceFlow id="flow8" sourceRef="active" targetRef="activeGw"/>
+    <exclusiveGateway id="activeGw"/>
+    <sequenceFlow id="active2UpdateApproval" sourceRef="activeGw" targetRef="updateApproval">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == user.getUsername() and task == 'update' 
+        and (!userMod.getMembershipsToAdd().isEmpty() or !userMod.getMembershipsToRemove().isEmpty())}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="active2DeleteApproval" sourceRef="activeGw" targetRef="deleteApproval">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == user.getUsername() and task == 'delete'}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="active2Update" sourceRef="activeGw" targetRef="update">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'update'}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="active2Suspend" sourceRef="activeGw" targetRef="suspend">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'suspend'}]]></conditionExpression>
+    </sequenceFlow>    
+    <sequenceFlow id="active2Delete" sourceRef="activeGw" targetRef="delete">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+    </sequenceFlow>    
+    <sequenceFlow id="active2RequestPasswordReset" sourceRef="activeGw" targetRef="generateToken4PasswordReset">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'requestPasswordReset'}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="active2ConfirmPasswordReset" sourceRef="activeGw" targetRef="checkToken4ConfirmPasswordReset">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'confirmPasswordReset'}]]></conditionExpression>
+    </sequenceFlow>    
+    <userTask id="updateApproval" name="Update approval" activiti:candidateGroups="7" activiti:formKey="updateApproval">
+      <extensionElements>
+        <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+        <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
+        <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+      </extensionElements>
+    </userTask>
+    <sequenceFlow id="flow8bis" sourceRef="updateApproval" targetRef="updateApprovalGW"/>
+    <exclusiveGateway id="updateApprovalGW"/>
+    <sequenceFlow id="updateApprovalGW2Update" sourceRef="updateApprovalGW" targetRef="update">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="updateApprovalGW2Reject" sourceRef="updateApprovalGW" targetRef="rejectUpdate">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+    </sequenceFlow>
+    <scriptTask id="rejectUpdate" name="Reject update" scriptFormat="groovy" activiti:autoStoreVariables="false">
+      <script>
+        execution.setVariable("propByResource", null);
+      </script>
+    </scriptTask>
+    <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"/>    
+    <serviceTask id="suspend" name="Suspend" activiti:expression="#{suspend.execute(execution.processInstanceId)}"/>
+    <sequenceFlow id="flow10" sourceRef="suspend" targetRef="suspended"/>
+    <userTask id="suspended" name="Suspended"/>
+    <sequenceFlow id="flow11" sourceRef="suspended" targetRef="suspendedGw"/>
+    <exclusiveGateway id="suspendedGw"/>
+    <sequenceFlow id="suspended2Reactivate" sourceRef="suspendedGw" targetRef="reactivate">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'reactivate'}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="suspended2Delete" sourceRef="suspendedGw" targetRef="delete">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+    </sequenceFlow>
+    <serviceTask id="reactivate" name="Reactivate" activiti:expression="#{reactivate.execute(execution.processInstanceId)}"/>
+    <sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
+    <scriptTask id="reject" name="Reject" scriptFormat="groovy" activiti:autoStoreVariables="false">
+      <script>
+        def scriptVar = rejectReason
+        execution.setVariable("propByResource", null);
+      </script>
+    </scriptTask>
+    <sequenceFlow id="flow13" sourceRef="reject" targetRef="rejected"/>
+    <userTask id="rejected" name="Rejected"/>
+    <sequenceFlow id="flow14" sourceRef="rejected" targetRef="rejectedGw"/>
+    <exclusiveGateway id="rejectedGw"/>
+    <sequenceFlow id="rejected2Delete" sourceRef="rejectedGw" targetRef="delete">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="rejected2Rejected" sourceRef="rejectedGw" targetRef="rejected">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${empty task}]]></conditionExpression>
+    </sequenceFlow>    
+    <userTask id="deleteApproval" name="Delete approval" activiti:candidateGroups="7" activiti:formKey="deleteApproval">
+      <extensionElements>
+        <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+        <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
+        <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+      </extensionElements>
+    </userTask>
+    <sequenceFlow id="flow14bis" sourceRef="deleteApproval" targetRef="deleteApprovalGW"/>
+    <exclusiveGateway id="deleteApprovalGW"/>
+    <sequenceFlow id="deleteApprovalGW2Delete" sourceRef="deleteApprovalGW" targetRef="delete">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="deleteApprovalGW2Reject" sourceRef="deleteApprovalGW" targetRef="rejectDelete">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+    </sequenceFlow>
+    <scriptTask id="rejectDelete" name="Reject delete" scriptFormat="groovy" activiti:autoStoreVariables="false">
+      <script>
+        execution.setVariable("propByResource", null);
+      </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="theStart" id="BPMNShape_theStart">
+        <omgdc:Bounds height="30.0" width="30.0" x="0.0" y="512.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
+        <omgdc:Bounds height="60.0" width="100.0" x="80.0" y="497.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="createGW" id="BPMNShape_createGW">
+        <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="506.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="createApproval" id="BPMNShape_createApproval">
+        <omgdc:Bounds height="60.0" width="100.0" x="320.0" y="560.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="createApprovalGW" id="BPMNShape_createApprovalGW">
+        <omgdc:Bounds height="40.0" width="40.0" x="470.0" y="556.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="enableGW" id="BPMNShape_enableGW">
+        <omgdc:Bounds height="40.0" width="40.0" x="590.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="generateToken" id="BPMNShape_generateToken">
+        <omgdc:Bounds height="60.0" width="100.0" x="702.0" y="188.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="created" id="BPMNShape_created">
+        <omgdc:Bounds height="60.0" width="100.0" x="852.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="240.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="removeToken" id="BPMNShape_removeToken">
+        <omgdc:Bounds height="60.0" width="100.0" x="1092.0" y="248.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="active" id="BPMNShape_active">
+        <omgdc:Bounds height="60.0" width="100.0" x="1030.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="updateApproval" id="BPMNShape_updateApproval">
+        <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="740.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="updateApprovalGW" id="BPMNShape_updateApprovalGW">
+        <omgdc:Bounds height="40.0" width="40.0" x="1670.0" y="740.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="rejectUpdate" id="BPMNShape_rejectUpdate">
+        <omgdc:Bounds height="60.0" width="100.0" x="1790.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
+        <omgdc:Bounds height="60.0" width="100.0" x="1490.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
+        <omgdc:Bounds height="40.0" width="40.0" x="1820.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="reject" id="BPMNShape_reject">
+        <omgdc:Bounds height="60.0" width="100.0" x="560.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="rejectedGw" id="BPMNShape_rejectedGw">
+        <omgdc:Bounds height="40.0" width="40.0" x="890.0" y="775.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="deleteApproval" id="BPMNShape_deleteApproval">
+        <omgdc:Bounds height="60.0" width="100.0" x="1490.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="rejectDelete" id="BPMNShape_rejectDelete">
+        <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="240.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
+        <omgdc:Bounds height="60.0" width="100.0" x="1940.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
+        <omgdc:Bounds height="59.99999999999994" width="100.0" x="1543.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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
+        <omgdc:Bounds height="60.0" width="100.0" x="1558.797798366986" 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"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
+        <omgdi:waypoint x="1658.797798366986" y="591.167207412115"/>
+        <omgdi:waypoint x="1748.971259767517" y="591.167207412115"/>
+      </bpmndi:BPMNEdge>
+      <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>
+      <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>
+      <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>
+      <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>
+      <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>
+      <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
+        <omgdi:waypoint x="1439.5" y="540.5"/>
+        <omgdi:waypoint x="1593.209935088986" y="540.5"/>
+        <omgdi:waypoint x="1593.209935088986" y="512.6749142927692"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
+        <omgdi:waypoint x="1439.5" y="540.5"/>
+        <omgdi:waypoint x="1608.797798366986" y="540.5"/>
+        <omgdi:waypoint x="1608.797798366986" y="561.167207412115"/>
+      </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>
+      <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
+        <omgdi:waypoint x="510.0" y="576.0"/>
+        <omgdi:waypoint x="522.0" y="576.0"/>
+        <omgdi:waypoint x="522.0" y="689.0"/>
+        <omgdi:waypoint x="560.0" y="689.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.6812757582483"/>
+        <omgdi:waypoint x="1955.9214707261015" y="680.6812757582483"/>
+        <omgdi:waypoint x="1986.506931044467" y="418.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
+        <omgdi:waypoint x="1710.0" y="760.0"/>
+        <omgdi:waypoint x="1752.0" y="760.0"/>
+        <omgdi:waypoint x="1752.0" y="730.0"/>
+        <omgdi:waypoint x="1790.0" y="730.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>
+      <bpmndi:BPMNEdge bpmnElement="rejected2Delete" id="BPMNEdge_rejected2Delete">
+        <omgdi:waypoint x="930.0" y="795.0"/>
+        <omgdi:waypoint x="972.0" y="795.0"/>
+        <omgdi:waypoint x="1470.0" y="911.0"/>
+        <omgdi:waypoint x="1990.0" y="911.0"/>
+        <omgdi:waypoint x="1990.0" y="418.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Active" id="BPMNEdge_createApprovalGW2Active">
+        <omgdi:waypoint x="630.0" y="449.0"/>
+        <omgdi:waypoint x="674.0" y="449.0"/>
+        <omgdi:waypoint x="674.0" y="540.0"/>
+        <omgdi:waypoint x="1030.0" y="540.8768472906404"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
+        <omgdi:waypoint x="1710.0" y="760.0"/>
+        <omgdi:waypoint x="1752.0" y="760.0"/>
+        <omgdi:waypoint x="1752.0" y="870.0"/>
+        <omgdi:waypoint x="1790.0" y="870.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
+        <omgdi:waypoint x="1790.0" y="879.6774193548387"/>
+        <omgdi:waypoint x="1778.0" y="882.0"/>
+        <omgdi:waypoint x="1225.0" y="787.0"/>
+        <omgdi:waypoint x="1080.0" y="726.0"/>
+        <omgdi:waypoint x="1080.0" y="571.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
+        <omgdi:waypoint x="1643.209935088986" y="482.6749142927693"/>
+        <omgdi:waypoint x="1748.9712597675173" y="482.67491429276924"/>
+      </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>
+      <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>
+      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
+        <omgdi:waypoint x="760.0" y="770.0"/>
+        <omgdi:waypoint x="760.0" y="732.8074937730017"/>
+        <omgdi:waypoint x="910.0" y="732.8074937730017"/>
+        <omgdi:waypoint x="910.0" y="775.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
+        <omgdi:waypoint x="510.0" y="576.0"/>
+        <omgdi:waypoint x="522.0" y="576.0"/>
+        <omgdi:waypoint x="522.0" y="449.0"/>
+        <omgdi:waypoint x="590.0" y="449.0"/>
+      </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>
+      <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
+        <omgdi:waypoint x="270.0" y="526.0"/>
+        <omgdi:waypoint x="282.0" y="526.0"/>
+        <omgdi:waypoint x="282.0" y="449.0"/>
+        <omgdi:waypoint x="590.0" y="449.0"/>
+      </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>
+      <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>
+      <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
+        <omgdi:waypoint x="1042.0" y="260.0"/>
+        <omgdi:waypoint x="1054.0" y="260.0"/>
+        <omgdi:waypoint x="1054.0" y="278.0"/>
+        <omgdi:waypoint x="1092.0" y="278.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
+        <omgdi:waypoint x="270.0" y="526.0"/>
+        <omgdi:waypoint x="282.0" y="526.0"/>
+        <omgdi:waypoint x="282.0" y="590.0"/>
+        <omgdi:waypoint x="320.0" y="590.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="420.0" y="590.0"/>
+        <omgdi:waypoint x="432.0" y="590.0"/>
+        <omgdi:waypoint x="432.0" y="576.0"/>
+        <omgdi:waypoint x="470.0" y="576.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="180.0" y="527.0"/>
+        <omgdi:waypoint x="192.0" y="527.0"/>
+        <omgdi:waypoint x="192.0" y="526.0"/>
+        <omgdi:waypoint x="230.0" y="526.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
+        <omgdi:waypoint x="890.6451612903226" y="795.6451612903226"/>
+        <omgdi:waypoint x="810.0" y="798.3333333333334"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="802.0" y="218.0"/>
+        <omgdi:waypoint x="814.0" y="218.0"/>
+        <omgdi:waypoint x="814.0" y="243.0"/>
+        <omgdi:waypoint x="852.0" y="243.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>
+      <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"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
+        <omgdi:waypoint x="1790.0" y="260.7608891486752"/>
+        <omgdi:waypoint x="1424.117736926915" y="193.1523534073587"/>
+        <omgdi:waypoint x="1109.678315230625" y="511.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="createApprovalGW2OptIn" id="BPMNEdge_createApprovalGW2OptIn">
+        <omgdi:waypoint x="630.0" y="449.0"/>
+        <omgdi:waypoint x="674.0" y="449.0"/>
+        <omgdi:waypoint x="700.0" y="449.0"/>
+        <omgdi:waypoint x="745.2467532467532" y="248.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>
+      <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
+        <omgdi:waypoint x="1748.9712597675173" y="459.5470829510475"/>
+        <omgdi:waypoint x="1592.4096593525787" y="387.128477171313"/>
+        <omgdi:waypoint x="1130.0" y="525.9854974413342"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
+        <omgdi:waypoint x="1002.0" y="260.0"/>
+        <omgdi:waypoint x="990.0" y="260.0"/>
+        <omgdi:waypoint x="990.0" y="243.0"/>
+        <omgdi:waypoint x="952.0" y="243.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
+        <omgdi:waypoint x="1748.971259767517" y="619.7464352880323"/>
+        <omgdi:waypoint x="1673.525420205687" y="662.8701121105813"/>
+        <omgdi:waypoint x="1130.0" y="551.266629529393"/>
+      </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>
+      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
+        <omgdi:waypoint x="1134.9277566539924" y="308.0"/>
+        <omgdi:waypoint x="1087.0722433460076" y="511.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
+        <omgdi:waypoint x="952.0" y="252.67741935483872"/>
+        <omgdi:waypoint x="964.0" y="255.0"/>
+        <omgdi:waypoint x="964.0" y="260.0"/>
+        <omgdi:waypoint x="1002.0" y="260.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+        <omgdi:waypoint x="1828.6246202240113" y="760.0"/>
+        <omgdi:waypoint x="1811.88836468294" y="804.1381014189917"/>
+        <omgdi:waypoint x="1474.4398193359375" y="804.1381014189917"/>
+        <omgdi:waypoint x="1124.969521769241" y="571.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>
+      <bpmndi:BPMNEdge bpmnElement="flow8bis" id="BPMNEdge_flow8bis">
+        <omgdi:waypoint x="1590.0" y="770.0"/>
+        <omgdi:waypoint x="1602.0" y="770.0"/>
+        <omgdi:waypoint x="1602.0" y="760.0"/>
+        <omgdi:waypoint x="1670.0" y="760.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"/>
+      </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>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/workflow.properties b/syncope620/fit/server-reference/src/main/resources/workflow.properties
new file mode 100644
index 0000000..0cad37e
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/workflow.properties
@@ -0,0 +1,20 @@
+# 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.
+wf.directory=${conf.directory}
+jobExecutorActivate=true
+uwfAdapter=org.apache.syncope.server.workflow.activiti.ActivitiUserWorkflowAdapter
+rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp b/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp
new file mode 100644
index 0000000..5ff8a6b
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp
@@ -0,0 +1,190 @@
+<%--
+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.
+--%>
+<%@page import="org.apache.syncope.common.lib.SyncopeConstants"%>
+<%@page import="org.apache.syncope.server.misc.spring.ApplicationContextProvider"%>
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
+<%@page import="java.text.SimpleDateFormat"%>
+<%@page import="java.util.Date"%>
+<%@page import="org.apache.openjpa.datacache.CacheStatisticsImpl"%>
+<%@page import="javax.persistence.EntityManagerFactory"%>
+<%@page import="org.apache.openjpa.persistence.OpenJPAPersistence"%>
+<%@page import="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory"%>
+<%@page import="org.springframework.context.ConfigurableApplicationContext"%>
+<%@page import="org.apache.openjpa.datacache.QueryKey"%>
+<%@page import="org.apache.openjpa.kernel.QueryStatistics"%>
+<%@page import="org.apache.openjpa.persistence.QueryResultCacheImpl"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Cache Statistics</title>
+    <style type="text/css">
+      .c{
+        text-align: center;
+      }
+      .r{
+        text-align: right;
+      }
+      .l{
+        text-align: left;
+      }
+      .t{
+        vertical-align: top;
+      }
+      .b{
+        vertical-align: bottom;
+      }
+      .odd{
+        background-color: #D4D4D4;
+      }
+      .even{
+        background-color: #EEEEEE;
+      }
+      .bd1{
+        border: solid #888888 1px;
+      }
+      .bg1{
+        background-color: #CCCCCC;
+      }
+      .bg2{
+        background-color: #DDDDDD;
+      }
+    </style>
+  </head>
+  <body>
+    <p/>
+    <%
+        ConfigurableApplicationContext context = ApplicationContextProvider.getApplicationContext();
+
+        EntityManagerFactory emf = context.getBean(EntityManagerFactory.class);
+        OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
+
+        QueryStatistics<QueryKey> queryStatistics =
+                ((QueryResultCacheImpl) oemf.getQueryResultCache()).getDelegate().getStatistics();
+
+        CacheStatisticsImpl statistics = (CacheStatisticsImpl) oemf.getStoreCache().getStatistics();
+
+        String action = request.getParameter("do");
+        StringBuilder info = new StringBuilder(512);
+
+        if ("activate".equals(action) && !statistics.isEnabled()) {
+            statistics.enable();
+            info.append("Statistics enabled\n");
+        } else if ("deactivate".equals(action) && !statistics.isEnabled()) {
+            statistics.disable();
+            info.append("Statistics disabled\n");
+        } else if ("clear".equals(action)) {
+            queryStatistics.reset();
+            statistics.reset();
+            info.append("Statistics cleared\n");
+        }
+
+        SimpleDateFormat sdf = new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN);
+        if (info.length() > 0) {
+    %>
+    <p/><div class="success">
+      <c:out value="${fn:escapeXml(info)}"/>
+    </div>
+    <%                    }%>
+    <p/>
+    <a href="?">Reload</a>
+    <p/>
+    <a href="?do=<%=(statistics.isEnabled() ? "deactivate" : "activate")%>">
+      <%=(statistics.isEnabled() ? "DEACTIVATE" : "ACTIVATE")%></a>
+    <a href="?do=clear">CLEAR</a>
+    <p/>
+    Last update: <%=sdf.format(statistics.since())%><br/>
+    Activation: <%=sdf.format(statistics.start())%><br/>
+    <p/>
+    <table>
+      <tr>
+        <th class="c bd1 bg1">Hits</th>
+        <td><%=statistics.getHitCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Reads</th>
+        <td><%=statistics.getReadCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Writes</th>
+        <td><%=statistics.getWriteCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Query Hits</th>
+        <td><%=queryStatistics.getHitCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Query Executions</th>
+        <td><%=queryStatistics.getExecutionCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Query Evictions</th>
+        <td><%=queryStatistics.getEvictionCount()%></td>
+      </tr>
+    </table>
+    <p/>
+    <table width="100%">
+      <tr><th colspan="3" class="c bd1 bg2">Query statistics</th></tr>
+      <tr>
+        <th class="c bd1 bg1">Query</th>
+        <th class="c bd1 bg1">Hits</th>
+        <th class="c bd1 bg1">Executions</th>
+      </tr>
+      <%
+          boolean odd = true;
+          for (QueryKey key : queryStatistics.keys()) {
+      %>
+      <tr class="<%=(odd ? "odd" : "even")%>">
+        <td><%=key%></td>
+        <td><%=queryStatistics.getHitCount(key)%></td>
+        <td><%=queryStatistics.getExecutionCount(key)%></td>
+      </tr>
+      <%
+              odd = !odd;
+          }
+      %>
+    </table>
+    <p/>
+    <table width="100%">
+      <tr><th colspan="4" class="c bd1 bg2">2nd level cache statistics</th></tr>
+      <tr>
+        <th class="c bd1 bg1">Region</th>
+        <th class="c bd1 bg1">Hits</th>
+        <th class="c bd1 bg1">Reads</th>
+        <th class="c bd1 bg1">Writes</th>
+      </tr>
+      <%
+          odd = true;
+          for (String className : statistics.classNames()) {
+      %>
+      <tr class="<%=(odd ? "odd" : "even")%>">
+        <td><%=className%></td>
+        <td><%=statistics.getHitCount(className)%></td>
+        <td><%=statistics.getReadCount(className)%></td>
+        <td><%=statistics.getWriteCount(className)%></td>
+      </tr>
+      <%
+              odd = !odd;
+          }
+      %>
+    </table>
+  </body>
+</html>