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 2018/09/25 12:31:59 UTC
[01/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Repository: syncope
Updated Branches:
refs/heads/2_1_X 8c103a87b -> 66b3a04ee
refs/heads/master 11612399a -> 3cabe08aa
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 fa9353d..6f2d6a0 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
@@ -66,8 +66,6 @@ include::configureconnidlocations.adoc[]
include::importexport.adoc[]
-include::flowablemodeler.adoc[]
-
include::connectorbundles.adoc[]
include::emailconfiguration.adoc[]
[23/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml
new file mode 100644
index 0000000..cc905a3
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml
@@ -0,0 +1,1418 @@
+<?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.
+-->
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+
+ <!-- TASK INSERT -->
+
+ <insert id="insertTask" parameterType="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ insert into ${prefix}ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_, ASSIGNEE_, DELEGATION_,
+ EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_,
+ TASK_DEF_KEY_, DUE_DATE_, CATEGORY_, SUSPENSION_STATE_, TENANT_ID_, FORM_KEY_, CLAIM_TIME_,
+ IS_COUNT_ENABLED_, VAR_COUNT_, ID_LINK_COUNT_, SUB_TASK_COUNT_)
+ values (#{id, jdbcType=VARCHAR},
+ 1,
+ #{name, jdbcType=VARCHAR},
+ #{parentTaskId, jdbcType=VARCHAR},
+ #{description, jdbcType=VARCHAR},
+ #{priority, jdbcType=INTEGER},
+ #{createTime, jdbcType=TIMESTAMP},
+ #{owner, jdbcType=VARCHAR},
+ #{assignee, jdbcType=VARCHAR},
+ #{delegationStateString, jdbcType=VARCHAR},
+ #{executionId, jdbcType=VARCHAR},
+ #{processInstanceId, jdbcType=VARCHAR},
+ #{processDefinitionId, jdbcType=VARCHAR},
+ #{taskDefinitionId, jdbcType=VARCHAR},
+ #{scopeId, jdbcType=VARCHAR},
+ #{subScopeId, jdbcType=VARCHAR},
+ #{scopeType, jdbcType=VARCHAR},
+ #{scopeDefinitionId, jdbcType=VARCHAR},
+ #{taskDefinitionKey, jdbcType=VARCHAR},
+ #{dueDate, jdbcType=TIMESTAMP},
+ #{category, jdbcType=VARCHAR},
+ #{suspensionState, jdbcType=INTEGER},
+ #{tenantId, jdbcType=VARCHAR},
+ #{formKey, jdbcType=VARCHAR},
+ #{claimTime, jdbcType=TIMESTAMP},
+ #{isCountEnabled, jdbcType=BOOLEAN},
+ #{variableCount, jdbcType=INTEGER},
+ #{identityLinkCount, jdbcType=INTEGER},
+ #{subTaskCount, jdbcType=INTEGER}
+ )
+ </insert>
+
+ <insert id="bulkInsertTask" parameterType="java.util.List">
+ INSERT INTO ${prefix}ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_, ASSIGNEE_, DELEGATION_,
+ EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_,
+ TASK_DEF_KEY_, DUE_DATE_, CATEGORY_, SUSPENSION_STATE_, TENANT_ID_, FORM_KEY_, CLAIM_TIME_,
+ IS_COUNT_ENABLED_, VAR_COUNT_, ID_LINK_COUNT_, SUB_TASK_COUNT_)
+ VALUES
+ <foreach collection="list" item="task" index="index" separator=",">
+ (#{task.id, jdbcType=VARCHAR},
+ 1,
+ #{task.name, jdbcType=VARCHAR},
+ #{task.parentTaskId, jdbcType=VARCHAR},
+ #{task.description, jdbcType=VARCHAR},
+ #{task.priority, jdbcType=INTEGER},
+ #{task.createTime, jdbcType=TIMESTAMP},
+ #{task.owner, jdbcType=VARCHAR},
+ #{task.assignee, jdbcType=VARCHAR},
+ #{task.delegationStateString, jdbcType=VARCHAR},
+ #{task.executionId, jdbcType=VARCHAR},
+ #{task.processInstanceId, jdbcType=VARCHAR},
+ #{task.processDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionId, jdbcType=VARCHAR},
+ #{task.scopeId, jdbcType=VARCHAR},
+ #{task.subScopeId, jdbcType=VARCHAR},
+ #{task.scopeType, jdbcType=VARCHAR},
+ #{task.scopeDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionKey, jdbcType=VARCHAR},
+ #{task.dueDate, jdbcType=TIMESTAMP},
+ #{task.category, jdbcType=VARCHAR},
+ #{task.suspensionState, jdbcType=INTEGER},
+ #{task.tenantId, jdbcType=VARCHAR},
+ #{task.formKey, jdbcType=VARCHAR},
+ #{task.claimTime, jdbcType=TIMESTAMP},
+ #{task.isCountEnabled, jdbcType=BOOLEAN},
+ #{task.variableCount, jdbcType=INTEGER},
+ #{task.identityLinkCount, jdbcType=INTEGER},
+ #{task.subTaskCount, jdbcType=INTEGER}
+ )
+ </foreach>
+ </insert>
+
+ <insert id="bulkInsertTask" databaseId="oracle" parameterType="java.util.List">
+ INSERT ALL
+ <foreach collection="list" item="task" index="index">
+ INTO ${prefix}ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_, ASSIGNEE_, DELEGATION_,
+ EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, TASK_DEF_KEY_,
+ DUE_DATE_, CATEGORY_, SUSPENSION_STATE_, TENANT_ID_, FORM_KEY_, CLAIM_TIME_,
+ IS_COUNT_ENABLED_, VAR_COUNT_, ID_LINK_COUNT_, SUB_TASK_COUNT_) VALUES
+ (#{task.id, jdbcType=VARCHAR},
+ 1,
+ #{task.name, jdbcType=VARCHAR},
+ #{task.parentTaskId, jdbcType=VARCHAR},
+ #{task.description, jdbcType=VARCHAR},
+ #{task.priority, jdbcType=INTEGER},
+ #{task.createTime, jdbcType=TIMESTAMP},
+ #{task.owner, jdbcType=VARCHAR},
+ #{task.assignee, jdbcType=VARCHAR},
+ #{task.delegationStateString, jdbcType=VARCHAR},
+ #{task.executionId, jdbcType=VARCHAR},
+ #{task.processInstanceId, jdbcType=VARCHAR},
+ #{task.processDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionId, jdbcType=VARCHAR},
+ #{task.scopeId, jdbcType=VARCHAR},
+ #{task.subScopeId, jdbcType=VARCHAR},
+ #{task.scopeType, jdbcType=VARCHAR},
+ #{task.scopeDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionKey, jdbcType=VARCHAR},
+ #{task.dueDate, jdbcType=TIMESTAMP},
+ #{task.category, jdbcType=VARCHAR},
+ #{task.suspensionState, jdbcType=INTEGER},
+ #{task.tenantId, jdbcType=VARCHAR},
+ #{task.formKey, jdbcType=VARCHAR},
+ #{task.claimTime, jdbcType=TIMESTAMP},
+ #{task.isCountEnabled, jdbcType=BOOLEAN},
+ #{task.variableCount, jdbcType=INTEGER},
+ #{task.identityLinkCount, jdbcType=INTEGER},
+ #{task.subTaskCount, jdbcType=INTEGER}
+ )
+ </foreach>
+ SELECT * FROM dual
+ </insert>
+
+ <!-- TASK UPDATE -->
+
+ <update id="updateTask" parameterType="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ update ${prefix}ACT_RU_TASK
+ <set>
+ REV_ = #{revisionNext, jdbcType=INTEGER},
+ <if test="originalPersistentState.name != name">
+ NAME_ = #{name, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.parentTaskId != parentTaskId">
+ PARENT_TASK_ID_ = #{parentTaskId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.priority != priority">
+ PRIORITY_ = #{priority, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.createTime != createTime">
+ CREATE_TIME_ = #{createTime, jdbcType=TIMESTAMP},
+ </if>
+ <if test="originalPersistentState.owner != owner">
+ OWNER_ = #{owner, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.assignee != assignee">
+ ASSIGNEE_ = #{assignee, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.delegationStateString != delegationStateString">
+ DELEGATION_ = #{delegationStateString, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.executionId != executionId">
+ EXECUTION_ID_ = #{executionId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.processDefinitionId != processDefinitionId">
+ PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.taskDefinitionId != taskDefinitionId">
+ TASK_DEF_ID_ = #{taskDefinitionId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.scopeId != scopeId">
+ SCOPE_ID_ = #{scopeId, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.subScopeId != subScopeId">
+ SUB_SCOPE_ID_ = #{subScopeId, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.scopeType != scopeType">
+ SCOPE_TYPE_ = #{scopeType, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.scopeDefinitionId != scopeDefinitionId">
+ SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.description != description">
+ DESCRIPTION_ = #{description, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.dueDate != dueDate">
+ DUE_DATE_ = #{dueDate, jdbcType=TIMESTAMP},
+ </if>
+ <if test="originalPersistentState.category != category">
+ CATEGORY_ = #{category, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.suspensionState != suspensionState">
+ SUSPENSION_STATE_ = #{suspensionState, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.formKey != formKey">
+ FORM_KEY_ = #{formKey, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.claimTime != claimTime">
+ CLAIM_TIME_ = #{claimTime, jdbcType=TIMESTAMP},
+ </if>
+ <if test="originalPersistentState.isCountEnabled != isCountEnabled">
+ IS_COUNT_ENABLED_ = #{isCountEnabled, jdbcType=BOOLEAN},
+ </if>
+ <if test="originalPersistentState.variableCount != variableCount">
+ VAR_COUNT_ = #{variableCount, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.identityLinkCount != identityLinkCount">
+ ID_LINK_COUNT_ = #{identityLinkCount, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.subTaskCount != subTaskCount">
+ SUB_TASK_COUNT_ = #{subTaskCount, jdbcType=INTEGER}
+ </if>
+ </set>
+ where ID_= #{id, jdbcType=VARCHAR}
+ and REV_ = #{revision, jdbcType=INTEGER}
+ </update>
+
+ <update id="updateTaskTenantIdForDeployment" parameterType="java.util.Map">
+ update ${prefix}ACT_RU_TASK set
+ TENANT_ID_ = #{tenantId, jdbcType=VARCHAR}
+ where
+ ID_ in (
+ SELECT T.ID_ from ${prefix}ACT_RU_TASK T
+ inner join ${prefix}ACT_RE_PROCDEF P on T.PROC_DEF_ID_ = P.ID_
+ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_
+ where D.ID_ = #{deploymentId, jdbcType=VARCHAR}
+ )
+ </update>
+
+ <!-- See http://stackoverflow.com/questions/4429319/you-cant-specify-target-table-for-update-in-from-clause
+ Tested this on MySQL 5.6: does NOT use a temporary table (so good, performance0 -->
+ <update id="updateTaskTenantIdForDeployment" databaseId="mysql" parameterType="java.util.Map">
+ update ${prefix}ACT_RU_TASK set
+ TENANT_ID_ = #{tenantId, jdbcType=VARCHAR}
+ where
+ ID_ in (
+
+ SELECT tempTask.tempId
+ FROM (
+ SELECT T.ID_ as tempId
+ FROM ${prefix}ACT_RU_TASK T
+ inner join ${prefix}ACT_RE_PROCDEF P on T.PROC_DEF_ID_ = P.ID_
+ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_
+ where D.ID_ = #{deploymentId, jdbcType=VARCHAR}
+
+ ) AS tempTask
+
+ )
+ </update>
+
+
+ <update id="updateTaskRelatedEntityCountEnabled" parameterType="boolean">
+ update ${prefix}ACT_RU_TASK
+ set IS_COUNT_ENABLED_ = #{parameter, jdbcType=BOOLEAN}
+ </update>
+
+ <!-- TASK DELETE -->
+ <delete id="deleteTask" parameterType="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ delete from ${prefix}ACT_RU_TASK where ID_ = #{id} and REV_ = #{revision}
+ </delete>
+
+ <delete id="deleteTasksByExecutionId" parameterType="string">
+ delete from ${prefix}ACT_RU_TASK where EXECUTION_ID_ = #{id}
+ </delete>
+
+ <delete id="bulkDeleteTask" parameterType="java.util.Collection">
+ delete from ${prefix}ACT_RU_TASK where
+ <foreach item="task" collection="list" index="index" separator=" or ">
+ ID_ = #{task.id, jdbcType=VARCHAR}
+ </foreach>
+ </delete>
+
+ <!-- TASK RESULTMAP -->
+
+ <resultMap id="taskResultMap" type="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ <id property="id" column="ID_" jdbcType="VARCHAR"/>
+ <result property="revision" column="REV_" jdbcType="INTEGER"/>
+ <result property="name" column="NAME_" jdbcType="VARCHAR"/>
+ <result property="parentTaskId" column="PARENT_TASK_ID_" jdbcType="VARCHAR"/>
+ <result property="description" column="DESCRIPTION_" jdbcType="VARCHAR"/>
+ <result property="priority" column="PRIORITY_" jdbcType="INTEGER"/>
+ <result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP" />
+ <result property="owner" column="OWNER_" jdbcType="VARCHAR"/>
+ <result property="assignee" column="ASSIGNEE_" jdbcType="VARCHAR"/>
+ <result property="delegationStateString" column="DELEGATION_" jdbcType="VARCHAR"/>
+ <result property="executionId" column="EXECUTION_ID_" jdbcType="VARCHAR" />
+ <result property="processInstanceId" column="PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="processDefinitionId" column="PROC_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionId" column="TASK_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeId" column="SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="subScopeId" column="SUB_SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeType" column="SCOPE_TYPE_" jdbcType="VARCHAR"/>
+ <result property="scopeDefinitionId" column="SCOPE_DEFINITION_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionKey" column="TASK_DEF_KEY_" jdbcType="VARCHAR"/>
+ <result property="dueDate" column="DUE_DATE_" jdbcType="TIMESTAMP"/>
+ <result property="category" column="CATEGORY_" jdbcType="VARCHAR" />
+ <result property="suspensionState" column="SUSPENSION_STATE_" jdbcType="INTEGER" />
+ <result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR" />
+ <result property="formKey" column="FORM_KEY_" jdbcType="VARCHAR" />
+ <result property="claimTime" column="CLAIM_TIME_" jdbcType="TIMESTAMP" />
+ <result property="isCountEnabled" column="IS_COUNT_ENABLED_" jdbcType="BOOLEAN" />
+ <result property="variableCount" column="VAR_COUNT_" jdbcType="INTEGER" />
+ <result property="identityLinkCount" column="ID_LINK_COUNT_" jdbcType="INTEGER" />
+ <result property="subTaskCount" column="SUB_TASK_COUNT_" jdbcType="INTEGER" />
+ </resultMap>
+
+ <resultMap id="taskAndRelatedEntitiesResultMap" type="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ <id property="id" column="ID_" jdbcType="VARCHAR"/>
+ <result property="revision" column="REV_" jdbcType="INTEGER"/>
+ <result property="name" column="NAME_" jdbcType="VARCHAR"/>
+ <result property="parentTaskId" column="PARENT_TASK_ID_" jdbcType="VARCHAR"/>
+ <result property="description" column="DESCRIPTION_" jdbcType="VARCHAR"/>
+ <result property="priority" column="PRIORITY_" jdbcType="INTEGER"/>
+ <result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP" />
+ <result property="owner" column="OWNER_" jdbcType="VARCHAR"/>
+ <result property="assignee" column="ASSIGNEE_" jdbcType="VARCHAR"/>
+ <result property="delegationStateString" column="DELEGATION_" jdbcType="VARCHAR"/>
+ <result property="executionId" column="EXECUTION_ID_" jdbcType="VARCHAR" />
+ <result property="processInstanceId" column="PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="processDefinitionId" column="PROC_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionId" column="TASK_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeId" column="SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="subScopeId" column="SUB_SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeType" column="SCOPE_TYPE_" jdbcType="VARCHAR"/>
+ <result property="scopeDefinitionId" column="SCOPE_DEFINITION_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionKey" column="TASK_DEF_KEY_" jdbcType="VARCHAR"/>
+ <result property="dueDate" column="DUE_DATE_" jdbcType="TIMESTAMP"/>
+ <result property="category" column="CATEGORY_" jdbcType="VARCHAR" />
+ <result property="suspensionState" column="SUSPENSION_STATE_" jdbcType="INTEGER" />
+ <result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR" />
+ <result property="formKey" column="FORM_KEY_" jdbcType="VARCHAR" />
+ <result property="claimTime" column="CLAIM_TIME_" jdbcType="TIMESTAMP" />
+ <result property="isCountEnabled" column="IS_COUNT_ENABLED_" jdbcType="BOOLEAN" />
+ <result property="variableCount" column="VAR_COUNT_" jdbcType="INTEGER" />
+ <result property="identityLinkCount" column="ID_LINK_COUNT_" jdbcType="INTEGER" />
+ <result property="subTaskCount" column="SUB_TASK_COUNT_" jdbcType="INTEGER" />
+ <collection property="queryVariables" column="TASK_ID_" javaType="ArrayList" ofType="org.flowable.variable.service.impl.persistence.entity.VariableInstanceEntityImpl">
+ <id property="id" column="VAR_ID_"/>
+ <result property="name" column="VAR_NAME_" javaType="String" jdbcType="VARCHAR" />
+ <result property="type" column="VAR_TYPE_" javaType="org.flowable.variable.api.types.VariableType" jdbcType="VARCHAR" />
+ <result property="revision" column="VAR_REV_" jdbcType="INTEGER" />
+ <result property="processInstanceId" column="VAR_PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="executionId" column="VAR_EXECUTION_ID_" jdbcType="VARCHAR" />
+ <result property="taskId" column="VAR_TASK_ID_" jdbcType="VARCHAR" />
+ <result property="byteArrayRef" column="VAR_BYTEARRAY_ID_" typeHandler="VariableByteArrayRefTypeHandler"/>
+ <result property="doubleValue" column="VAR_DOUBLE_" jdbcType="DOUBLE" />
+ <result property="textValue" column="VAR_TEXT_" jdbcType="VARCHAR" />
+ <result property="textValue2" column="VAR_TEXT2_" jdbcType="VARCHAR" />
+ <result property="longValue" column="VAR_LONG_" jdbcType="BIGINT" />
+ </collection>
+ <collection property="queryIdentityLinks" column="TASK_ID_" javaType="ArrayList" ofType="org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntityImpl">
+ <id property="id" column="ILINK_ID_"/>
+ <result property="type" column="ILINK_TYPE_" jdbcType="VARCHAR" />
+ <result property="userId" column="ILINK_USER_ID_" jdbcType="VARCHAR" />
+ <result property="groupId" column="ILINK_GROUP_ID_" jdbcType="VARCHAR" />
+ <result property="taskId" column="ILINK_TASK_ID_" jdbcType="VARCHAR" />
+ <result property="processInstanceId" column="ILINK_PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="processDefId" column="ILINK_PROC_DEF_ID_" jdbcType="VARCHAR" />
+ </collection>
+ </resultMap>
+
+ <!-- TASK SELECT -->
+
+ <select id="selectTask" parameterType="string" resultMap="taskResultMap">
+ select * from ${prefix}ACT_RU_TASK where ID_ = #{id, jdbcType=VARCHAR}
+ </select>
+
+ <select id="selectTasksByParentTaskId" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select * from ${prefix}ACT_RU_TASK where PARENT_TASK_ID_ = #{parameter}
+ </select>
+
+ <select id="selectTasksByExecutionId" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select distinct T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.EXECUTION_ID_ = #{parameter}
+ </select>
+
+ <select id="selectTasksByProcessInstanceId" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.PROC_INST_ID_ = #{parameter}
+ </select>
+
+ <select id="selectTasksBySubScopeIdAndScopeType" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.SUB_SCOPE_ID_ = #{parameter.subScopeId, jdbcType=VARCHAR} and T.SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=VARCHAR}
+ </select>
+
+ <select id="selectTasksByScopeIdAndScopeType" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.SCOPE_ID_ = #{parameter.scopeId, jdbcType=VARCHAR} and T.SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=VARCHAR}
+ </select>
+
+ <!-- Using distinct here because a task can appear multiple times in a resultset when -->
+ <select id="selectTaskByQueryCriteria" parameterType="org.apache.syncope.core.flowable.impl.SyncopeTaskQueryImpl" resultMap="taskResultMap">
+ <if test="firstResult != null and firstResult >= 0">${limitBefore}</if>
+ select distinct RES.* <if test="nullHandlingColumn != null">, ${nullHandlingColumn}</if>
+ <if test="firstResult != null and firstResult >= 0">${limitBetween}</if>
+ <include refid="selectTaskByQueryCriteriaSql"/>
+ ${orderBy}
+ <if test="firstResult != null and firstResult >= 0">${limitAfter}</if>
+ </select>
+
+ <select id="selectTaskCountByQueryCriteria" parameterType="org.apache.syncope.core.flowable.impl.SyncopeTaskQueryImpl" resultType="long">
+ select count(distinct RES.ID_)
+ <include refid="selectTaskByQueryCriteriaSql"/>
+ </select>
+
+ <sql id="selectTaskByQueryCriteriaSql">
+ from ${prefix}ACT_RU_TASK RES
+ <include refid="commonSelectTaskByQueryCriteriaSql"/>
+ </sql>
+
+ <select id="selectTasksWithRelatedEntitiesByQueryCriteria" parameterType="org.apache.syncope.core.flowable.impl.SyncopeTaskQueryImpl" resultMap="taskAndRelatedEntitiesResultMap">
+ <include refid="selectTasksWithRelatedEntitiesByQueryCriteriaColumns"/>
+ <include refid="selectTasksWithRelatedEntitiesByQueryCriteriaSql"/>
+ ${orderBy}
+ <if test="firstResult != null and firstResult >= 0">${limitAfter}</if>
+ </select>
+
+ <sql id="selectTasksWithRelatedEntitiesByQueryCriteriaColumns">
+ <if test="firstResult != null and firstResult >= 0">${limitBefore}</if>
+ <if test="_databaseId != 'db2' and _databaseId != 'mssql'">
+ select RES.*,
+ <if test="includeTaskLocalVariables or includeProcessVariables">
+ VAR.ID_ as VAR_ID_, VAR.NAME_ as VAR_NAME_, VAR.TYPE_ as VAR_TYPE_, VAR.REV_ as VAR_REV_,
+ VAR.PROC_INST_ID_ as VAR_PROC_INST_ID_, VAR.EXECUTION_ID_ as VAR_EXECUTION_ID_, VAR.TASK_ID_ as VAR_TASK_ID_,
+ VAR.BYTEARRAY_ID_ as VAR_BYTEARRAY_ID_, VAR.DOUBLE_ as VAR_DOUBLE_,
+ VAR.TEXT_ as VAR_TEXT_, VAR.TEXT2_ as VAR_TEXT2_, VAR.LONG_ as VAR_LONG_
+ </if>
+ <if test="(includeTaskLocalVariables or includeProcessVariables) and includeIdentityLinks">
+ ,
+ </if>
+ <if test="includeIdentityLinks">
+ ILINK.ID_ as ILINK_ID_, ILINK.TYPE_ as ILINK_TYPE_, ILINK.USER_ID_ as ILINK_USER_ID_,
+ ILINK.GROUP_ID_ as ILINK_GROUP_ID_, ILINK.TASK_ID_ as ILINK_TASK_ID_,
+ ILINK.PROC_INST_ID_ as ILINK_PROC_INST_ID_, ILINK.PROC_DEF_ID_ as ILINK_PROC_DEF_ID_
+ </if>
+ <if test="firstResult != null and firstResult >= 0">${limitBetween}</if>
+ </if>
+ <if test="_databaseId == 'db2' || _databaseId == 'mssql'">
+ select distinct TEMPRES_ID_ as ID_, TEMPRES_REV_ as REV_, TEMPRES_NAME_ as NAME_,
+ TEMPRES_PARENT_TASK_ID_ as PARENT_TASK_ID_, TEMPRES_DESCRIPTION_ as DESCRIPTION_,
+ TEMPRES_PRIORITY_ as PRIORITY_, TEMPRES_CREATE_TIME_ as CREATE_TIME_,
+ TEMPRES_OWNER_ as OWNER_, TEMPRES_ASSIGNEE_ as ASSIGNEE_, TEMPRES_DELEGATION_ as DELEGATION_,
+ TEMPRES_FORM_KEY_ as FORM_KEY_, TEMPRES_CLAIM_TIME_ as CLAIM_TIME_, TEMPRES_EXECUTION_ID_ as EXECUTION_ID_,
+ TEMPRES_PROC_INST_ID_ as PROC_INST_ID_, TEMPRES_PROC_DEF_ID_ as PROC_DEF_ID_,
+ TEMPRES_TASK_DEF_ID_ as TASK_DEF_ID_, TEMPRES_TASK_DEF_KEY_ as TASK_DEF_KEY_,
+ TEMPRES_DUE_DATE_ as DUE_DATE_, TEMPRES_SUSPENSION_STATE_ as SUSPENSION_STATE_, TEMPRES_CATEGORY_ as CATEGORY_,
+ TEMPRES_IS_COUNT_ENABLED_ as IS_COUNT_ENABLED_, TEMPRES_VAR_COUNT_ as VAR_COUNT_, TEMPRES_ID_LINK_COUNT_ as ID_LINK_COUNT_, TEMPRES_ID_SUB_TASK_COUNT_ as SUB_TASK_COUNT_
+ <if test="includeTaskLocalVariables or includeProcessVariables">
+ ,
+ TEMPVAR_ID_ as VAR_ID_, TEMPVAR_NAME_ as VAR_NAME_, TEMPVAR_TYPE_ as VAR_TYPE_, TEMPVAR_REV_ as VAR_REV_,
+ TEMPVAR_PROC_INST_ID_ as VAR_PROC_INST_ID_, TEMPVAR_EXECUTION_ID_ as VAR_EXECUTION_ID_, TEMPVAR_TASK_ID_ as VAR_TASK_ID_,
+ TEMPVAR_BYTEARRAY_ID_ as VAR_BYTEARRAY_ID_, TEMPVAR_DOUBLE_ as VAR_DOUBLE_,
+ TEMPVAR_TEXT_ as VAR_TEXT_, TEMPVAR_TEXT2_ as VAR_TEXT2_, TEMPVAR_LONG_ as VAR_LONG_
+ </if>
+ <if test="includeIdentityLinks">
+ ,
+ TEMPILINK_ID_ as ILINK_ID_, TEMPILINK_TYPE_ as ILINK_TYPE_, TEMPILINK_USER_ID_ as ILINK_USER_ID_,
+ TEMPILINK_GROUP_ID_ as ILINK_GROUP_ID_, TEMPILINK_TASK_ID_ as ILINK_TASK_ID_,
+ TEMPILINK_PROC_INST_ID_ as ILINK_PROC_INST_ID_, TEMPILINK_PROC_DEF_ID_ as ILINK_PROC_DEF_ID_
+ </if>
+ <if test="firstResult != null and firstResult >= 0">${limitOuterJoinBetween}</if>
+ RES.ID_ as TEMPRES_ID_, RES.REV_ as TEMPRES_REV_, RES.NAME_ as TEMPRES_NAME_,
+ RES.PARENT_TASK_ID_ as TEMPRES_PARENT_TASK_ID_, RES.DESCRIPTION_ as TEMPRES_DESCRIPTION_,
+ RES.PRIORITY_ as TEMPRES_PRIORITY_, RES.CREATE_TIME_ as TEMPRES_CREATE_TIME_,
+ RES.OWNER_ as TEMPRES_OWNER_, RES.ASSIGNEE_ as TEMPRES_ASSIGNEE_, RES.DELEGATION_ as TEMPRES_DELEGATION_,
+ RES.FORM_KEY_ as TEMPRES_FORM_KEY_, RES.CLAIM_TIME_ as TEMPRES_CLAIM_TIME_, RES.EXECUTION_ID_ as TEMPRES_EXECUTION_ID_,
+ RES.PROC_INST_ID_ as TEMPRES_PROC_INST_ID_, RES.PROC_DEF_ID_ as TEMPRES_PROC_DEF_ID_,
+ RES.TASK_DEF_ID_ as TEMPRES_TASK_DEF_ID_, RES.TASK_DEF_KEY_ as TEMPRES_TASK_DEF_KEY_,
+ RES.DUE_DATE_ as TEMPRES_DUE_DATE_, RES.SUSPENSION_STATE_ as TEMPRES_SUSPENSION_STATE_, RES.CATEGORY_ as TEMPRES_CATEGORY_,
+ RES.IS_COUNT_ENABLED_ as TEMPRES_IS_COUNT_ENABLED_, RES.VAR_COUNT_ as TEMPRES_VAR_COUNT_, RES.ID_LINK_COUNT_ as TEMPRES_ID_LINK_COUNT_, RES.SUB_TASK_COUNT_ as TEMPRES_ID_SUB_TASK_COUNT_
+ <if test="includeTaskLocalVariables or includeProcessVariables">
+ ,
+ VAR.ID_ as TEMPVAR_ID_, VAR.NAME_ as TEMPVAR_NAME_, VAR.TYPE_ as TEMPVAR_TYPE_, VAR.REV_ as TEMPVAR_REV_,
+ VAR.PROC_INST_ID_ as TEMPVAR_PROC_INST_ID_, VAR.EXECUTION_ID_ as TEMPVAR_EXECUTION_ID_, VAR.TASK_ID_ as TEMPVAR_TASK_ID_,
+ VAR.BYTEARRAY_ID_ as TEMPVAR_BYTEARRAY_ID_, VAR.DOUBLE_ as TEMPVAR_DOUBLE_,
+ VAR.TEXT_ as TEMPVAR_TEXT_, VAR.TEXT2_ as TEMPVAR_TEXT2_, VAR.LONG_ as TEMPVAR_LONG_
+ </if>
+ <if test="includeIdentityLinks">
+ ,
+ ILINK.ID_ as TEMPILINK_ID_, ILINK.TYPE_ as TEMPILINK_TYPE_, ILINK.USER_ID_ as TEMPILINK_USER_ID_,
+ ILINK.GROUP_ID_ as TEMPILINK_GROUP_ID_, ILINK.TASK_ID_ as TEMPILINK_TASK_ID_,
+ ILINK.PROC_INST_ID_ as TEMPILINK_PROC_INST_ID_, ILINK.PROC_DEF_ID_ as TEMPILINK_PROC_DEF_ID_
+ </if>
+ </if>
+ </sql>
+
+ <sql id="selectTasksWithRelatedEntitiesByQueryCriteriaSql">
+ from ${prefix}ACT_RU_TASK RES
+ <choose>
+ <when test="includeTaskLocalVariables && includeProcessVariables">
+ left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.ID_ = VAR.TASK_ID_ or RES.PROC_INST_ID_ = VAR.EXECUTION_ID_
+ </when>
+ <otherwise>
+ <if test="includeTaskLocalVariables">
+ left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.ID_ = VAR.TASK_ID_
+ </if>
+ <if test="includeProcessVariables">
+ left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.PROC_INST_ID_ = VAR.EXECUTION_ID_ and VAR.TASK_ID_ is null
+ </if>
+ </otherwise>
+ </choose>
+ <if test="includeIdentityLinks">
+ left outer join ${prefix}ACT_RU_IDENTITYLINK ILINK on RES.ID_ = ILINK.TASK_ID_
+ </if>
+ <include refid="commonSelectTaskByQueryCriteriaSql"/>
+ </sql>
+
+ <sql id="commonSelectTaskByQueryCriteriaSql">
+ <if test="candidateUser != null || candidateGroups != null || bothCandidateAndAssigned">
+ <choose>
+ <when test="bothCandidateAndAssigned">left</when>
+ <otherwise>inner</otherwise>
+ </choose>
+ join ${prefix}ACT_RU_IDENTITYLINK I on I.TASK_ID_ = RES.ID_
+ </if>
+ <foreach collection="queryVariableValues" index="index" item="var">
+ <if test="!var.operator.equals('EXISTS') && !var.operator.equals('NOT_EXISTS')">
+ <choose>
+ <when test="var.local">
+ inner join ${prefix}ACT_RU_VARIABLE A${index} on RES.ID_ = A${index}.TASK_ID_
+ </when>
+ <otherwise>
+ inner join ${prefix}ACT_RU_VARIABLE A${index} on RES.PROC_INST_ID_ = A${index}.PROC_INST_ID_
+ </otherwise>
+ </choose>
+ </if>
+ </foreach>
+ <foreach collection="orQueryObjects" index="orIndex" item="orQueryObject">
+ <if test="orQueryObject.candidateUser != null || orQueryObject.candidateGroups != null || orQueryObject.bothCandidateAndAssigned">
+ <choose>
+ <when test="orQueryObject.bothCandidateAndAssigned">left</when>
+ <otherwise>inner</otherwise>
+ </choose>
+ join ${prefix}ACT_RU_IDENTITYLINK I_OR${orIndex} on I_OR${orIndex}.TASK_ID_ = RES.ID_
+ </if>
+ <if test="orQueryObject.queryVariableValues.size() > 0">
+ <if test="orQueryObject.hasValueComparisonQueryVariables()">
+ <if test="orQueryObject.hasLocalQueryVariableValue()">
+ left outer join ${prefix}ACT_RU_VARIABLE A_L_OR${orIndex} on RES.ID_ = A_L_OR${orIndex}.TASK_ID_
+ </if>
+ <if test="orQueryObject.hasNonLocalQueryVariableValue()">
+ left outer join ${prefix}ACT_RU_VARIABLE A_OR${orIndex} on RES.PROC_INST_ID_ = A_OR${orIndex}.PROC_INST_ID_
+ </if>
+ </if>
+ </if>
+
+ <if test="orQueryObject.processDefinitionKey != null || orQueryObject.processDefinitionKeyLike != null || orQueryObject.processDefinitionKeyLikeIgnoreCase != null || orQueryObject.processDefinitionName != null || orQueryObject.processDefinitionNameLike != null || (orQueryObject.processCategoryInList != null && orQueryObject.processCategoryInList.size() > 0) || (orQueryObject.processCategoryNotInList != null && orQueryObject.processCategoryNotInList.size() > 0) || (orQueryObject.processDefinitionKeys != null && orQueryObject.processDefinitionKeys.size() > 0)">
+ left outer join ${prefix}ACT_RE_PROCDEF D_OR${orIndex} on RES.PROC_DEF_ID_ = D_OR${orIndex}.ID_
+ </if>
+
+ <if test="orQueryObject.processInstanceBusinessKey != null || orQueryObject.processInstanceBusinessKeyLike != null || orQueryObject.processInstanceBusinessKeyLikeIgnoreCase != null">
+ inner join ${prefix}ACT_RU_EXECUTION E_OR${orIndex} on RES.PROC_INST_ID_ = E_OR${orIndex}.ID_
+ </if>
+
+ <if test="orQueryObject.deploymentId != null || (orQueryObject.deploymentIds != null && orQueryObject.deploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P_OR${orIndex} ON RES.PROC_DEF_ID_ = DEPLOY_P_OR${orIndex}.ID_
+ </if>
+ <if test="orQueryObject.cmmnDeploymentId != null || (orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C_OR${orIndex} ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C_OR${orIndex}.ID_
+ </if>
+ </foreach>
+
+ <if test="processDefinitionKey != null || processDefinitionKeyLike != null || processDefinitionKeyLikeIgnoreCase != null || processDefinitionName != null || processDefinitionNameLike != null || (processCategoryInList != null && processCategoryInList.size() > 0) || (processCategoryNotInList != null && processCategoryNotInList.size() > 0) || (processDefinitionKeys != null && processDefinitionKeys.size() > 0)">
+ inner join ${prefix}ACT_RE_PROCDEF D on RES.PROC_DEF_ID_ = D.ID_
+ </if>
+ <if test="processInstanceBusinessKey != null || processInstanceBusinessKeyLike != null || processInstanceBusinessKeyLikeIgnoreCase != null">
+ inner join ${prefix}ACT_RU_EXECUTION E on RES.PROC_INST_ID_ = E.ID_
+ </if>
+ <if test="deploymentId != null || (deploymentIds != null && deploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P ON RES.PROC_DEF_ID_ = DEPLOY_P.ID_
+ </if>
+ <if test="cmmnDeploymentId != null || (cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C.ID_
+ </if>
+ <where>
+ <if test="taskId != null">
+ RES.ID_ = #{taskId}
+ </if>
+ <if test="name != null">
+ and RES.NAME_ = #{name}
+ </if>
+ <if test="nameLike != null">
+ and RES.NAME_ like #{nameLike}${wildcardEscapeClause}
+ </if>
+ <if test="nameLikeIgnoreCase != null">
+ and lower(RES.NAME_) like #{nameLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="nameList != null && nameList.size() > 0">
+ and RES.NAME_ IN
+ <foreach item="name" index="index" collection="nameList"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="nameListIgnoreCase != null && nameListIgnoreCase.size() > 0">
+ and lower(RES.NAME_) IN
+ <foreach item="name" index="index" collection="nameListIgnoreCase"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="description != null">
+ and RES.DESCRIPTION_ = #{description}
+ </if>
+ <if test="descriptionLike != null">
+ and RES.DESCRIPTION_ like #{descriptionLike}${wildcardEscapeClause}
+ </if>
+ <if test="descriptionLikeIgnoreCase != null">
+ and lower(RES.DESCRIPTION_) like #{descriptionLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="priority != null">
+ and RES.PRIORITY_ = #{priority}
+ </if>
+ <if test="minPriority != null">
+ and RES.PRIORITY_ >= #{minPriority}
+ </if>
+ <if test="maxPriority != null">
+ and RES.PRIORITY_ <= #{maxPriority}
+ </if>
+ <if test="assignee != null">
+ and RES.ASSIGNEE_ = #{assignee}
+ </if>
+ <if test="assigneeLike != null">
+ and RES.ASSIGNEE_ like #{assigneeLike}${wildcardEscapeClause}
+ </if>
+ <if test="assigneeLikeIgnoreCase != null">
+ and lower(RES.ASSIGNEE_) like #{assigneeLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="assigneeIds != null && assigneeIds.size() > 0">
+ and RES.ASSIGNEE_ IN
+ <foreach item="assigneeId" index="index" collection="assigneeIds"
+ open="(" separator="," close=")">
+ #{assigneeId}
+ </foreach>
+ </if>
+ <if test="owner != null">
+ and RES.OWNER_ = #{owner}
+ </if>
+ <if test="ownerLike != null">
+ and RES.OWNER_ like #{ownerLike}${wildcardEscapeClause}
+ </if>
+ <if test="ownerLikeIgnoreCase != null">
+ and lower(RES.OWNER_) like #{ownerLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="unassigned">
+ and RES.ASSIGNEE_ IS NULL
+ </if>
+ <if test="noDelegationState">
+ and RES.DELEGATION_ IS NULL
+ </if>
+ <if test="delegationState != null">
+ and RES.DELEGATION_ = #{delegationStateString}
+ </if>
+ <if test="processInstanceId != null">
+ and RES.PROC_INST_ID_ = #{processInstanceId}
+ </if>
+ <if test="processInstanceIds != null && processInstanceIds.size() > 0">
+ and RES.PROC_INST_ID_ IN
+ <foreach item="processInstance" index="index" collection="processInstanceIds"
+ open="(" separator="," close=")">
+ #{processInstance}
+ </foreach>
+ </if>
+ <if test="processInstanceBusinessKey != null">
+ and E.BUSINESS_KEY_ = #{processInstanceBusinessKey}
+ </if>
+ <if test="processInstanceBusinessKeyLike != null">
+ and E.BUSINESS_KEY_ like #{processInstanceBusinessKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="processInstanceBusinessKeyLikeIgnoreCase != null">
+ and lower(E.BUSINESS_KEY_) like #{processInstanceBusinessKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="executionId != null">
+ and RES.EXECUTION_ID_ = #{executionId}
+ </if>
+ <if test="scopeId != null">
+ and RES.SCOPE_ID_ = #{scopeId}
+ </if>
+ <if test="subScopeId != null">
+ and RES.SUB_SCOPE_ID_ = #{subScopeId}
+ </if>
+ <if test="scopeType != null">
+ and RES.SCOPE_TYPE_ = #{scopeType}
+ </if>
+ <if test="scopeDefinitionId != null">
+ and RES.SCOPE_DEFINITION_ID_ = #{scopeDefinitionId}
+ </if>
+ <if test="createTime != null">
+ and RES.CREATE_TIME_ = #{createTime}
+ </if>
+ <if test="createTimeBefore != null">
+ and RES.CREATE_TIME_ < #{createTimeBefore}
+ </if>
+ <if test="createTimeAfter != null">
+ and RES.CREATE_TIME_ > #{createTimeAfter}
+ </if>
+ <if test="key != null">
+ and RES.TASK_DEF_KEY_ = #{key}
+ </if>
+ <if test="keyLike != null">
+ and RES.TASK_DEF_KEY_ like #{keyLike}
+ </if>
+ <if test="processDefinitionId != null">
+ and RES.PROC_DEF_ID_ = #{processDefinitionId}
+ </if>
+ <if test="taskDefinitionId != null">
+ and RES.TASK_DEF_ID_ = #{taskDefinitionId}
+ </if>
+ <if test="processDefinitionKey != null">
+ and D.KEY_ = #{processDefinitionKey}
+ </if>
+ <if test="processDefinitionKeyLike != null">
+ and D.KEY_ like #{processDefinitionKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="processDefinitionKeyLikeIgnoreCase != null">
+ and lower(D.KEY_) like #{processDefinitionKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="processDefinitionKeys != null && processDefinitionKeys.size() > 0">
+ and D.KEY_ in
+ <foreach item="item" index="index" collection="processDefinitionKeys" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </if>
+ <if test="processDefinitionName != null">
+ and D.NAME_ = #{processDefinitionName}
+ </if>
+ <if test="processDefinitionNameLike != null">
+ and D.NAME_ like #{processDefinitionNameLike}${wildcardEscapeClause}
+ </if>
+ <if test="processCategoryInList != null && processCategoryInList.size() > 0">
+ and D.CATEGORY_ IN
+ <foreach item="processCategory" index="index" collection="processCategoryInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="processCategoryNotInList != null && processCategoryNotInList.size() > 0">
+ and D.CATEGORY_ NOT IN
+ <foreach item="processCategory" index="index" collection="processCategoryNotInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="deploymentId != null && cmmnDeploymentId == null">
+ and DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId}
+ </if>
+ <if test="deploymentIds != null && deploymentIds.size() > 0 && cmmnDeploymentIds == null">
+ and DEPLOY_P.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="deploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="cmmnDeploymentId != null && deploymentId == null">
+ and DEPLOY_C.DEPLOYMENT_ID_ = #{cmmnDeploymentId}
+ </if>
+ <if test="cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds == null">
+ and DEPLOY_C.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="cmmnDeploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="deploymentId != null && cmmnDeploymentId != null">
+ and (DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId} or DEPLOY_C.DEPLOYMENT_ID = #{cmmnDeploymentId})
+ </if>
+ <if test="cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds != null && deploymentIds.size() > 0">
+ and (
+ DEPLOY_P.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="deploymentIds" open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ or
+ DEPLOY_C.DEPLOYMENT_ID_ IN
+ <foreach item="cmmnDeployment" index="index" collection="cmmnDeploymentIds" open="(" separator="," close=")">
+ #{cmmnDeployment}
+ </foreach>
+ )
+ </if>
+ <if test="dueDate != null">
+ and RES.DUE_DATE_ = #{dueDate}
+ </if>
+ <if test="dueBefore != null">
+ and RES.DUE_DATE_ < #{dueBefore}
+ </if>
+ <if test="dueAfter != null">
+ and RES.DUE_DATE_ > #{dueAfter}
+ </if>
+ <if test="withoutDueDate">
+ and RES.DUE_DATE_ is null
+ </if>
+ <if test="dueDate != null || dueBefore != null || dueAfter != null">
+ and RES.DUE_DATE_ is not null
+ </if>
+ <if test="category != null">
+ and RES.CATEGORY_ = #{category}
+ </if>
+ <!-- Syncope -->
+ <if test="withFormKey">
+ and RES.FORM_KEY_ IS NOT NULL
+ </if>
+ <!-- /Syncope -->
+ <if test="excludeSubtasks">
+ and RES.PARENT_TASK_ID_ IS NULL
+ </if>
+ <if test="!bothCandidateAndAssigned && (candidateUser != null || candidateGroups != null)">
+ <if test="!ignoreAssigneeValue">
+ and RES.ASSIGNEE_ is null
+ </if>
+ and I.TYPE_ = 'candidate'
+ and
+ (
+ <if test="candidateUser != null">
+ I.USER_ID_ = #{candidateUser}
+ </if>
+ <if test="candidateUser != null && candidateGroups != null && candidateGroups.size() > 0">
+ or
+ </if>
+ <if test="candidateGroups != null && candidateGroups.size() > 0">
+ I.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="candidateGroups"
+ open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ )
+ </if>
+ <if test="involvedUser != null">
+ and (
+ exists(select LINK.USER_ID_ from ${prefix}ACT_RU_IDENTITYLINK LINK where USER_ID_ = #{involvedUser} and LINK.TASK_ID_ = RES.ID_)
+ or RES.ASSIGNEE_ = #{involvedUser}
+ or RES.OWNER_ = #{involvedUser}
+ )
+ </if>
+ <foreach item="var" collection="queryVariableValues" index="index">
+ <choose>
+ <when test="var.operator.equals('EXISTS')">
+ and EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <when test="var.operator.equals('NOT_EXISTS')">
+ and NOT EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <otherwise>
+ <if test="!var.local">
+ <!-- When process instance variable is queried for, taskId should be null -->
+ and A${index}.TASK_ID_ is null
+ </if>
+ <if test="var.name != null">
+ <!-- Match-all variable-names when name is null -->
+ and A${index}.NAME_= #{var.name}
+ </if>
+ <if test="var.name == null">
+ and A${index}.NAME_ is not null
+ </if>
+ <if test="!var.type.equals('null')">
+ and A${index}.TYPE_ = #{var.type}
+ </if>
+
+ <!-- Variable value -->
+ <if test="var.textValue != null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('EQUALS_IGNORE_CASE') || var.operator.equals('NOT_EQUALS_IGNORE_CASE') || var.operator.equals('LIKE_IGNORE_CASE')">
+ and lower(A${index}.TEXT_)
+ </when>
+ <otherwise>
+ and A${index}.TEXT_
+ </otherwise>
+ </choose>
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue}
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.textValue2 != null">
+ and A${index}.TEXT2_
+ <choose>
+ <when test="var.operator.equals('LIKE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue2}
+ <choose>
+ <when test="var.operator.equals('LIKE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.longValue != null">
+ and A${index}.LONG_
+ <include refid="executionVariableOperator" />
+ #{var.longValue}
+ </if>
+ <if test="var.doubleValue != null">
+ and A${index}.DOUBLE_
+ <include refid="executionVariableOperator" />
+ #{var.doubleValue}
+ </if>
+ <!-- Null variable type -->
+ <if test="var.textValue == null && var.textValue2 == null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('NOT_EQUALS')">
+ and (A${index}.TEXT_ is not null or A${index}.TEXT2_ is not null or A${index}.LONG_ is not null or A${index}.DOUBLE_ is not null or A${index}.BYTEARRAY_ID_ is not null)
+ </when>
+ <otherwise>
+ and A${index}.TEXT_ is null and A${index}.TEXT2_ is null and A${index}.LONG_ is null and A${index}.DOUBLE_ is null and A${index}.BYTEARRAY_ID_ is null
+ </otherwise>
+ </choose>
+ </if>
+ </otherwise>
+ </choose>
+ </foreach>
+ <if test="suspensionState != null">
+ <if test="suspensionState.stateCode == 1">
+ and RES.SUSPENSION_STATE_ = 1
+ </if>
+ <if test="suspensionState.stateCode == 2">
+ and RES.SUSPENSION_STATE_ = 2
+ </if>
+ </if>
+ <if test="tenantId != null">
+ and RES.TENANT_ID_ = #{tenantId}
+ </if>
+ <if test="tenantIdLike != null">
+ and RES.TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause}
+ </if>
+ <if test="withoutTenantId">
+ and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null)
+ </if>
+ <choose>
+ <when test="bothCandidateAndAssigned">
+ <!-- if dbIdentityUsed set true in process engine configuration -->
+ <if test="userIdForCandidateAndAssignee != null">
+ <if test="candidateGroups == null">
+ and (RES.ASSIGNEE_ = #{userIdForCandidateAndAssignee}
+ or (
+ <if test="!ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null
+ </if>
+ and (I.USER_ID_ = #{userIdForCandidateAndAssignee}
+ or I.GROUP_ID_ IN (select g.GROUP_ID_ from ${prefix}ACT_ID_MEMBERSHIP g where g.USER_ID_ = #{userIdForCandidateAndAssignee} ) ) ) )
+ </if>
+ </if>
+ <!-- if dbIdentityUsed set false in process engine configuration of using custom session factory of GroupIdentityManager -->
+ <if test="candidateGroups != null">
+ and (RES.ASSIGNEE_ = #{userIdForCandidateAndAssignee}
+
+ or (
+ <if test="!ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ I.TYPE_ = 'candidate' and (I.USER_ID_ = #{userIdForCandidateAndAssignee}
+ <if test="candidateGroups.size() > 0">
+ or I.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="candidateGroups" open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ )))
+ </if>
+ </when>
+ </choose>
+ <foreach item="orQueryObject" index="orIndex" collection="orQueryObjects">
+ and
+ <trim prefix="(" prefixOverrides="OR" suffix=")">
+ <if test="orQueryObject.taskId != null">
+ RES.ID_ = #{orQueryObject.taskId}
+ </if>
+ <if test="orQueryObject.name != null">
+ or RES.NAME_ = #{orQueryObject.name}
+ </if>
+ <if test="orQueryObject.nameLike != null">
+ or RES.NAME_ like #{orQueryObject.nameLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.nameLikeIgnoreCase != null">
+ or lower(RES.NAME_) like #{orQueryObject.nameLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.nameList != null && orQueryObject.nameList.size() > 0">
+ or RES.NAME_ IN
+ <foreach item="name" index="index" collection="orQueryObject.nameList"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="orQueryObject.nameListIgnoreCase != null && orQueryObject.nameListIgnoreCase.size() > 0">
+ or lower(RES.NAME_) IN
+ <foreach item="name" index="index" collection="orQueryObject.nameListIgnoreCase"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="orQueryObject.description != null">
+ or RES.DESCRIPTION_ = #{orQueryObject.description}
+ </if>
+ <if test="orQueryObject.descriptionLike != null">
+ or RES.DESCRIPTION_ like #{orQueryObject.descriptionLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.descriptionLikeIgnoreCase != null">
+ or lower(RES.DESCRIPTION_) like #{orQueryObject.descriptionLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.priority != null">
+ or RES.PRIORITY_ = #{orQueryObject.priority}
+ </if>
+ <if test="orQueryObject.minPriority != null">
+ or RES.PRIORITY_ >= #{orQueryObject.minPriority}
+ </if>
+ <if test="orQueryObject.maxPriority != null">
+ or RES.PRIORITY_ <= #{orQueryObject.maxPriority}
+ </if>
+ <if test="orQueryObject.assignee != null">
+ or RES.ASSIGNEE_ = #{orQueryObject.assignee}
+ </if>
+ <if test="orQueryObject.assigneeLike != null">
+ or RES.ASSIGNEE_ like #{orQueryObject.assigneeLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.assigneeLikeIgnoreCase != null">
+ or lower(RES.ASSIGNEE_) like #{orQueryObject.assigneeLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.assigneeIds != null && orQueryObject.assigneeIds.size() > 0">
+ or RES.ASSIGNEE_ IN
+ <foreach item="assigneeId" index="index" collection="orQueryObject.assigneeIds"
+ open="(" separator="," close=")">
+ #{assigneeId}
+ </foreach>
+ </if>
+ <if test="orQueryObject.owner != null">
+ or RES.OWNER_ = #{orQueryObject.owner}
+ </if>
+ <if test="orQueryObject.ownerLike != null">
+ or RES.OWNER_ like #{orQueryObject.ownerLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.ownerLikeIgnoreCase != null">
+ or RES.OWNER_ like #{orQueryObject.ownerLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.unassigned">
+ or RES.ASSIGNEE_ IS NULL
+ </if>
+ <if test="orQueryObject.noDelegationState">
+ or RES.DELEGATION_ IS NULL
+ </if>
+ <if test="orQueryObject.delegationState != null">
+ or RES.DELEGATION_ = #{orQueryObject.delegationStateString}
+ </if>
+ <if test="orQueryObject.processInstanceId != null">
+ or RES.PROC_INST_ID_ = #{orQueryObject.processInstanceId}
+ </if>
+ <if test="orQueryObject.processInstanceIds != null && orQueryObject.processInstanceIds.size() > 0">
+ or RES.PROC_INST_ID_ IN
+ <foreach item="processInstance" index="index" collection="orQueryObject.processInstanceIds"
+ open="(" separator="," close=")">
+ #{processInstance}
+ </foreach>
+ </if>
+ <if test="orQueryObject.processInstanceBusinessKey != null">
+ or E_OR${orIndex}.BUSINESS_KEY_ = #{orQueryObject.processInstanceBusinessKey}
+ </if>
+ <if test="orQueryObject.processInstanceBusinessKeyLike != null">
+ or E_OR${orIndex}.BUSINESS_KEY_ like #{orQueryObject.processInstanceBusinessKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processInstanceBusinessKeyLikeIgnoreCase != null">
+ or lower(E.BUSINESS_KEY_) like #{orQueryObject.processInstanceBusinessKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.executionId != null">
+ or RES.EXECUTION_ID_ = #{orQueryObject.executionId}
+ </if>
+ <if test="orQueryObject.scopeId != null">
+ and RES.SCOPE_ID_ = #{orQueryObject.scopeId}
+ </if>
+ <if test="orQueryObject.subScopeId != null">
+ and RES.SUB_SCOPE_ID_ = #{orQueryObject.subScopeId}
+ </if>
+ <if test="orQueryObject.scopeType != null">
+ and RES.SCOPE_TYPE_ = #{orQueryObject.scopeType}
+ </if>
+ <if test="orQueryObject.scopeDefinitionId != null">
+ and RES.SCOPE_DEFINITION_ID_ = #{orQueryObject.scopeDefinitionId}
+ </if>
+ <if test="orQueryObject.createTime != null">
+ or RES.CREATE_TIME_ = #{orQueryObject.createTime}
+ </if>
+ <if test="orQueryObject.createTimeBefore != null">
+ or RES.CREATE_TIME_ < #{orQueryObject.createTimeBefore}
+ </if>
+ <if test="orQueryObject.createTimeAfter != null">
+ or RES.CREATE_TIME_ > #{orQueryObject.createTimeAfter}
+ </if>
+ <if test="orQueryObject.key != null">
+ or RES.TASK_DEF_KEY_ = #{orQueryObject.key}
+ </if>
+ <if test="orQueryObject.keyLike != null">
+ or RES.TASK_DEF_KEY_ like #{orQueryObject.keyLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processDefinitionId != null">
+ or RES.PROC_DEF_ID_ = #{orQueryObject.processDefinitionId}
+ </if>
+ <if test="orQueryObject.taskDefinitionId != null">
+ or RES.TASK_DEF_ID_ = #{orQueryObject.taskDefinitionId}
+ </if>
+ <if test="orQueryObject.processDefinitionKey != null">
+ or D_OR${orIndex}.KEY_ = #{orQueryObject.processDefinitionKey}
+ </if>
+ <if test="orQueryObject.processDefinitionKeyLike != null">
+ or D_OR${orIndex}.KEY_ like #{orQueryObject.processDefinitionKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processDefinitionKeyLikeIgnoreCase != null">
+ or lower(D_OR${orIndex}.KEY_) like #{orQueryObject.processDefinitionKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processDefinitionKeys != null && orQueryObject.processDefinitionKeys.size() > 0">
+ or D_OR${orIndex}.KEY_ in
+ <foreach item="item" index="index" collection="orQueryObject.processDefinitionKeys" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </if>
+ <if test="orQueryObject.processDefinitionName != null">
+ or D_OR${orIndex}.NAME_ = #{orQueryObject.processDefinitionName}
+ </if>
+ <if test="orQueryObject.processDefinitionNameLike != null">
+ or D_OR${orIndex}.NAME_ like #{orQueryObject.processDefinitionNameLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processCategoryInList != null && orQueryObject.processCategoryInList.size() > 0">
+ or D_OR${orIndex}.CATEGORY_ IN
+ <foreach item="processCategory" index="index" collection="orQueryObject.processCategoryInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="orQueryObject.processCategoryNotInList != null && orQueryObject.processCategoryNotInList.size() > 0">
+ or D_OR${orIndex}.CATEGORY_ NOT IN
+ <foreach item="processCategory" index="index" collection="orQueryObject.processCategoryNotInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="orQueryObject.deploymentId != null">
+ or DEPLOY_P_OR${orIndex}.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId}
+ </if>
+ <if test="orQueryObject.deploymentIds != null && orQueryObject.deploymentIds.size() > 0">
+ or DEPLOY_P_OR${orIndex}.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="orQueryObject.deploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="orQueryObject.cmmnDeploymentId != null">
+ or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ = #{orQueryObject.cmmnDeploymentId}
+ </if>
+ <if test="orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentIds.size() > 0">
+ or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="orQueryObject.cmmnDeploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="orQueryObject.dueDate != null">
+ or RES.DUE_DATE_ = #{orQueryObject.dueDate}
+ </if>
+ <if test="orQueryObject.dueBefore != null">
+ or (RES.DUE_DATE_ < #{orQueryObject.dueBefore} and RES.DUE_DATE_ is not null)
+ </if>
+ <if test="orQueryObject.dueAfter != null">
+ or (RES.DUE_DATE_ > #{orQueryObject.dueAfter} and RES.DUE_DATE_ is not null)
+ </if>
+ <if test="orQueryObject.withoutDueDate">
+ or RES.DUE_DATE_ is null
+ </if>
+ <if test="orQueryObject.category != null">
+ or RES.CATEGORY_ = #{orQueryObject.category}
+ </if>
+ <if test="orQueryObject.excludeSubtasks">
+ or RES.PARENT_TASK_ID_ IS NULL
+ </if>
+
+ <if test="!orQueryObject.bothCandidateAndAssigned && (orQueryObject.candidateUser != null || orQueryObject.candidateGroups != null)">
+ or (
+ <if test="!orQueryObject.ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ I_OR${orIndex}.TYPE_ = 'candidate'
+ and
+ (
+ <if test="orQueryObject.candidateUser != null">
+ I_OR${orIndex}.USER_ID_ = #{orQueryObject.candidateUser}
+ </if>
+ <if test="orQueryObject.candidateUser != null && orQueryObject.candidateGroups != null && orQueryObject.candidateGroups.size() > 0">
+ or
+ </if>
+ <if test="orQueryObject.candidateGroups != null && orQueryObject.candidateGroups.size() > 0">
+ I_OR${orIndex}.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="orQueryObject.candidateGroups"
+ open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ ))
+ </if>
+ <if test="orQueryObject.involvedUser != null">
+ or (
+ exists(select LINK.USER_ID_ from ${prefix}ACT_RU_IDENTITYLINK LINK where USER_ID_ = #{orQueryObject.involvedUser} and LINK.TASK_ID_ = RES.ID_)
+ or RES.ASSIGNEE_ = #{orQueryObject.involvedUser}
+ or RES.OWNER_ = #{orQueryObject.involvedUser}
+ )
+ </if>
+ <foreach item="var" collection="orQueryObject.queryVariableValues" index="index">
+ or
+ <trim prefix="(" prefixOverrides="AND" suffix=")">
+ <choose>
+ <when test="var.operator.equals('EXISTS')">
+ and EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <when test="var.operator.equals('NOT_EXISTS')">
+ and NOT EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <otherwise>
+ <choose>
+ <when test="!var.local">
+ <bind name="orLocal" value="''" />
+ <!-- When process instance variable is queried for, taskId should be null -->
+ and A_OR${orIndex}.TASK_ID_ is null
+ </when>
+ <otherwise>
+ <bind name="orLocal" value="'L_'" />
+ </otherwise>
+ </choose>
+ <if test="var.name != null">
+ <!-- Match-all variable-names when name is null -->
+ and A_${orLocal}OR${orIndex}.NAME_= #{var.name}
+ </if>
+ <if test="var.name == null">
+ and A_${orLocal}OR${orIndex}.NAME_ is not null
+ </if>
+ <if test="!var.type.equals('null')">
+ and A_${orLocal}OR${orIndex}.TYPE_ = #{var.type}
+ </if>
+ <!-- Variable value -->
+ <if test="var.textValue != null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('EQUALS_IGNORE_CASE') || var.operator.equals('NOT_EQUALS_IGNORE_CASE') || var.operator.equals('LIKE_IGNORE_CASE')">
+ and lower(A_${orLocal}OR${orIndex}.TEXT_)
+ </when>
+ <otherwise>
+ and A_${orLocal}OR${orIndex}.TEXT_
+ </otherwise>
+ </choose>
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue}
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.textValue2 != null">
+ and A_${orLocal}OR${orIndex}.TEXT2_
+ <choose>
+ <when test="var.operator.equals('LIKE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue2}
+ <choose>
+ <when test="var.operator.equals('LIKE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.longValue != null">
+ and A_${orLocal}OR${orIndex}.LONG_
+ <include refid="executionVariableOperator" />
+ #{var.longValue}
+ </if>
+ <if test="var.doubleValue != null">
+ and A_${orLocal}OR${orIndex}.DOUBLE_
+ <include refid="executionVariableOperator" />
+ #{var.doubleValue}
+ </if>
+ <!-- Null variable type -->
+ <if test="var.textValue == null && var.textValue2 == null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('NOT_EQUALS')">
+ and (A_${orLocal}OR${orIndex}.TEXT_ is not null or A_${orLocal}OR${orIndex}.TEXT2_ is not null or A_${orLocal}OR${orIndex}.LONG_ is not null or A_${orLocal}OR${orIndex}.DOUBLE_ is not null or A_${orLocal}OR${orIndex}.BYTEARRAY_ID_ is not null)
+ </when>
+ <otherwise>
+ and A_${orLocal}OR${orIndex}.TEXT_ is null and A_${orLocal}OR${orIndex}.TEXT2_ is null and A_${orLocal}OR${orIndex}.LONG_ is null and A_${orLocal}OR${orIndex}.DOUBLE_ is null and A_${orLocal}OR${orIndex}.BYTEARRAY_ID_ is null
+ </otherwise>
+ </choose>
+ </if>
+ </otherwise>
+ </choose>
+ </trim>
+ </foreach>
+ <if test="orQueryObject.suspensionState != null">
+ <if test="orQueryObject.suspensionState.stateCode == 1">
+ or RES.SUSPENSION_STATE_ = 1
+ </if>
+ <if test="orQueryObject.suspensionState.stateCode == 2">
+ or RES.SUSPENSION_STATE_ = 2
+ </if>
+ </if>
+ <if test="orQueryObject.tenantId != null">
+ or RES.TENANT_ID_ = #{orQueryObject.tenantId}
+ </if>
+ <if test="orQueryObject.tenantIdLike != null">
+ or RES.TENANT_ID_ like #{orQueryObject.tenantIdLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.withoutTenantId">
+ or (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null)
+ </if>
+ <choose>
+ <when test="orQueryObject.bothCandidateAndAssigned">
+ <!-- if dbIdentityUsed set true in process engine configuration -->
+ <if test="orQueryObject.userIdForCandidateAndAssignee != null">
+ <if test="orQueryObject.candidateGroups == null">
+ or (RES.ASSIGNEE_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ or (
+ <if test="!orQueryObject.ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ (I_OR${orIndex}.USER_ID_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ or I_OR${orIndex}.GROUP_ID_ IN (select g.GROUP_ID_ from ${prefix}ACT_ID_MEMBERSHIP g where g.USER_ID_ = #{orQueryObject.userIdForCandidateAndAssignee} ) ) ) )
+ </if>
+ </if>
+ <!-- if dbIdentityUsed set false in process engine configuration of using custom session factory of GroupIdentityManager -->
+ <if test="orQueryObject.candidateGroups != null">
+ or (RES.ASSIGNEE_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ or (
+ <if test="!orQueryObject.ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ I_OR${orIndex}.TYPE_ = 'candidate' and (I_OR${orIndex}.USER_ID_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ <if test="orQueryObject.candidateGroups.size() > 0">
+ or I_OR${orIndex}.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="orQueryObject.candidateGroups" open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ )))
+ </if>
+ </when>
+ </choose>
+ </trim>
+ </foreach>
+ </where>
+ </sql>
+
+ <sql id="executionVariableOperator">
+ <choose>
+ <when test="var.operator.equals('EQUALS')">=</when>
+ <when test="var.operator.equals('EQUALS_IGNORE_CASE')">=</when>
+ <when test="var.operator.equals('NOT_EQUALS')"><></when>
+ <when test="var.operator.equals('NOT_EQUALS_IGNORE_CASE')"><></when>
+ <when test="var.operator.equals('GREATER_THAN')">></when>
+ <when test="var.operator.equals('GREATER_THAN_OR_EQUAL')">>=</when>
+ <when test="var.operator.equals('LESS_THAN')"><</when>
+ <when test="var.operator.equals('LESS_THAN_OR_EQUAL')"><=</when>
+ </choose>
+ </sql>
+
+ <select id="selectTaskByNativeQuery" parameterType="java.util.Map" resultMap="taskResultMap">
+ <include refid="org.flowable.task.service.db.common.selectByNativeQuery"/>
+ </select>
+
+ <select id="selectTaskCountByNativeQuery" parameterType="java.util.Map" resultType="long">
+ ${sql}
+ </select>
+
+</mapper>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml
new file mode 100644
index 0000000..1dd6888
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml
@@ -0,0 +1,73 @@
+<?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.
+-->
+<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
+
+<configuration>
+
+ <settings>
+ <setting name="lazyLoadingEnabled" value="false" />
+ </settings>
+ <typeAliases>
+ <typeAlias type="org.flowable.engine.impl.persistence.ByteArrayRefTypeHandler" alias="ByteArrayRefTypeHandler" />
+ <typeAlias type="org.flowable.variable.service.impl.persistence.VariableByteArrayRefTypeHandler" alias="VariableByteArrayRefTypeHandler" />
+ <typeAlias type="org.flowable.job.service.impl.persistence.JobByteArrayRefTypeHandler" alias="JobByteArrayRefTypeHandler" />
+ </typeAliases>
+ <typeHandlers>
+ <typeHandler handler="ByteArrayRefTypeHandler" javaType="org.flowable.engine.impl.persistence.entity.ByteArrayRef" jdbcType="VARCHAR" />
+ <typeHandler handler="VariableByteArrayRefTypeHandler" javaType="org.flowable.variable.service.impl.persistence.entity.VariableByteArrayRef" jdbcType="VARCHAR" />
+ <typeHandler handler="JobByteArrayRefTypeHandler" javaType="org.flowable.job.service.impl.persistence.entity.JobByteArrayRef" jdbcType="VARCHAR" />
+ </typeHandlers>
+
+ <mappers>
+ <mapper resource="org/flowable/db/mapping/common.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Attachment.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/ByteArray.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/common.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/entity/ByteArray.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/ByteArray.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Comment.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/DeadLetterJob.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Deployment.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Execution.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/HistoricActivityInstance.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/HistoricDetail.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/HistoricProcessInstance.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/entity/HistoricVariableInstance.xml" />
+ <mapper resource="org/flowable/task/service/db/mapping/entity/HistoricTaskInstance.xml" />
+ <mapper resource="org/flowable/identitylink/service/db/mapping/entity/HistoricIdentityLink.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/HistoryJob.xml" />
+ <mapper resource="org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/Job.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Model.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/ProcessDefinition.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/ProcessDefinitionInfo.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Property.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Resource.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/SuspendedJob.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/TableData.xml" />
+ <mapper resource="org/flowable/task/service/db/mapping/common.xml" />
+ <mapper resource="org/apache/syncope/ext/flowable/Task.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/TimerJob.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/entity/VariableInstance.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/EventSubscription.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/EventLogEntry.xml" />
+ </mappers>
+
+</configuration>
\ No newline at end of file
[10/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
new file mode 100644
index 0000000..e16f5c2
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
@@ -0,0 +1,355 @@
+/*
+ * 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.client.console.approvals;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.DirectoryDataProvider;
+import org.apache.syncope.client.console.panels.DirectoryPanel;
+import org.apache.syncope.client.console.rest.UserRequestRestClient;
+import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel.ApprovalProvider;
+import org.apache.syncope.client.console.layout.FormLayoutInfoUtils;
+import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
+import org.apache.syncope.client.console.widgets.ApprovalsWidget;
+import org.apache.syncope.client.console.wizards.AjaxWizard;
+import org.apache.syncope.client.console.wizards.any.AnyWrapper;
+import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
+import org.apache.syncope.common.lib.AnyOperations;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.patch.PasswordPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.ProvisioningResult;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+
+public class ApprovalDirectoryPanel
+ extends DirectoryPanel<UserRequestForm, UserRequestForm, ApprovalProvider, UserRequestRestClient> {
+
+ private static final long serialVersionUID = -7122136682275797903L;
+
+ protected final BaseModal<UserRequestForm> manageApprovalModal = new BaseModal<UserRequestForm>("outer") {
+
+ private static final long serialVersionUID = 389935548143327858L;
+
+ @Override
+ protected void onConfigure() {
+ super.onConfigure();
+ addSubmitButton();
+ size(Modal.Size.Large);
+ }
+
+ };
+
+ public ApprovalDirectoryPanel(final String id, final PageReference pageReference) {
+ super(id, pageReference, true);
+ disableCheckBoxes();
+ setFooterVisibility(false);
+ modal.size(Modal.Size.Large);
+
+ addOuterObject(manageApprovalModal);
+
+ manageApprovalModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ updateResultTable(target);
+
+ Serializable widget = SyncopeConsoleSession.get().getAttribute(ApprovalsWidget.class.getName());
+ if (widget instanceof ApprovalsWidget) {
+ ((ApprovalsWidget) widget).refreshLatestAlerts(target);
+ }
+
+ manageApprovalModal.show(false);
+ }
+ });
+
+ restClient = new UserRequestRestClient();
+
+ initResultTable();
+
+ MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, FlowableEntitlement.WORKFLOW_FORM_SUBMIT);
+ }
+
+ @Override
+ protected List<IColumn<UserRequestForm, String>> getColumns() {
+ List<IColumn<UserRequestForm, String>> columns = new ArrayList<>();
+
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("taskId"), "taskId", "taskId"));
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("key"), "formKey", "formKey"));
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("username"), "username"));
+ columns.add(new DatePropertyColumn<>(
+ new ResourceModel("createTime"), "createTime", "createTime"));
+ columns.add(new DatePropertyColumn<>(
+ new ResourceModel("dueDate"), "dueDate", "dueDate"));
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("owner"), "owner", "owner"));
+
+ return columns;
+ }
+
+ @Override
+ public ActionsPanel<UserRequestForm> getActions(final IModel<UserRequestForm> model) {
+ final ActionsPanel<UserRequestForm> panel = super.getActions(model);
+
+ panel.add(new ActionLink<UserRequestForm>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final UserRequestForm ignore) {
+ claimForm(model.getObject().getTaskId());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ target.add(container);
+ }
+ }, ActionLink.ActionType.CLAIM, FlowableEntitlement.WORKFLOW_FORM_CLAIM);
+
+ panel.add(new ActionLink<UserRequestForm>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final UserRequestForm ignore) {
+ manageApprovalModal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
+
+ target.add(manageApprovalModal.setContent(
+ new ApprovalModal(manageApprovalModal, pageRef, model.getObject()) {
+
+ private static final long serialVersionUID = 5546519445061007248L;
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target) {
+ try {
+ super.onSubmit(target);
+
+ ApprovalDirectoryPanel.this.getTogglePanel().close(target);
+ } catch (SyncopeClientException e) {
+ SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ }));
+
+ manageApprovalModal.header(new Model<>(getString("approval.manage", new Model<>(model.getObject()))));
+ manageApprovalModal.show(true);
+ }
+
+ @Override
+ protected boolean statusCondition(final UserRequestForm modelObject) {
+ return SyncopeConsoleSession.get().getSelfTO().getUsername().
+ equals(model.getObject().getOwner());
+ }
+
+ }, ActionLink.ActionType.MANAGE_APPROVAL, FlowableEntitlement.WORKFLOW_FORM_READ);
+
+ // SYNCOPE-1200 edit user while in approval state
+ panel.add(new ActionLink<UserRequestForm>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final UserRequestForm ignore) {
+ modal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
+
+ UserRequestForm formTO = model.getObject();
+ UserTO newUserTO;
+ UserTO previousUserTO;
+ if (formTO.getUserPatch() == null) {
+ newUserTO = formTO.getUserTO();
+ previousUserTO = null;
+ } else if (formTO.getUserTO() == null) {
+ // make it stronger by handling possible NPE
+ previousUserTO = new UserTO();
+ previousUserTO.setKey(formTO.getUserPatch().getKey());
+ newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
+ } else {
+ previousUserTO = formTO.getUserTO();
+ formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
+ formTO.getUserTO().setPassword(null);
+ newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
+ }
+
+ AjaxWizard.EditItemActionEvent<UserTO> editItemActionEvent =
+ new AjaxWizard.EditItemActionEvent<>(newUserTO, target);
+ editItemActionEvent.forceModalPanel(new ApprovalUserWizardBuilder(
+ model.getObject(),
+ previousUserTO,
+ newUserTO,
+ new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
+ FormLayoutInfoUtils.fetch(Collections.singletonList(AnyTypeKind.USER.name())).getLeft(),
+ pageRef
+ ).build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT));
+
+ send(ApprovalDirectoryPanel.this, Broadcast.EXACT, editItemActionEvent);
+ }
+
+ @Override
+ protected boolean statusCondition(final UserRequestForm modelObject) {
+ return SyncopeConsoleSession.get().getSelfTO().getUsername().
+ equals(model.getObject().getOwner());
+ }
+
+ }, ActionLink.ActionType.EDIT_APPROVAL, FlowableEntitlement.WORKFLOW_FORM_SUBMIT);
+
+ return panel;
+ }
+
+ @Override
+ protected ApprovalProvider dataProvider() {
+ return new ApprovalProvider(rows);
+ }
+
+ @Override
+ protected String paginatorRowsKey() {
+ return Constants.PREF_WORKFLOW_FORM_PAGINATOR_ROWS;
+ }
+
+ public static class ApprovalProvider extends DirectoryDataProvider<UserRequestForm> {
+
+ private static final long serialVersionUID = -2311716167583335852L;
+
+ private final UserRequestRestClient restClient = new UserRequestRestClient();
+
+ public ApprovalProvider(final int paginatorRows) {
+ super(paginatorRows);
+
+ setSort("createTime", SortOrder.ASCENDING);
+ }
+
+ @Override
+ public Iterator<UserRequestForm> iterator(final long first, final long count) {
+ int page = ((int) first / paginatorRows);
+ return restClient.getForms((page < 0 ? 0 : page) + 1, paginatorRows, getSort()).iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.countForms();
+ }
+
+ @Override
+ public IModel<UserRequestForm> model(final UserRequestForm form) {
+ return new IModel<UserRequestForm>() {
+
+ private static final long serialVersionUID = -2566070996511906708L;
+
+ @Override
+ public UserRequestForm getObject() {
+ return form;
+ }
+ };
+ }
+ }
+
+ @Override
+ protected Collection<ActionLink.ActionType> getBatches() {
+ return Collections.<ActionLink.ActionType>emptyList();
+ }
+
+ private void claimForm(final String taskId) {
+ try {
+ restClient.claimForm(taskId);
+ } catch (SyncopeClientException scee) {
+ SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ }
+ }
+
+ private class ApprovalUserWizardBuilder extends UserWizardBuilder {
+
+ private static final long serialVersionUID = 1854981134836384069L;
+
+ private final UserRequestForm formTO;
+
+ ApprovalUserWizardBuilder(
+ final UserRequestForm formTO,
+ final UserTO previousUserTO,
+ final UserTO userTO,
+ final List<String> anyTypeClasses,
+ final UserFormLayoutInfo formLayoutInfo,
+ final PageReference pageRef) {
+
+ super(previousUserTO, userTO, anyTypeClasses, formLayoutInfo, pageRef);
+ this.formTO = formTO;
+ }
+
+ @Override
+ protected Serializable onApplyInternal(final AnyWrapper<UserTO> modelObject) {
+ UserTO inner = modelObject.getInnerObject();
+
+ ProvisioningResult<UserTO> result;
+
+ UserPatch patch = AnyOperations.diff(inner, formTO.getUserTO(), false);
+
+ if (StringUtils.isNotBlank(inner.getPassword())) {
+ PasswordPatch passwordPatch = new PasswordPatch.Builder().
+ value(inner.getPassword()).onSyncope(true).resources(inner.
+ getResources()).
+ build();
+ patch.setPassword(passwordPatch);
+ }
+ // update just if it is changed
+ if (patch.isEmpty()) {
+ result = new ProvisioningResult<>();
+ result.setEntity(inner);
+ } else {
+ result = userRestClient.update(getOriginalItem().getInnerObject().getETagValue(), patch);
+ UserRequestForm workFlowTO = restClient.getForms(result.getEntity().getKey()).get(0);
+ if (workFlowTO != null) {
+ claimForm(workFlowTO.getTaskId());
+ }
+ }
+
+ return result;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
new file mode 100644
index 0000000..0cae1c8
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
@@ -0,0 +1,82 @@
+/*
+ * 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.client.console.approvals;
+
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.panels.MultilevelPanel;
+import org.apache.syncope.client.console.rest.UserRequestRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.syncope.client.console.panels.SubmitableModalPanel;
+import org.apache.syncope.client.console.panels.WizardModalPanel;
+
+public class ApprovalModal extends Panel implements SubmitableModalPanel, WizardModalPanel<UserRequestForm> {
+
+ private static final long serialVersionUID = -8847854414429745216L;
+
+ private final UserRequestRestClient restClient = new UserRequestRestClient();
+
+ private final BaseModal<?> modal;
+
+ private final UserRequestForm formTO;
+
+ private final PageReference pageRef;
+
+ public ApprovalModal(final BaseModal<?> modal, final PageReference pageRef, final UserRequestForm formTO) {
+ super(BaseModal.CONTENT_ID);
+ this.modal = modal;
+ this.formTO = formTO;
+ this.pageRef = pageRef;
+
+ MultilevelPanel mlp = new MultilevelPanel("approval");
+ mlp.setFirstLevel(new Approval(pageRef, formTO) {
+
+ private static final long serialVersionUID = -2195387360323687302L;
+
+ @Override
+ protected void viewDetails(final AjaxRequestTarget target) {
+ mlp.next(getString("approval.details"), new ApprovalDetails(pageRef, formTO), target);
+ }
+ });
+ add(mlp);
+ }
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target) {
+ this.restClient.submitForm(formTO);
+ this.modal.show(false);
+ this.modal.close(target);
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ }
+
+ @Override
+ public void onError(final AjaxRequestTarget target) {
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ @Override
+ public UserRequestForm getItem() {
+ return this.formTO;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
new file mode 100644
index 0000000..0dbc4db
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
@@ -0,0 +1,41 @@
+/*
+ * 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.client.console.pages;
+
+import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
+import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public class Approvals extends BasePage {
+
+ private static final long serialVersionUID = -1100228004207271271L;
+
+ public Approvals(final PageParameters parameters) {
+ super(parameters);
+
+ body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
+
+ WebMarkupContainer content = new WebMarkupContainer("content");
+ content.setOutputMarkupId(true);
+ body.add(content);
+
+ content.add(new ApprovalDirectoryPanel("wfPanel", getPageReference()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java
new file mode 100644
index 0000000..562aad1
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java
@@ -0,0 +1,67 @@
+/*
+ * 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.client.console.pages;
+
+import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.annotations.ExtPage;
+import org.apache.syncope.client.console.panels.BpmnProcessDirectoryPanel;
+import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+@ExtPage(label = "Flowable", icon = "fa-briefcase",
+ listEntitlement = FlowableEntitlement.BPMN_PROCESS_LIST, priority = 200)
+public class Flowable extends BaseExtPage {
+
+ private static final long serialVersionUID = -8781434495150074529L;
+
+ public Flowable(final PageParameters parameters) {
+ super(parameters);
+
+ body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
+
+ WebMarkupContainer content = new WebMarkupContainer("content");
+ content.setOutputMarkupId(true);
+ body.add(content);
+
+ WebMarkupContainer disabled = new WebMarkupContainer("disabled");
+ disabled.setOutputMarkupPlaceholderTag(true);
+ content.add(disabled);
+
+ WizardMgtPanel<BpmnProcessTO> bpmnProcessesPanel = new BpmnProcessDirectoryPanel.Builder(getPageReference()) {
+
+ private static final long serialVersionUID = -5960765294082359003L;
+
+ }.disableCheckBoxes().build("bpmnProcessesPanel");
+ bpmnProcessesPanel.setOutputMarkupPlaceholderTag(true);
+ MetaDataRoleAuthorizationStrategy.authorize(bpmnProcessesPanel, ENABLE, FlowableEntitlement.BPMN_PROCESS_LIST);
+
+ content.add(bpmnProcessesPanel);
+
+ if (SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Flowable")) {
+ disabled.setVisible(false);
+ } else {
+ bpmnProcessesPanel.setVisible(false);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
new file mode 100644
index 0000000..b55d2b5
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
@@ -0,0 +1,27 @@
+/*
+ * 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.client.console.pages;
+
+import org.apache.wicket.markup.html.WebPage;
+
+public class FlowableModelerPopupPage extends WebPage {
+
+ private static final long serialVersionUID = -7031206743629422898L;
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java
new file mode 100644
index 0000000..b7914bb
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java
@@ -0,0 +1,308 @@
+/*
+ * 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.client.console.panels;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.DirectoryDataProvider;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.pages.ModelerPopupPage;
+import org.apache.syncope.client.console.panels.BpmnProcessDirectoryPanel.BpmProcessDataProvider;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.ImageModalPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.XMLEditorPanel;
+import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.wizard.WizardModel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.io.IOUtils;
+
+public class BpmnProcessDirectoryPanel extends DirectoryPanel<
+ BpmnProcessTO, BpmnProcessTO, BpmProcessDataProvider, BpmnProcessRestClient> {
+
+ private static final long serialVersionUID = 2705668831139984998L;
+
+ private static final String FLOWABLE_MODELER_CTX = "flowable-modeler";
+
+ private final BaseModal<String> utility;
+
+ protected BpmnProcessDirectoryPanel(final String id, final Builder builder) {
+ super(id, builder);
+
+ this.addNewItemPanelBuilder(new AjaxWizardBuilder<BpmnProcessTO>(new BpmnProcessTO(), pageRef) {
+
+ private static final long serialVersionUID = 1633859795677053912L;
+
+ @Override
+ protected WizardModel buildModelSteps(
+ final BpmnProcessTO modelObject, final WizardModel wizardModel) {
+
+ return wizardModel;
+ }
+ }, false);
+ NewBpmnProcess newBpmnProcess = new NewBpmnProcess("newBpmnProcess", container, pageRef);
+ addInnerObject(newBpmnProcess);
+ AjaxLink<Void> newBpmnProcessLink = new AjaxLink<Void>("add") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ newBpmnProcess.toggle(target, true);
+ }
+ };
+ ((WebMarkupContainer) get("container:content")).addOrReplace(newBpmnProcessLink);
+
+ setShowResultPage(true);
+
+ modal.size(Modal.Size.Large);
+
+ utility = new BaseModal<>("outer");
+ addOuterObject(utility);
+ utility.size(Modal.Size.Large);
+ AjaxSubmitLink xmlEditorSubmit = utility.addSubmitButton();
+ MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, RENDER, FlowableEntitlement.BPMN_PROCESS_SET);
+ utility.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ utility.show(false);
+ utility.close(target);
+ }
+ });
+ initResultTable();
+ }
+
+ @Override
+ protected BpmProcessDataProvider dataProvider() {
+ return new BpmProcessDataProvider(rows);
+ }
+
+ @Override
+ protected String paginatorRowsKey() {
+ return Constants.PREF_WORKFLOW_PAGINATOR_ROWS;
+ }
+
+ @Override
+ protected List<IColumn<BpmnProcessTO, String>> getColumns() {
+ List<IColumn<BpmnProcessTO, String>> columns = new ArrayList<>();
+
+ columns.add(new PropertyColumn<>(new ResourceModel("key"), "key"));
+ columns.add(new PropertyColumn<>(new ResourceModel("name"), "name", "name"));
+
+ return columns;
+ }
+
+ @Override
+ public ActionsPanel<BpmnProcessTO> getActions(final IModel<BpmnProcessTO> model) {
+ final ActionsPanel<BpmnProcessTO> panel = super.getActions(model);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = -184018732772021627L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ final IModel<String> wfDefinition = new Model<>();
+ try {
+ wfDefinition.setObject(IOUtils.toString(restClient.getDefinition(
+ MediaType.APPLICATION_XML_TYPE, model.getObject().getKey())));
+ } catch (IOException e) {
+ LOG.error("Could not get workflow definition", e);
+ }
+
+ utility.header(Model.of(model.getObject().getKey()));
+ utility.setContent(new XMLEditorPanel(utility, wfDefinition, false, pageRef) {
+
+ private static final long serialVersionUID = -7688359318035249200L;
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target) {
+ if (StringUtils.isNotBlank(wfDefinition.getObject())) {
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_XML_TYPE,
+ model.getObject().getKey(), wfDefinition.getObject());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+
+ target.add(container);
+ utility.show(false);
+ utility.close(target);
+ } catch (SyncopeClientException e) {
+ SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
+ ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ }
+ });
+ utility.show(target);
+ target.add(utility);
+ }
+ }, ActionLink.ActionType.EDIT, FlowableEntitlement.BPMN_PROCESS_SET);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ modal.header(Model.of(model.getObject().getKey()));
+ modal.setContent(new ImageModalPanel<>(
+ modal, restClient.getDiagram(model.getObject().getKey()), pageRef));
+ modal.show(target);
+ target.add(modal);
+ }
+ }, ActionLink.ActionType.VIEW, FlowableEntitlement.BPMN_PROCESS_GET);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = -184018732772021627L;
+
+ @Override
+ public Class<? extends Page> getPageClass() {
+ return ModelerPopupPage.class;
+ }
+
+ @Override
+ public PageParameters getPageParameters() {
+ PageParameters parameters = new PageParameters();
+ parameters.add(Constants.MODELER_CONTEXT, FLOWABLE_MODELER_CTX);
+ parameters.add(Constants.MODEL_ID_PARAM, model.getObject().getModelId());
+
+ return parameters;
+ }
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ // do nothing
+ }
+ }, ActionLink.ActionType.EXTERNAL_EDITOR, FlowableEntitlement.BPMN_PROCESS_SET);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected boolean statusCondition(final BpmnProcessTO modelObject) {
+ return !modelObject.isUserWorkflow();
+ }
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ try {
+ restClient.deleteDefinition(model.getObject().getKey());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ target.add(container);
+ } catch (SyncopeClientException e) {
+ LOG.error("While deleting BPMN definition {}", model.getObject().getName(), e);
+ SyncopeConsoleSession.get().error(
+ StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, FlowableEntitlement.BPMN_PROCESS_DELETE, true);
+
+ return panel;
+ }
+
+ @Override
+ protected Collection<ActionLink.ActionType> getBatches() {
+ return Collections.emptyList();
+ }
+
+ public abstract static class Builder
+ extends DirectoryPanel.Builder<BpmnProcessTO, BpmnProcessTO, BpmnProcessRestClient> {
+
+ private static final long serialVersionUID = 5088962796986706805L;
+
+ public Builder(final PageReference pageRef) {
+ super(new BpmnProcessRestClient(), pageRef);
+ }
+
+ @Override
+ protected WizardMgtPanel<BpmnProcessTO> newInstance(final String id, final boolean wizardInModal) {
+ return new BpmnProcessDirectoryPanel(id, this);
+ }
+ }
+
+ protected class BpmProcessDataProvider extends DirectoryDataProvider<BpmnProcessTO> {
+
+ private static final long serialVersionUID = 1764153405387687592L;
+
+ private final SortableDataProviderComparator<BpmnProcessTO> comparator;
+
+ private final BpmnProcessRestClient restClient = new BpmnProcessRestClient();
+
+ public BpmProcessDataProvider(final int paginatorRows) {
+ super(paginatorRows);
+ this.comparator = new SortableDataProviderComparator<>(this);
+ setSort("key", SortOrder.ASCENDING);
+ }
+
+ @Override
+ public Iterator<BpmnProcessTO> iterator(final long first, final long count) {
+ List<BpmnProcessTO> result = restClient.getDefinitions();
+ Collections.sort(result, comparator);
+ return result.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.getDefinitions().size();
+ }
+
+ @Override
+ public IModel<BpmnProcessTO> model(final BpmnProcessTO object) {
+ return new CompoundPropertyModel<>(object);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java
new file mode 100644
index 0000000..e28fb62
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java
@@ -0,0 +1,87 @@
+/*
+ * 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.client.console.panels;
+
+import java.io.Serializable;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.pdfbox.util.Charsets;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.Model;
+
+public class NewBpmnProcess extends TogglePanel<Serializable> {
+
+ private static final long serialVersionUID = -4886361549305302161L;
+
+ private final BpmnProcessRestClient restClient = new BpmnProcessRestClient();
+
+ private final Form<?> form;
+
+ public NewBpmnProcess(final String id, final WebMarkupContainer container, final PageReference pageRef) {
+ super(id, pageRef);
+
+ form = new Form<>("form");
+ addInnerObject(form);
+
+ final TextField<String> key = new TextField<>("key", new Model<>());
+ key.setRequired(true);
+ form.add(key);
+
+ form.add(new AjaxSubmitLink("submit", form) {
+
+ private static final long serialVersionUID = 4947613489823025052L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target) {
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_XML_TYPE, key.getModelObject(),
+ IOUtils.toString(
+ getClass().getResourceAsStream("empty.bpmn20.xml"),
+ Charsets.UTF_8.name()).replaceAll("%KEY%", key.getModelObject()));
+
+ key.getModel().setObject(null);
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ toggle(target, false);
+ target.add(container);
+ } catch (Exception e) {
+ LOG.error("While creating new BPMN process", e);
+ SyncopeConsoleSession.get().error(
+ StringUtils.isBlank(e.getMessage())
+ ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target) {
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.java
new file mode 100644
index 0000000..91a42e3
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.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.client.console.resources;
+
+import javax.ws.rs.NotFoundException;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.string.StringValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+abstract class AbstractBpmnProcessResource extends AbstractResource {
+
+ private static final long serialVersionUID = 5163553843196539019L;
+
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractBpmnProcessResource.class);
+
+ protected final BpmnProcessRestClient restClient = new BpmnProcessRestClient();
+
+ protected BpmnProcessTO getBpmnProcess(final Attributes attributes) {
+ StringValue modelId = attributes.getRequest().getQueryParameters().getParameterValue(Constants.MODEL_ID_PARAM);
+
+ BpmnProcessTO bpmnProcess = modelId == null || modelId.isNull()
+ ? null
+ : restClient.getDefinitions().stream().
+ filter(object -> modelId.toString().equals(object.getModelId())).findAny().orElse(null);
+ if (bpmnProcess == null) {
+ throw new NotFoundException("BPMN process with modelId " + modelId);
+ }
+
+ return bpmnProcess;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java
new file mode 100644
index 0000000..ba34502
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java
@@ -0,0 +1,56 @@
+/*
+ * 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.client.console.resources;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.client.console.annotations.Resource;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.wicket.util.io.IOUtils;
+
+/**
+ * Mirror REST resource for obtaining BPMN process in JSON (used by Flowable Modeler).
+ */
+@Resource(key = "bpmnProcessGET", path = "/bpmnProcessGET")
+public class BpmnProcessGETResource extends AbstractBpmnProcessResource {
+
+ private static final long serialVersionUID = 4637304868056148970L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ final BpmnProcessTO toGet = getBpmnProcess(attributes);
+
+ ResourceResponse response = new ResourceResponse();
+ response.disableCaching();
+ response.setContentType(MediaType.APPLICATION_JSON);
+ response.setTextEncoding(StandardCharsets.UTF_8.name());
+ response.setWriteCallback(new WriteCallback() {
+
+ @Override
+ public void writeData(final Attributes attributes) throws IOException {
+ IOUtils.copy(new BpmnProcessRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE, toGet.getKey()),
+ attributes.getResponse().getOutputStream());
+ }
+ });
+
+ return response;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java
new file mode 100644
index 0000000..d583396
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java
@@ -0,0 +1,73 @@
+/*
+ * 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.client.console.resources;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.cxf.common.util.UrlUtils;
+import org.apache.syncope.client.console.annotations.Resource;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.wicket.util.io.IOUtils;
+
+/**
+ * Mirror REST resource for setting BPMN process in JSON (used by Flowable Modeler).
+ */
+@Resource(key = "bpmnProcessPUT", path = "/bpmnProcessPUT")
+public class BpmnProcessPUTResource extends AbstractBpmnProcessResource {
+
+ private static final long serialVersionUID = 2964542005207297944L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ String definition = null;
+ try {
+ HttpServletRequest request = (HttpServletRequest) attributes.getRequest().getContainerRequest();
+ String requestBody = IOUtils.toString(request.getInputStream());
+ String[] split = requestBody.split("&");
+ for (int i = 0; i < split.length && definition == null; i++) {
+ String keyValue = split[i];
+ if (keyValue.startsWith("json_xml=")) {
+ definition = UrlUtils.urlDecode(keyValue.split("=")[1]);
+ }
+ }
+ } catch (IOException e) {
+ LOG.error("Could not extract BPMN process", e);
+ }
+
+ BpmnProcessTO toSet = getBpmnProcess(attributes);
+
+ if (definition == null || toSet == null) {
+ return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
+ setError(Response.Status.BAD_REQUEST.getStatusCode(),
+ "Could not extract BPMN process' model id and / or definition");
+ }
+
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_JSON_TYPE, toSet.getKey(), definition);
+ return new ResourceResponse().setStatusCode(Response.Status.NO_CONTENT.getStatusCode());
+ } catch (Exception e) {
+ LOG.error("While updating BPMN process", e);
+ return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
+ setError(Response.Status.BAD_REQUEST.getStatusCode(),
+ "While updating BPMN process: " + e.getMessage());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java
new file mode 100644
index 0000000..2b7c368
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java
@@ -0,0 +1,72 @@
+/*
+ * 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.client.console.rest;
+
+import java.io.InputStream;
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.BpmnProcessService;
+
+public class BpmnProcessRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 5049285686167071017L;
+
+ private BpmnProcessService getService(final MediaType mediaType) {
+ return SyncopeConsoleSession.get().getService(mediaType, BpmnProcessService.class);
+ }
+
+ public List<BpmnProcessTO> getDefinitions() {
+ return getService(BpmnProcessService.class).list();
+ }
+
+ public InputStream getDefinition(final MediaType mediaType, final String key) {
+ Response response = getService(mediaType).get(key);
+
+ return (InputStream) response.getEntity();
+ }
+
+ public byte[] getDiagram(final String key) {
+ BpmnProcessService service = getService(BpmnProcessService.class);
+ WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
+ Response response = service.exportDiagram(key);
+
+ byte[] diagram;
+ try {
+ diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
+ } catch (Exception e) {
+ LOG.error("Could not get workflow diagram", e);
+ diagram = new byte[0];
+ }
+ return diagram;
+ }
+
+ public void setDefinition(final MediaType mediaType, final String key, final String definition) {
+ getService(mediaType).set(key, definition);
+ }
+
+ public void deleteDefinition(final String key) {
+ getService(BpmnProcessService.class).delete(key);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java
new file mode 100644
index 0000000..555555b
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java
@@ -0,0 +1,54 @@
+/*
+ * 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.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
+
+public class UserRequestRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -4785231164900813921L;
+
+ public int countForms() {
+ return getService(UserRequestService.class).
+ getForms(new UserRequestFormQuery.Builder().page(1).size(1).build()).
+ getTotalCount();
+ }
+
+ public List<UserRequestForm> getForms(final int page, final int size, final SortParam<String> sort) {
+ return getService(UserRequestService.class).
+ getForms(new UserRequestFormQuery.Builder().page(page).size(size).orderBy(toOrderBy(sort)).build()).
+ getResult();
+ }
+
+ public List<UserRequestForm> getForms(final String userKey) {
+ return getService(UserRequestService.class).getForms(userKey);
+ }
+
+ public UserRequestForm claimForm(final String taskKey) {
+ return getService(UserRequestService.class).claimForm(taskKey);
+ }
+
+ public void submitForm(final UserRequestForm form) {
+ getService(UserRequestService.class).submitForm(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java
new file mode 100644
index 0000000..68d5856
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java
@@ -0,0 +1,34 @@
+/*
+ * 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.client.console.rest;
+
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.common.rest.api.service.UserWorkflowTaskService;
+
+public class UserWorkflowTaskRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 5765024947677482995L;
+
+ public UserTO executeNextTask(final UserTO userTO) {
+ WorkflowTaskExecInput input = new WorkflowTaskExecInput();
+ input.setUserKey(userTO.getKey());
+ return getService(UserWorkflowTaskService.class).executeNextTask(input);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
new file mode 100644
index 0000000..8f8329e
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
@@ -0,0 +1,130 @@
+/*
+ * 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.client.console.widgets;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.image.Icon;
+import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconTypeBuilder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.annotations.ExtWidget;
+import org.apache.syncope.client.console.pages.Approvals;
+import org.apache.syncope.client.console.rest.UserRequestRestClient;
+import org.apache.syncope.client.console.wicket.ajax.IndicatorAjaxTimerBehavior;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.util.time.Duration;
+
+@ExtWidget(priority = 10)
+public class ApprovalsWidget extends ExtAlertWidget<UserRequestForm> {
+
+ private static final long serialVersionUID = 7667120094526529934L;
+
+ private final UserRequestRestClient restClient = new UserRequestRestClient();
+
+ private final List<UserRequestForm> lastApprovals = new ArrayList<>();
+
+ public ApprovalsWidget(final String id, final PageReference pageRef) {
+ super(id);
+ setOutputMarkupId(true);
+
+ latestAlertsList.add(new IndicatorAjaxTimerBehavior(Duration.seconds(30)) {
+
+ private static final long serialVersionUID = 7298597675929755960L;
+
+ @Override
+ protected void onTimer(final AjaxRequestTarget target) {
+ if (!latestAlerts.getObject().equals(lastApprovals)) {
+ refreshLatestAlerts(target);
+ }
+ }
+ });
+ }
+
+ public final void refreshLatestAlerts(final AjaxRequestTarget target) {
+ latestAlerts.getObject().clear();
+ latestAlerts.getObject().addAll(lastApprovals);
+
+ int latestAlertSize = getLatestAlertsSize();
+ linkAlertsNumber.setDefaultModelObject(latestAlertSize);
+ target.add(linkAlertsNumber);
+
+ headerAlertsNumber.setDefaultModelObject(latestAlertSize);
+ target.add(headerAlertsNumber);
+
+ target.add(latestAlertsList);
+
+ lastApprovals.clear();
+ lastApprovals.addAll(latestAlerts.getObject());
+ }
+
+ @Override
+ protected int getLatestAlertsSize() {
+ return SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_LIST)
+ && SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_READ)
+ ? restClient.countForms()
+ : 0;
+ }
+
+ @Override
+ protected IModel<List<UserRequestForm>> getLatestAlerts() {
+ return new ListModel<UserRequestForm>() {
+
+ private static final long serialVersionUID = -2583290457773357445L;
+
+ @Override
+ public List<UserRequestForm> getObject() {
+ List<UserRequestForm> updatedApprovals;
+ if (SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_LIST)
+ && SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_READ)) {
+
+ updatedApprovals = restClient.getForms(1, MAX_SIZE, new SortParam<>("createTime", true));
+ } else {
+ updatedApprovals = Collections.<UserRequestForm>emptyList();
+ }
+
+ return updatedApprovals;
+ }
+ };
+ }
+
+ @Override
+ protected AbstractLink getEventsLink(final String linkid) {
+ BookmarkablePageLink<Approvals> approvals = BookmarkablePageLinkBuilder.build(linkid, Approvals.class);
+ MetaDataRoleAuthorizationStrategy.authorize(approvals, WebPage.ENABLE, FlowableEntitlement.WORKFLOW_FORM_LIST);
+ return approvals;
+ }
+
+ @Override
+ protected Icon getIcon(final String iconid) {
+ return new Icon(iconid,
+ FontAwesomeIconTypeBuilder.on(FontAwesomeIconTypeBuilder.FontAwesomeGraphic.handshake_o).build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/app-cfg.js
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/app-cfg.js b/ext/flowable/client-console/src/main/resources/app-cfg.js
new file mode 100644
index 0000000..15ec23a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/app-cfg.js
@@ -0,0 +1,25 @@
+/* Copyright 2005-2015 Alfresco Software, Ltd.
+ *
+ * Licensed 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.
+ */
+
+'use strict';
+
+var FLOWABLE = FLOWABLE || {};
+
+FLOWABLE.CONFIG = {
+ 'onPremise' : true,
+ 'contextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler')) + '/flowable-modeler',
+ 'webContextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler') + '/flowable-modeler'),
+ 'datesLocalization' : false
+};
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
new file mode 100644
index 0000000..64805b9
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
@@ -0,0 +1,31 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div wicket:id="propView">
+ <span wicket:id="value">[value]</span>
+ </div>
+
+ <div style="margin: 20px 0">
+ <a href="#" alt="user details" class="btn btn-primary btn-circle btn-lg" wicket:id="userDetails" wicket:message="title:userDetails">
+ <i class="glyphicon glyphicon-eye-open"></i>
+ </a>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
new file mode 100644
index 0000000..450ff50
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.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.
+userDetails=User details
+userForm=Edit User
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
new file mode 100644
index 0000000..1de2361
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <span wicket:id="wizard"/>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
new file mode 100644
index 0000000..5d5d129
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <span wicket:id="approval">[APPROVAL]</span>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
new file mode 100644
index 0000000..84106b9
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=\u627f\u8a8d\u8a73\u7d30
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
new file mode 100644
index 0000000..92c475d
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.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.
+userDetails=Dettagli utente
+userForm=Modifica utente
[26/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
new file mode 100644
index 0000000..5a9cc2d
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.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.
+userDetails=\u30e6\u30fc\u30b6\u30fc\u8a73\u7d30
+userForm=\u30e6\u30fc\u30b6\u30fc\u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
new file mode 100644
index 0000000..00a8971
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.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.
+userDetails=Detalhes do Usu\u00e1rio
+userForm=Detalhes do Usu\u00e1rio
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
new file mode 100644
index 0000000..02c159a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.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.
+#
+# userDetails=\u00d0\u0098\u00d0\u00bd\u00d1\u0084\u00d0\u00be\u00d1\u0080\u00d0\u00bc\u00d0\u00b0\u00d1\u0086\u00d0\u00b8\u00d1\u008f \u00d0\u00be \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5
+userDetails=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
+userForm=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
new file mode 100644
index 0000000..5bf6234
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <section class="content-header">
+ <h1> </h1>
+ <ol class="breadcrumb">
+ <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard">[DASHBOARD]</wicket:message></a></li>
+ <li class="active"><wicket:message key="approvals"/></li>
+ </ol>
+ </section>
+
+ <section class="content" wicket:id="content">
+ <div class="box">
+ <div class="box-body" wicket:id="wfPanel"/>
+ </div>
+ </section>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
new file mode 100644
index 0000000..1ea8063
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=Task
+key=Key
+description=Description
+createTime=Create Time
+dueDate=Due Date
+owner=Owner
+claim=Claim
+manage=Manage
+approvals=Approvals
+delete=Delete
+type=Type
+username=Username
+new_user=New User
+creationDate = Creation Date
+claimDate = Claim Dare
+approval.edit=Approval Edit
+approval.manage=Approval Manage
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
new file mode 100644
index 0000000..7e12ce5
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=Task
+key=Chiave
+description=Descrizione
+createTime=Data di creazione
+dueDate=Scadenza
+owner=Esecutore
+claim=Richiedi
+manage=Gestisci
+approvals=Approvazioni
+delete=Rimuovi
+type=Tipo
+username=Utente
+new_user=Nuovo utente
+creationDate = Data creazione
+claimDate = Data rivendicazione
+approval.manage=Gestisci Approvazione
+approval.edit=Modifica Approvazione
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
new file mode 100644
index 0000000..b2ff626
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=\u30bf\u30b9\u30af
+key=\u30ad\u30fc
+description=\u8aac\u660e
+createTime=\u4f5c\u6210\u6642\u523b
+dueDate=\u671f\u9650
+owner=\u30aa\u30fc\u30ca\u30fc
+claim=\u7533\u8acb
+manage=\u7ba1\u7406
+approvals=\u627f\u8a8d
+delete=\u524a\u9664
+type=\u30bf\u30a4\u30d7
+username=\u30e6\u30fc\u30b6\u30fc\u540d
+new_user=\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc
+creationDate = \u4f5c\u6210\u65e5
+claimDate = \u7533\u8acb\u65e5
+approval.edit=\u627f\u8a8d \u7de8\u96c6
+approval.manage=\u627f\u8a8d \u7ba1\u7406
+any.edit=${anyTO.type} ${anyTO.username} \u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
new file mode 100644
index 0000000..e5ff74c
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=Tarefa
+key=Chave
+description=Descri\u00e7\u00e3o
+createTime=Tempo de Cria\u00e7\u00e3o
+dueDate=Data acordada
+owner=Propriet\u00e1rio
+claim=Requerimento
+manage=Ger\u00eancia
+approvals=Aprova\u00e7\u00f5es
+delete=Excluir
+type=Tipo
+username=Usu\u00e1rio
+new_user=Novo Usu\u00e1rio
+creationDate = Data de cria\u00e7\u00e3o
+claimDate = Data de reivindica\u00e7\u00e3o
+approval.manage=Aprova\u00e7\u00e3o
+approval.edit=Aprova\u00e7\u00e3o
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
new file mode 100644
index 0000000..6f4fb58
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
@@ -0,0 +1,52 @@
+# 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.
+#
+# taskId=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b0
+taskId=\u0417\u0430\u044f\u0432\u043a\u0430
+# key=\u00d0\u0098\u00d0\u00b4\u00d0\u00b5\u00d0\u00bd\u00d1\u0082\u00d0\u00b8\u00d1\u0084\u00d0\u00b8\u00d0\u00ba\u00d0\u00b0\u00d1\u0082\u00d0\u00be\u00d1\u0080
+key=\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440
+# description=\u00d0\u009e\u00d0\u00bf\u00d0\u00b8\u00d1\u0081\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+description=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435
+# createTime=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
+createTime=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
+# dueDate=\u00d0\u00a1\u00d1\u0080\u00d0\u00be\u00d0\u00ba
+dueDate=\u0421\u0440\u043e\u043a
+# owner=\u00d0\u0092\u00d0\u00bb\u00d0\u00b0\u00d0\u00b4\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5\u00d1\u0086
+owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
+# claim=\u00d0\u0092\u00d1\u008b\u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d0\u00bd\u00d0\u00b8\u00d1\u0082\u00d1\u008c \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+claim=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
+# manage=\u00d0\u00a3\u00d0\u00bf\u00d1\u0080\u00d0\u00b0\u00d0\u00b2\u00d0\u00bb\u00d0\u00b5\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+manage=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435
+# approvals=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b8
+approvals=\u0417\u0430\u044f\u0432\u043a\u0438
+# delete=\u00d0\u00a3\u00d0\u00b4\u00d0\u00b0\u00d0\u00bb\u00d0\u00b8\u00d1\u0082\u00d1\u008c
+delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c
+# type=\u00d0\u00a2\u00d0\u00b8\u00d0\u00bf
+type=\u0422\u0438\u043f
+# username=\u00d0\u0098\u00d0\u00bc\u00d1\u008f \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
+username=\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
+# new_user=\u00d0\u00a1\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5 \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
+new_user=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
+# creationDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
+creationDate=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
+# claimDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d0\u00bd\u00d0\u00b0\u00d1\u0087\u00d0\u00b0\u00d0\u00bb\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
+claimDate=\u0414\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
+# approval.edit=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+approval.edit=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
+# approval.manage=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+approval.manage=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html
new file mode 100644
index 0000000..b23fab0
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <section class="content-header">
+ <h1> </h1>
+ <ol class="breadcrumb">
+ <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard"/></a></li>
+ <li class="active"><wicket:message key="extensions"/></li>
+ <li class="active">Flowable</li>
+ </ol>
+ </section>
+
+ <section class="content" wicket:id="content">
+ <span wicket:id="disabled"><i><wicket:message key="disabled"/></i></span>
+ <div class="box">
+ <div class="box-body" wicket:id="bpmnProcessesPanel"/>
+ </div>
+ </section>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.properties
new file mode 100644
index 0000000..5b088d6
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.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.
+xmlEditorTitle=Workflow XML Editor
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
new file mode 100644
index 0000000..e1afe72
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html>
+ <head>
+ <title>Apache Syncope / Flowable Modeler</title>
+
+ <meta http-equiv="refresh" content="0; url=../../flowable-modeler/modeler.html"/>
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.properties
new file mode 100644
index 0000000..37fd859
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.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.
+xmlEditorTitle=Workflow XML Editor
+userWorkflow=Workflow utenti
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.properties
new file mode 100644
index 0000000..e811544
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.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.
+xmlEditorTitle=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc XML \u30a8\u30c7\u30a3\u30bf\u30fc
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.properties
new file mode 100644
index 0000000..5b088d6
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.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.
+xmlEditorTitle=Workflow XML Editor
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.properties
new file mode 100644
index 0000000..515fa3a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.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.
+xmlEditorTitle=XML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html
new file mode 100644
index 0000000..a755298
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <span wicket:id="newBpmnProcess"/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html
new file mode 100644
index 0000000..6197d5a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html
@@ -0,0 +1,32 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div id="startAtContainer">
+ <form wicket:id="form">
+ <div class="input-group">
+ <input wicket:id="key"/>
+ <div class="input-group-addon">
+ <a wicket:id="submit"><i class="fa fa-file-o" alt="new" title="new"></i></a>
+ </div>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
new file mode 100644
index 0000000..5943197
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
@@ -0,0 +1,49 @@
+<?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:flowable="http://flowable.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://www.flowable.org/processdef">
+
+ <process id="%KEY%" name="%KEY%" isExecutable="true">
+ <startEvent id="startevent1" name="Start"></startEvent>
+ <endEvent id="endevent1" name="End"></endEvent>
+ <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="endevent1"></sequenceFlow>
+ </process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
+ <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
+ <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+ <omgdc:Bounds height="35.0" width="35.0" x="180.0" y="110.0"></omgdc:Bounds>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+ <omgdc:Bounds height="35.0" width="35.0" x="460.0" y="110.0"></omgdc:Bounds>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="215.0" y="127.0"></omgdi:waypoint>
+ <omgdi:waypoint x="460.0" y="127.0"></omgdi:waypoint>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
new file mode 100644
index 0000000..dd5b98f
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=View all approvals
+duedate=Due date
+owner=Owner
+createApproval=Create Approval
+summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
new file mode 100644
index 0000000..7b2287e
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=Tutte le approvazioni
+duedate=Scadenza
+owner=Assegnato
+createApproval=Approvazione Creazione
+summary=${number} approvazioni pendenti
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
new file mode 100644
index 0000000..a6089eb
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=\u3059\u3079\u3066\u306e\u627f\u8a8d\u3092\u8868\u793a
+duedate=\u671f\u9650
+owner=\u30aa\u30fc\u30ca\u30fc
+createApproval=\u627f\u8a8d\u3092\u4f5c\u6210
+summary=${number} \u4fdd\u7559\u306e\u627f\u8a8d
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
new file mode 100644
index 0000000..c24f3d8
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=View all Approvals
+duedate=Due date
+owner=Owner
+createApproval=Create Approval
+summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
new file mode 100644
index 0000000..10281ff
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
@@ -0,0 +1,22 @@
+# 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.
+#
+alerts.view.all=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u044f\u0432\u043a\u0438
+duedate=\u0421\u0440\u043e\u043a
+owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
+createApproval=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u044f\u0432\u043a\u0443
+summary=\u041e\u0436\u0438\u0434\u0430\u044e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f: ${number}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/save-model.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/save-model.html b/ext/flowable/client-console/src/main/resources/save-model.html
new file mode 100644
index 0000000..abd5ecf
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/save-model.html
@@ -0,0 +1,132 @@
+<!--
+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.
+-->
+<div class="modal" ng-controller="SaveModelCtrl">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h2>{{'MODEL.SAVE.TITLE'| translate}}</h2>
+ </div>
+ <div class="modal-body">
+ <div ng-if="saveDialog.errorMessage && saveDialog.errorMessage.length > 0" class="alert error" style="font-size: 14px; margin-top:20px">
+ <div class="popup-error" style="font-size: 14px">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ <span>{{saveDialog.errorMessage}}</span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label for="nameField">{{'MODEL.NAME'| translate}}</label>
+ <input type="text"
+ ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
+ id="nameField"
+ class="form-control"
+ ng-model="saveDialog.name" readonly="readonly"
+ auto-focus />
+ </div>
+ <div class="form-group" style="display: none">
+ <label for="keyField">{{'MODEL.KEY'| translate}}</label>
+ <input type="text"
+ ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
+ id="keyField"
+ class="form-control"
+ ng-model="saveDialog.key" ng-init="saveDialog.key = saveDialog.name"/>
+ </div>
+ <div class="form-group" style="display: none">
+ <label for="docTextArea">{{'MODEL.DESCRIPTION'| translate}}</label>
+ <textarea id="docTextArea" ng-disabled="status.loading" class="form-control" ng-model="saveDialog.description"></textarea>
+ </div>
+ <div class="checkbox" ng-show="!error && !error.isConflict" style="display: none">
+ <label>
+ <input type="checkbox" ng-disabled="status.loading" ng-model="saveDialog.newVersion" >
+ {{'MODEL.SAVE.NEWVERSION'| translate}}
+ </label>
+ </div>
+ <div class="form-group" ng-if="saveDialog.newVersion">
+ <label for="commentTextArea">{{'MODEL.SAVE.COMMENT'| translate}}</label>
+ <textarea id="commentTextArea" class="form-control" ng-model="saveDialog.comment" ng-disabled="status.loading"></textarea>
+ </div>
+
+ <div ng-if="saveDialog.validationErrors" class="alert error" style="font-size: 14px; margin-top:20px">
+
+ <div class="popup-error" style="font-size: 14px">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ <span>{{'MODEL.VALIDATIONERRORS'| translate:error}}</span>
+ </div>
+ </div>
+
+ <div ng-if="error && error.isConflict && !status.loading" class="alert error" style="font-size: 14px; margin-top:20px">
+
+ <div class="popup-error" style="font-size: 14px">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ <span>{{'MODEL.CONFLICT.WRITE'| translate:error}}</span>
+ </div>
+
+ <div>
+
+ <div style="font-size: 14px; margin-bottom: 10px">{{'MODEL.CONFLICT.WRITE.OPTIONS'| translate}}</div>
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'overwrite'">
+ <input type="radio" name="options" id="option1">
+ {{'MODEL.CONFLICT.WRITE.OPTION.OVERWRITE'| translate}}
+ </label>
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'discardChanges'">
+ <input type="radio" name="options" id="option2">
+ {{'MODEL.CONFLICT.WRITE.OPTION.DISCARDCHANGES'| translate}}
+ </label>
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'saveAs'">
+ <input type="radio" name="options" id="option3" ng-disabled="account.type != 'enterprise'">
+ {{'MODEL.CONFLICT.WRITE.OPTION.SAVEAS'| translate}}
+ </label>
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'newVersion'">
+ <input type="radio" name="options" id="optio43">
+ {{'MODEL.CONFLICT.WRITE.OPTION.NEWVERSION'| translate}}
+ </label>
+ </div>
+
+ <div ng-if="error.conflictResolveAction == 'saveAs'" style="margin-top: 10px">
+ <span>{{'MODEL.CONFLICT.SAVEAS'| translate}}</span>
+ <input type="text" ng-model="error.saveAs" style="width: 300px" auto-focus>
+ </div>
+ </div>
+
+ </div>
+
+ </div>
+ <div class="modal-footer">
+
+ <div class="pull-right">
+ <button type="button" class="btn" ng-click="close()" ng-disabled="status.loading" translate>ACTION.CANCEL</button>
+ <button class="btn btn-primary" ng-click="saveAndClose()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" translate>ACTION.SAVE-AND-CLOSE</button>
+ <button class="btn btn-primary" ng-click="save()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" style="display: none" translate>ACTION.SAVE</button>
+ <button class="btn btn-primary" ng-click="okClicked()" ng-disabled="isOkButtonDisabled()" ng-show="error && error.isConflict" translate>ACTION.OK</button>
+ </div>
+
+ <div class="pull-right popup-error" ng-if="error && !error.isConflict">
+ <span>{{'MODEL.SAVE.ERROR'| translate}}</span>
+ </div>
+
+ <loading></loading>
+
+ </div>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/toolbar.js
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/toolbar.js b/ext/flowable/client-console/src/main/resources/toolbar.js
new file mode 100644
index 0000000..920718c
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/toolbar.js
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ */
+'use strict';
+
+var FLOWABLE = FLOWABLE || {};
+FLOWABLE.TOOLBAR_CONFIG = {
+ "items" : [
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "editor-icon editor-icon-save",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.saveModel"
+ },
+ {
+ "type" : "separator",
+ "title" : "",
+ "cssClass" : "toolbar-separator"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.CUT",
+ "cssClass" : "editor-icon editor-icon-cut",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.cut",
+ "enabled" : false,
+ "enabledAction" : "element"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.COPY",
+ "cssClass" : "editor-icon editor-icon-copy",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.copy",
+ "enabled" : false,
+ "enabledAction" : "element"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.PASTE",
+ "cssClass" : "editor-icon editor-icon-paste",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.paste",
+ "enabled" : false
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.DELETE",
+ "cssClass" : "editor-icon editor-icon-delete",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.deleteItem",
+ "enabled" : false,
+ "enabledAction" : "element"
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.REDO",
+ "cssClass" : "editor-icon editor-icon-redo",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.redo",
+ "enabled" : false
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.UNDO",
+ "cssClass" : "editor-icon editor-icon-undo",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.undo",
+ "enabled" : false
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ALIGNVERTICAL",
+ "cssClass" : "editor-icon editor-icon-align-vertical",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignVertical",
+ "enabled" : false,
+ "enabledAction" : "element",
+ "disableInForm" : true,
+ "minSelectionCount" : 2
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ALIGNHORIZONTAL",
+ "cssClass" : "editor-icon editor-icon-align-horizontal",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignHorizontal",
+ "enabledAction" : "element",
+ "enabled" : false,
+ "disableInForm" : true,
+ "minSelectionCount" : 2
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.SAMESIZE",
+ "cssClass" : "editor-icon editor-icon-same-size",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.sameSize",
+ "enabledAction" : "element",
+ "enabled" : false,
+ "disableInForm" : true,
+ "minSelectionCount" : 2
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator",
+ "disableInForm" : true
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMIN",
+ "cssClass" : "editor-icon editor-icon-zoom-in",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomIn"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMOUT",
+ "cssClass" : "editor-icon editor-icon-zoom-out",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomOut"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMACTUAL",
+ "cssClass" : "editor-icon editor-icon-zoom-actual",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomActual"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMFIT",
+ "cssClass" : "editor-icon editor-icon-zoom-fit",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomFit"
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator",
+ "disableInForm" : true
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.BENDPOINT.ADD",
+ "cssClass" : "editor-icon editor-icon-bendpoint-add",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.addBendPoint",
+ "id" : "add-bendpoint-button",
+ "disableInForm" : true
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.BENDPOINT.REMOVE",
+ "cssClass" : "editor-icon editor-icon-bendpoint-remove",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.removeBendPoint",
+ "id" : "remove-bendpoint-button",
+ "disableInForm" : true
+ },
+ {
+ "type" : "separator",
+ "title": "",
+ "cssClass" : "toolbar-separator",
+ "disableInForm" : true
+ }
+ ],
+
+ "secondaryItems" : []
+};
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/url-config.js
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/url-config.js b/ext/flowable/client-console/src/main/resources/url-config.js
new file mode 100644
index 0000000..392d470
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/url-config.js
@@ -0,0 +1,39 @@
+/* Licensed 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.
+ */
+var FLOWABLE = FLOWABLE || {};
+
+FLOWABLE.URL = {
+
+ getModel: function(modelId) {
+ return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
+ + "/bpmnProcessGET?modelId=" + modelId;
+ },
+
+ getStencilSet: function() {
+ return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
+ + "/flowable-modeler/stencilset_bpmn.json";
+ },
+
+ getCmmnStencilSet: function() {
+ return FLOWABLE.CONFIG.contextRoot + '/app/rest/stencil-sets/cmmneditor?version=' + Date.now();
+ },
+
+ putModel: function(modelId) {
+ return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
+ + "/bpmnProcessPUT?modelId=" + modelId;
+ },
+
+ validateModel: function(){
+ return FLOWABLE.CONFIG.contextRoot + '/app/rest/model/validate';
+ }
+};
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/pom.xml b/ext/flowable/common-lib/pom.xml
new file mode 100644
index 0000000..8d00e20
--- /dev/null
+++ b/ext/flowable/common-lib/pom.xml
@@ -0,0 +1,56 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>2.1.2-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable Common Lib</name>
+ <description>Apache Syncope Ext: Flowable Common Lib</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.common</groupId>
+ <artifactId>syncope-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java
new file mode 100644
index 0000000..bb67e3e
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java
@@ -0,0 +1,72 @@
+/*
+ * 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.common.lib.to;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "bpmnProcess")
+@XmlType
+public class BpmnProcessTO extends AbstractBaseBean implements EntityTO {
+
+ private static final long serialVersionUID = -7044543391316529128L;
+
+ private String key;
+
+ private String modelId;
+
+ private String name;
+
+ private boolean userWorkflow;
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public void setKey(final String key) {
+ this.key = key;
+ }
+
+ public String getModelId() {
+ return modelId;
+ }
+
+ public void setModelId(final String modelId) {
+ this.modelId = modelId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public boolean isUserWorkflow() {
+ return userWorkflow;
+ }
+
+ public void setUserWorkflow(final boolean userWorkflow) {
+ this.userWorkflow = userWorkflow;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java
new file mode 100644
index 0000000..897cfc0
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java
@@ -0,0 +1,147 @@
+/*
+ * 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.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.patch.UserPatch;
+
+@XmlRootElement(name = "userRequestForm")
+@XmlType
+public class UserRequestForm extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -7044543391316529128L;
+
+ private String username;
+
+ private String taskId;
+
+ private String formKey;
+
+ private Date createTime;
+
+ private Date dueDate;
+
+ private String owner;
+
+ private UserTO userTO;
+
+ private UserPatch userPatch;
+
+ private final List<UserRequestFormProperty> properties = new ArrayList<>();
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(final String username) {
+ this.username = username;
+ }
+
+ public String getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(final String taskId) {
+ this.taskId = taskId;
+ }
+
+ public String getFormKey() {
+ return formKey;
+ }
+
+ public void setFormKey(final String formKey) {
+ this.formKey = formKey;
+ }
+
+ public Date getCreateTime() {
+ if (createTime != null) {
+ return new Date(createTime.getTime());
+ }
+ return null;
+ }
+
+ public void setCreateTime(final Date createTime) {
+ if (createTime != null) {
+ this.createTime = new Date(createTime.getTime());
+ } else {
+ this.createTime = null;
+ }
+ }
+
+ public Date getDueDate() {
+ if (dueDate != null) {
+ return new Date(dueDate.getTime());
+ }
+ return null;
+ }
+
+ public void setDueDate(final Date dueDate) {
+ if (dueDate != null) {
+ this.dueDate = new Date(dueDate.getTime());
+ } else {
+ this.dueDate = null;
+ }
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final String owner) {
+ this.owner = owner;
+ }
+
+ public UserTO getUserTO() {
+ return userTO;
+ }
+
+ public void setUserTO(final UserTO userTO) {
+ this.userTO = userTO;
+ }
+
+ public UserPatch getUserPatch() {
+ return userPatch;
+ }
+
+ public void setUserPatch(final UserPatch userPatch) {
+ this.userPatch = userPatch;
+ }
+
+ @JsonIgnore
+ public Optional<UserRequestFormProperty> getProperty(final String id) {
+ return properties.stream().filter(property -> id.equals(property.getId())).findFirst();
+ }
+
+ @XmlElementWrapper(name = "workflowFormProperties")
+ @XmlElement(name = "workflowFormProperty")
+ @JsonProperty("workflowFormProperties")
+ public List<UserRequestFormProperty> getProperties() {
+ return properties;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java
new file mode 100644
index 0000000..0a431c6
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java
@@ -0,0 +1,124 @@
+/*
+ * 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.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
+import org.apache.syncope.common.lib.types.UserRequestFormPropertyType;
+
+@XmlRootElement(name = "userRequestFormProperty")
+@XmlType
+public class UserRequestFormProperty extends AbstractBaseBean {
+
+ private static final long serialVersionUID = 9139969592634304261L;
+
+ private String id;
+
+ private String name;
+
+ private UserRequestFormPropertyType type;
+
+ private boolean readable;
+
+ private boolean writable;
+
+ private boolean required;
+
+ private String datePattern;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ private final Map<String, String> enumValues = new HashMap<>();
+
+ private String value;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(final String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public boolean isReadable() {
+ return readable;
+ }
+
+ public void setReadable(final boolean readable) {
+ this.readable = readable;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(final boolean required) {
+ this.required = required;
+ }
+
+ public UserRequestFormPropertyType getType() {
+ return type;
+ }
+
+ public void setType(final UserRequestFormPropertyType type) {
+ this.type = type;
+ }
+
+ public boolean isWritable() {
+ return writable;
+ }
+
+ public void setWritable(final boolean writable) {
+ this.writable = writable;
+ }
+
+ public String getDatePattern() {
+ return datePattern;
+ }
+
+ public void setDatePattern(final String datePattern) {
+ this.datePattern = datePattern;
+ }
+
+ @JsonProperty
+ public Map<String, String> getEnumValues() {
+ return enumValues;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(final String value) {
+ this.value = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java
new file mode 100644
index 0000000..d5fad6c
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java
@@ -0,0 +1,70 @@
+/*
+ * 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.common.lib.to;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "userRequest")
+@XmlType
+public class UserRequestTO extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -8430826310789942133L;
+
+ private String processInstanceId;
+
+ private String executionId;
+
+ private String bpmnProcess;
+
+ private String user;
+
+ public String getProcessInstanceId() {
+ return processInstanceId;
+ }
+
+ public void setProcessInstanceId(final String processInstanceId) {
+ this.processInstanceId = processInstanceId;
+ }
+
+ public String getExecutionId() {
+ return executionId;
+ }
+
+ public void setExecutionId(final String executionId) {
+ this.executionId = executionId;
+ }
+
+ public String getBpmnProcess() {
+ return bpmnProcess;
+ }
+
+ public void setBpmnProcess(final String bpmnProcess) {
+ this.bpmnProcess = bpmnProcess;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(final String user) {
+ this.user = user;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java
new file mode 100644
index 0000000..6b712ab
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java
@@ -0,0 +1,40 @@
+/*
+ * 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.common.lib.to;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "workflowTask")
+@XmlType
+public class WorkflowTask extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -3095016727396210808L;
+
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java
new file mode 100644
index 0000000..0a7e2be
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java
@@ -0,0 +1,55 @@
+/*
+ * 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.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.HashMap;
+import java.util.Map;
+import javax.ws.rs.PathParam;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
+
+@XmlRootElement(name = "workflowTaskExecInput")
+@XmlType
+public class WorkflowTaskExecInput extends AbstractBaseBean {
+
+ private static final long serialVersionUID = 8060283119070901756L;
+
+ private String userKey;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ private final Map<String, String> variables = new HashMap<>();
+
+ public String getUserKey() {
+ return userKey;
+ }
+
+ @PathParam("userKey")
+ public void setUserKey(final String userKey) {
+ this.userKey = userKey;
+ }
+
+ @JsonProperty
+ public Map<String, String> getVariables() {
+ return variables;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java
new file mode 100644
index 0000000..549eb9a
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java
@@ -0,0 +1,29 @@
+/*
+ * 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.common.lib.types;
+
+/**
+ * Format for import / export of workflow definition.
+ */
+public enum BpmnProcessFormat {
+
+ XML,
+ JSON
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java
new file mode 100644
index 0000000..43825a4
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java
@@ -0,0 +1,76 @@
+/*
+ * 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.common.lib.types;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Collections;
+import java.util.Set;
+import java.util.TreeSet;
+
+public final class FlowableEntitlement {
+
+ public static final String BPMN_PROCESS_LIST = "BPMN_PROCESS_LIST";
+
+ public static final String BPMN_PROCESS_GET = "BPMN_PROCESS_GET";
+
+ public static final String BPMN_PROCESS_SET = "BPMN_PROCESS_SET";
+
+ public static final String BPMN_PROCESS_DELETE = "BPMN_PROCESS_DELETE";
+
+ public static final String WORKFLOW_TASK_LIST = "WORKFLOW_TASK_LIST";
+
+ public static final String WORKFLOW_FORM_LIST = "WORKFLOW_FORM_LIST";
+
+ public static final String WORKFLOW_FORM_READ = "WORKFLOW_FORM_READ";
+
+ public static final String WORKFLOW_FORM_CLAIM = "WORKFLOW_FORM_CLAIM";
+
+ public static final String WORKFLOW_FORM_SUBMIT = "WORKFLOW_FORM_SUBMIT";
+
+ public static final String USER_REQUEST_DEF_CREATE = "USER_REQUEST_DEF_CREATE";
+
+ public static final String USER_REQUEST_DEF_UPDATE = "USER_REQUEST_DEF_UPDATE";
+
+ public static final String USER_REQUEST_DEF_DELETE = "USER_REQUEST_DEF_DELETE";
+
+ public static final String USER_REQUEST_START = "USER_REQUEST_START";
+
+ public static final String USER_REQUEST_CANCEL = "USER_REQUEST_CANCEL";
+
+ private static final Set<String> VALUES;
+
+ static {
+ Set<String> values = new TreeSet<>();
+ for (Field field : FlowableEntitlement.class.getDeclaredFields()) {
+ if (Modifier.isStatic(field.getModifiers()) && String.class.equals(field.getType())) {
+ values.add(field.getName());
+ }
+ }
+ VALUES = Collections.unmodifiableSet(values);
+ }
+
+ public static Set<String> values() {
+ return VALUES;
+ }
+
+ private FlowableEntitlement() {
+ // private constructor for static utility class
+ }
+}
[31/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java
deleted file mode 100644
index 804d75c..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java
+++ /dev/null
@@ -1,71 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-@XmlRootElement(name = "workflowDefinition")
-@XmlType
-public class WorkflowDefinitionTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -7044543391316529128L;
-
- private String key;
-
- private String modelId;
-
- private String name;
-
- private boolean main;
-
- public String getKey() {
- return key;
- }
-
- public void setKey(final String key) {
- this.key = key;
- }
-
- public String getModelId() {
- return modelId;
- }
-
- public void setModelId(final String modelId) {
- this.modelId = modelId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public boolean isMain() {
- return main;
- }
-
- public void setMain(final boolean main) {
- this.main = main;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java
deleted file mode 100644
index 59bfc1e..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java
+++ /dev/null
@@ -1,124 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
-import org.apache.syncope.common.lib.types.WorkflowFormPropertyType;
-
-@XmlRootElement(name = "workflowFormProperty")
-@XmlType
-public class WorkflowFormPropertyTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = 9139969592634304261L;
-
- private String id;
-
- private String name;
-
- private WorkflowFormPropertyType type;
-
- private String value;
-
- private boolean readable;
-
- private boolean writable;
-
- private boolean required;
-
- private String datePattern;
-
- @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
- private final Map<String, String> enumValues = new HashMap<>();
-
- public String getId() {
- return id;
- }
-
- public void setId(final String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public boolean isReadable() {
- return readable;
- }
-
- public void setReadable(final boolean readable) {
- this.readable = readable;
- }
-
- public boolean isRequired() {
- return required;
- }
-
- public void setRequired(final boolean required) {
- this.required = required;
- }
-
- public WorkflowFormPropertyType getType() {
- return type;
- }
-
- public void setType(final WorkflowFormPropertyType type) {
- this.type = type;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(final String value) {
- this.value = value;
- }
-
- public boolean isWritable() {
- return writable;
- }
-
- public void setWritable(final boolean writable) {
- this.writable = writable;
- }
-
- public String getDatePattern() {
- return datePattern;
- }
-
- public void setDatePattern(final String datePattern) {
- this.datePattern = datePattern;
- }
-
- @JsonProperty
- public Map<String, String> getEnumValues() {
- return enumValues;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java
deleted file mode 100644
index 2f99b65..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java
+++ /dev/null
@@ -1,147 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-import org.apache.syncope.common.lib.patch.UserPatch;
-
-@XmlRootElement(name = "workflowForm")
-@XmlType
-public class WorkflowFormTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -7044543391316529128L;
-
- private String username;
-
- private String taskId;
-
- private String key;
-
- private Date createTime;
-
- private Date dueDate;
-
- private String owner;
-
- private UserTO userTO;
-
- private UserPatch userPatch;
-
- private final List<WorkflowFormPropertyTO> properties = new ArrayList<>();
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(final String username) {
- this.username = username;
- }
-
- public String getTaskId() {
- return taskId;
- }
-
- public void setTaskId(final String taskId) {
- this.taskId = taskId;
- }
-
- public String getKey() {
- return key;
- }
-
- public void setKey(final String key) {
- this.key = key;
- }
-
- public Date getCreateTime() {
- if (createTime != null) {
- return new Date(createTime.getTime());
- }
- return null;
- }
-
- public void setCreateTime(final Date createTime) {
- if (createTime != null) {
- this.createTime = new Date(createTime.getTime());
- } else {
- this.createTime = null;
- }
- }
-
- public Date getDueDate() {
- if (dueDate != null) {
- return new Date(dueDate.getTime());
- }
- return null;
- }
-
- public void setDueDate(final Date dueDate) {
- if (dueDate != null) {
- this.dueDate = new Date(dueDate.getTime());
- } else {
- this.dueDate = null;
- }
- }
-
- public String getOwner() {
- return owner;
- }
-
- public void setOwner(final String owner) {
- this.owner = owner;
- }
-
- public UserTO getUserTO() {
- return userTO;
- }
-
- public void setUserTO(final UserTO userTO) {
- this.userTO = userTO;
- }
-
- public UserPatch getUserPatch() {
- return userPatch;
- }
-
- public void setUserPatch(final UserPatch userPatch) {
- this.userPatch = userPatch;
- }
-
- @JsonIgnore
- public Optional<WorkflowFormPropertyTO> getProperty(final String id) {
- return properties.stream().filter(property -> id.equals(property.getId())).findFirst();
- }
-
- @XmlElementWrapper(name = "workflowFormProperties")
- @XmlElement(name = "workflowFormProperty")
- @JsonProperty("workflowFormProperties")
- public List<WorkflowFormPropertyTO> getProperties() {
- return properties;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java
deleted file mode 100644
index d2834c8..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java
+++ /dev/null
@@ -1,40 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-@XmlRootElement(name = "workflowTask")
-@XmlType
-public class WorkflowTaskTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -3095016727396210808L;
-
- private String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
index 0968f34..69f417a 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
@@ -202,24 +202,6 @@ public final class StandardEntitlement {
public static final String POLICY_DELETE = "POLICY_DELETE";
- public static final String WORKFLOW_DEF_LIST = "WORKFLOW_DEF_LIST";
-
- public static final String WORKFLOW_DEF_GET = "WORKFLOW_DEF_GET";
-
- public static final String WORKFLOW_DEF_SET = "WORKFLOW_DEF_SET";
-
- public static final String WORKFLOW_DEF_DELETE = "WORKFLOW_DEF_DELETE";
-
- public static final String WORKFLOW_TASK_LIST = "WORKFLOW_TASK_LIST";
-
- public static final String WORKFLOW_FORM_LIST = "WORKFLOW_FORM_LIST";
-
- public static final String WORKFLOW_FORM_READ = "WORKFLOW_FORM_READ";
-
- public static final String WORKFLOW_FORM_CLAIM = "WORKFLOW_FORM_CLAIM";
-
- public static final String WORKFLOW_FORM_SUBMIT = "WORKFLOW_FORM_SUBMIT";
-
public static final String MAIL_TEMPLATE_LIST = "MAIL_TEMPLATE_LIST";
public static final String MAIL_TEMPLATE_CREATE = "MAIL_TEMPLATE_CREATE";
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java
deleted file mode 100644
index ec2db4a..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java
+++ /dev/null
@@ -1,32 +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.
- */
-package org.apache.syncope.common.lib.types;
-
-import javax.xml.bind.annotation.XmlEnum;
-
-@XmlEnum
-public enum WorkflowFormPropertyType {
-
- String,
- Long,
- Enum,
- Date,
- Boolean
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
deleted file mode 100644
index d23b1bc..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
+++ /dev/null
@@ -1,47 +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.
- */
-package org.apache.syncope.common.lib.types;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class WorkflowTasks {
-
- private List<String> tasks;
-
- public WorkflowTasks() {
- this.tasks = new ArrayList<>();
- }
-
- public WorkflowTasks(final Collection<String> tasks) {
- this();
- this.tasks.addAll(tasks);
- }
-
- public List<String> getTasks() {
- return tasks;
- }
-
- public void setTasks(final List<String> tasks) {
- this.tasks = tasks;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
----------------------------------------------------------------------
diff --git a/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java b/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
index bf2ab85..375faf7 100644
--- a/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
+++ b/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
@@ -26,6 +26,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.StringWriter;
import java.util.UUID;
+import org.apache.syncope.common.lib.patch.GroupPatch;
import org.apache.syncope.common.lib.patch.PasswordPatch;
import org.apache.syncope.common.lib.patch.StringPatchItem;
import org.apache.syncope.common.lib.patch.StringReplacePatchItem;
@@ -35,7 +36,6 @@ import org.apache.syncope.common.lib.to.ConnObjectTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.PropagationStatus;
import org.apache.syncope.common.lib.to.ProvisioningResult;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
import org.apache.syncope.common.lib.types.PatchOperation;
import org.junit.jupiter.api.Test;
@@ -43,16 +43,16 @@ public class JSONTest {
@Test
public void map() throws IOException {
- WorkflowFormPropertyTO prop = new WorkflowFormPropertyTO();
- prop.getEnumValues().put("key1", "value1");
- prop.getEnumValues().put("key2", "value2");
+ GroupPatch prop = new GroupPatch();
+ prop.getADynMembershipConds().put("key1", "value1");
+ prop.getADynMembershipConds().put("key2", "value2");
ObjectMapper mapper = new ObjectMapper();
StringWriter writer = new StringWriter();
mapper.writeValue(writer, prop);
- WorkflowFormPropertyTO unserializedProp = mapper.readValue(writer.toString(), WorkflowFormPropertyTO.class);
+ GroupPatch unserializedProp = mapper.readValue(writer.toString(), GroupPatch.class);
assertEquals(prop, unserializedProp);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java
deleted file mode 100644
index c3454bf..0000000
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java
+++ /dev/null
@@ -1,32 +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.
- */
-package org.apache.syncope.common.rest.api.beans;
-
-public class WorkflowFormQuery extends AbstractQuery {
-
- private static final long serialVersionUID = -4762457303770028554L;
-
- public static class Builder extends AbstractQuery.Builder<WorkflowFormQuery, Builder> {
-
- @Override
- protected WorkflowFormQuery newInstance() {
- return new WorkflowFormQuery();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
index eb3f9aa..a7300d7 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.rest.api.service;
+import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.headers.Header;
@@ -134,6 +135,7 @@ public interface AnyService<TO extends AnyTO> extends JAXRSService {
* @param schemaType schema type
* @param schema schema
*/
+ @Operation(operationId = "deleteAttr")
@ApiResponses(
@ApiResponse(responseCode = "204", description = "Operation was successful"))
@DELETE
@@ -150,6 +152,7 @@ public interface AnyService<TO extends AnyTO> extends JAXRSService {
* @param key any object key or name
* @return Response object featuring the deleted any object enriched with propagation status information
*/
+ @Operation(operationId = "deleteAny")
@Parameter(name = RESTHeaders.PREFER, in = ParameterIn.HEADER,
description = "Allows client to specify a preference for the result to be returned from the server",
allowEmptyValue = true, schema =
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
index 3eb45a4..fc0829a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
@@ -44,7 +44,7 @@ import org.apache.syncope.common.lib.to.SecurityQuestionTO;
import org.apache.syncope.common.rest.api.RESTHeaders;
/**
- * REST operations for configuration.
+ * REST operations for security questions.
*/
@Tag(name = "SecurityQuestions")
@SecurityRequirements({
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
deleted file mode 100644
index c38746f..0000000
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
+++ /dev/null
@@ -1,118 +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.
- */
-package org.apache.syncope.common.rest.api.service;
-
-import io.swagger.v3.oas.annotations.security.SecurityRequirement;
-import io.swagger.v3.oas.annotations.security.SecurityRequirements;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import java.util.List;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.BeanParam;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-
-/**
- * REST operations related to user workflow.
- */
-@Tag(name = "UserWorkflow")
-@SecurityRequirements({
- @SecurityRequirement(name = "BasicAuthentication"),
- @SecurityRequirement(name = "Bearer") })
-@Path("userworkflow")
-public interface UserWorkflowService extends JAXRSService {
-
- /**
- * Returns a list of all available workflow forms.
- *
- * @param query query conditions
- * @return list of all available workflow forms
- */
- @GET
- @Path("forms")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- PagedResult<WorkflowFormTO> getForms(@BeanParam WorkflowFormQuery query);
-
- /**
- * Returns a list of available forms for the given user key.
- *
- * @param userKey user key
- * @return list of available forms for the given user key
- */
- @GET
- @Path("forms/{userKey}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- WorkflowFormTO getFormForUser(@NotNull @PathParam("userKey") String userKey);
-
- /**
- * Claims the form for the given task id.
- *
- * @param taskId workflow task id
- * @return the workflow form for the given task id
- */
- @POST
- @Path("forms/{taskId}/claim")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- WorkflowFormTO claimForm(@NotNull @PathParam("taskId") String taskId);
-
- /**
- * Submits a workflow form.
- *
- * @param form workflow form.
- * @return updated user
- */
- @POST
- @Path("forms")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- UserTO submitForm(@NotNull WorkflowFormTO form);
-
- /**
- * Returns a list of available tasks for the given user key.
- *
- * @param userKey user key
- * @return list of available tasks for the given user key
- */
- @GET
- @Path("tasks/{userKey}")
- List<WorkflowTaskTO> getAvailableTasks(@NotNull @PathParam("userKey") String userKey);
-
- /**
- * Executes workflow task for matching id.
- *
- * @param taskId workflow task id
- * @param userTO argument to be passed to workflow task
- * @return updated user
- */
- @POST
- @Path("tasks/{taskId}/execute")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- UserTO executeTask(@NotNull @PathParam("taskId") String taskId, @NotNull UserTO userTO);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
deleted file mode 100644
index 25e3f7a..0000000
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
+++ /dev/null
@@ -1,121 +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.
- */
-package org.apache.syncope.common.rest.api.service;
-
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.security.SecurityRequirement;
-import io.swagger.v3.oas.annotations.security.SecurityRequirements;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import java.util.List;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-
-/**
- * REST operations for workflow definition.
- */
-@Tag(name = "Workflow")
-@SecurityRequirements({
- @SecurityRequirement(name = "BasicAuthentication"),
- @SecurityRequirement(name = "Bearer") })
-@Path("workflows")
-public interface WorkflowService extends JAXRSService {
-
- /**
- * Lists the available workflow definitions, for the given any object type.
- *
- * @param anyType any object type
- * @return available workflow definitions, for the given any object type
- */
- @GET
- @Path("{anyType}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- List<WorkflowDefinitionTO> list(@NotNull @PathParam("anyType") String anyType);
-
- /**
- * Exports the workflow definition for matching any object type and key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- * @return workflow definition for matching any object type and key
- */
- @GET
- @Path("{anyType}/{key}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- Response get(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key);
-
- /**
- * Exports the workflow diagram representation (if available), for matching any object type and key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- * @return workflow diagram representation
- */
- @GET
- @Path("{anyType}/{key}/diagram.png")
- @Produces({ RESTHeaders.MEDIATYPE_IMAGE_PNG })
- Response exportDiagram(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key);
-
- /**
- * Imports the workflow definition for matching any object type, under the provided key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- * @param definition workflow definition for matching kind
- */
- @ApiResponses(
- @ApiResponse(responseCode = "204", description = "Operation was successful"))
- @PUT
- @Path("{anyType}/{key}")
- @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- void set(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key,
- @NotNull String definition);
-
- /**
- * Removes the workflow definition for matching any object type, under the provided key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- */
- @ApiResponses(
- @ApiResponse(responseCode = "204", description = "Operation was successful"))
- @DELETE
- @Path("{anyType}/{key}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- void delete(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
index 46285f2..9377628 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
@@ -60,7 +60,7 @@ public class SecurityQuestionLogic extends AbstractTransactionalLogic<SecurityQu
if (securityQuestion == null) {
LOG.error("Could not find security question '" + key + "'");
- throw new NotFoundException(String.valueOf(key));
+ throw new NotFoundException(key);
}
return binder.getSecurityQuestionTO(securityQuestion);
@@ -77,7 +77,7 @@ public class SecurityQuestionLogic extends AbstractTransactionalLogic<SecurityQu
if (securityQuestion == null) {
LOG.error("Could not find security question '" + securityQuestionTO.getKey() + "'");
- throw new NotFoundException(String.valueOf(securityQuestionTO.getKey()));
+ throw new NotFoundException(securityQuestionTO.getKey());
}
binder.update(securityQuestion, securityQuestionTO);
@@ -92,7 +92,7 @@ public class SecurityQuestionLogic extends AbstractTransactionalLogic<SecurityQu
if (securityQuestion == null) {
LOG.error("Could not find security question '" + key + "'");
- throw new NotFoundException(String.valueOf(key));
+ throw new NotFoundException(key);
}
SecurityQuestionTO deleted = binder.getSecurityQuestionTO(securityQuestion);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java
deleted file mode 100644
index 8023c25..0000000
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java
+++ /dev/null
@@ -1,137 +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.
- */
-package org.apache.syncope.core.logic;
-
-import java.lang.reflect.Method;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.patch.AnyPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.PropagationTaskTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.propagation.PropagationManager;
-import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
-import org.apache.syncope.core.workflow.api.UserWorkflowAdapter;
-import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-@Component
-public class UserWorkflowLogic extends AbstractTransactionalLogic<WorkflowFormTO> {
-
- @Autowired
- private UserWorkflowAdapter uwfAdapter;
-
- @Autowired
- private PropagationManager propagationManager;
-
- @Autowired
- private PropagationTaskExecutor taskExecutor;
-
- @Autowired
- private UserDataBinder binder;
-
- @Autowired
- private UserDAO userDAO;
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_CLAIM + "')")
- public WorkflowFormTO claimForm(final String taskId) {
- return uwfAdapter.claimForm(taskId);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.USER_UPDATE + "')")
- public UserTO executeWorkflowTask(final UserTO userTO, final String taskId) {
- WorkflowResult<String> updated = uwfAdapter.execute(userTO, taskId);
-
- UserPatch userPatch = new UserPatch();
- userPatch.setKey(userTO.getKey());
-
- List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
- new WorkflowResult<>(
- Pair.<UserPatch, Boolean>of(userPatch, null),
- updated.getPropByRes(), updated.getPerformedTasks()));
-
- taskExecutor.execute(tasks, false);
-
- return binder.getUserTO(updated.getResult());
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_READ + "') "
- + "and hasRole('" + StandardEntitlement.USER_READ + "')")
- @Transactional(readOnly = true)
- public WorkflowFormTO getFormForUser(final String key) {
- User user = userDAO.authFind(key);
- return uwfAdapter.getForm(user.getWorkflowId());
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_LIST + "')")
- @Transactional(readOnly = true)
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page,
- final int size,
- final List<OrderByClause> orderByClauses) {
-
- return uwfAdapter.getForms(page, size, orderByClauses);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_TASK_LIST + "') "
- + "and hasRole('" + StandardEntitlement.USER_READ + "')")
- public List<WorkflowTaskTO> getAvailableTasks(final String key) {
- User user = userDAO.authFind(key);
- return uwfAdapter.getAvailableTasks(user.getWorkflowId());
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_SUBMIT + "')")
- public UserTO submitForm(final WorkflowFormTO form) {
- WorkflowResult<? extends AnyPatch> updated = uwfAdapter.submitForm(form);
-
- // propByRes can be made empty by the workflow definition if no propagation should occur
- // (for example, with rejected users)
- if (updated.getResult() instanceof UserPatch
- && updated.getPropByRes() != null && !updated.getPropByRes().isEmpty()) {
-
- List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
- new WorkflowResult<>(
- Pair.of((UserPatch) updated.getResult(), Boolean.TRUE),
- updated.getPropByRes(),
- updated.getPerformedTasks()));
-
- taskExecutor.execute(tasks, false);
- }
-
- return binder.getUserTO(updated.getResult().getKey());
- }
-
- @Override
- protected WorkflowFormTO resolveReference(final Method method, final Object... args)
- throws UnresolvedReferenceException {
-
- throw new UnresolvedReferenceException();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java
deleted file mode 100644
index 4f3e512..0000000
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java
+++ /dev/null
@@ -1,113 +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.
- */
-package org.apache.syncope.core.logic;
-
-import java.io.OutputStream;
-import java.lang.reflect.Method;
-import java.util.List;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
-import org.apache.syncope.core.persistence.api.dao.NotFoundException;
-import org.apache.syncope.core.persistence.api.entity.AnyType;
-import org.apache.syncope.core.workflow.api.AnyObjectWorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.GroupWorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.UserWorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-@Component
-public class WorkflowLogic extends AbstractTransactionalLogic<WorkflowDefinitionTO> {
-
- @Autowired
- private AnyTypeDAO anyTypeDAO;
-
- @Autowired
- private AnyObjectWorkflowDefinitionAdapter awfAdapter;
-
- @Autowired
- private UserWorkflowDefinitionAdapter uwfAdapter;
-
- @Autowired
- private GroupWorkflowDefinitionAdapter gwfAdapter;
-
- private WorkflowDefinitionAdapter getAdapter(final String anyTypeKey) {
- AnyType anyType = anyTypeDAO.find(anyTypeKey);
- if (anyType == null) {
- LOG.error("Could not find anyType '" + anyTypeKey + "'");
- throw new NotFoundException(anyTypeKey);
- }
-
- switch (anyType.getKind()) {
- case ANY_OBJECT:
- return awfAdapter;
-
- case GROUP:
- return gwfAdapter;
-
- case USER:
- default:
- return uwfAdapter;
- }
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_LIST + "')")
- @Transactional(readOnly = true)
- public List<WorkflowDefinitionTO> list(final String anyType) {
- return getAdapter(anyType).getDefinitions();
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_GET + "')")
- @Transactional(readOnly = true)
- public void exportDefinition(
- final String anyType, final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
-
- getAdapter(anyType).exportDefinition(key, format, os);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_GET + "')")
- @Transactional(readOnly = true)
- public void exportDiagram(final String anyType, final String key, final OutputStream os) {
- getAdapter(anyType).exportDiagram(key, os);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_GET + "')")
- public void importDefinition(
- final String anyType, final String key, final WorkflowDefinitionFormat format, final String definition) {
-
- getAdapter(anyType).importDefinition(key, format, definition);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_DELETE + "')")
- public void delete(final String anyType, final String key) {
- getAdapter(anyType).deleteDefinition(key);
- }
-
- @Override
- protected WorkflowDefinitionTO resolveReference(final Method method, final Object... args)
- throws UnresolvedReferenceException {
-
- throw new UnresolvedReferenceException();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
index 042a799..1408585 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
@@ -39,8 +39,6 @@ public interface AnyDAO<A extends Any<?>> extends DAO<A> {
A find(String key);
- A findByWorkflowId(String workflowId);
-
List<A> findByPlainAttrValue(String schemaName, PlainAttrValue attrValue, boolean ignoreCaseMatch);
A findByPlainAttrUniqueValue(String schemaName, PlainAttrValue attrUniqueValue, boolean ignoreCaseMatch);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
index 0ec609e..a9ec46a 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
@@ -36,10 +36,6 @@ public interface Any<P extends PlainAttr<?>> extends AnnotatedEntity {
void setStatus(String status);
- String getWorkflowId();
-
- void setWorkflowId(String workflowId);
-
boolean add(P attr);
boolean remove(P attr);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 90805da..30601d9 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
@@ -91,13 +91,4 @@ public interface User extends
boolean add(Role role);
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/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
index 180c395..567a6fc 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
@@ -29,7 +29,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
-import javax.persistence.NoResultException;
import javax.persistence.Query;
import javax.persistence.TemporalType;
import org.apache.commons.jexl3.parser.Parser;
@@ -177,23 +176,6 @@ public abstract class AbstractAnyDAO<A extends Any<?>> extends AbstractDAO<A> im
return (A) entityManager().find(anyUtils().anyClass(), key);
}
- @SuppressWarnings("unchecked")
- @Override
- public A findByWorkflowId(final String workflowId) {
- Query query = entityManager().createQuery("SELECT e FROM " + anyUtils().anyClass().getSimpleName()
- + " e WHERE e.workflowId = :workflowId", User.class);
- query.setParameter("workflowId", workflowId);
-
- A result = null;
- try {
- result = (A) query.getSingleResult();
- } catch (NoResultException e) {
- LOG.debug("No user found with workflow id {}", workflowId, e);
- }
-
- return result;
- }
-
private Query findByPlainAttrValueQuery(final String entityName, final boolean ignoreCaseMatch) {
String query = "SELECT e FROM " + entityName + " e"
+ " WHERE e.attribute.schema.id = :schemaKey AND (e.stringValue IS NOT NULL"
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
index 64550a7..4d8aaea 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
@@ -264,8 +264,8 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
});
entityManager().remove(anyObject);
- publisher.publishEvent(
- new AnyDeletedEvent(this, AnyTypeKind.ANY_OBJECT, anyObject.getKey(), AuthContextUtils.getDomain()));
+ publisher.publishEvent(new AnyDeletedEvent(
+ this, AnyTypeKind.ANY_OBJECT, anyObject.getKey(), anyObject.getName(), AuthContextUtils.getDomain()));
}
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
index f565358..cdb25918 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
@@ -380,8 +380,8 @@ public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {
clearADynMembers(group);
entityManager().remove(group);
- publisher.publishEvent(
- new AnyDeletedEvent(this, AnyTypeKind.GROUP, group.getKey(), AuthContextUtils.getDomain()));
+ publisher.publishEvent(new AnyDeletedEvent(
+ this, AnyTypeKind.GROUP, group.getKey(), group.getName(), AuthContextUtils.getDomain()));
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
index c9b18ec..f105da5 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
@@ -23,8 +23,7 @@ import javax.persistence.TypedQuery;
import org.apache.syncope.core.persistence.api.dao.SecurityQuestionDAO;
import org.apache.syncope.core.persistence.api.dao.UserDAO;
import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.persistence.jpa.entity.JPASecurityQuestion;
+import org.apache.syncope.core.persistence.jpa.entity.user.JPASecurityQuestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@@ -41,7 +40,7 @@ public class JPASecurityQuestionDAO extends AbstractDAO<SecurityQuestion> implem
@Override
public List<SecurityQuestion> findAll() {
- final TypedQuery<SecurityQuestion> query = entityManager().createQuery(
+ TypedQuery<SecurityQuestion> query = entityManager().createQuery(
"SELECT e FROM " + JPASecurityQuestion.class.getSimpleName() + " e ", SecurityQuestion.class);
return query.getResultList();
}
@@ -58,13 +57,12 @@ public class JPASecurityQuestionDAO extends AbstractDAO<SecurityQuestion> implem
return;
}
- for (User user : userDAO.findBySecurityQuestion(securityQuestion)) {
+ userDAO.findBySecurityQuestion(securityQuestion).forEach(user -> {
user.setSecurityQuestion(null);
user.setSecurityAnswer(null);
userDAO.save(user);
- }
+ });
entityManager().remove(securityQuestion);
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
index b85147f..adc36f5 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
@@ -429,8 +429,8 @@ public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO {
}
entityManager().remove(user);
- publisher.publishEvent(
- new AnyDeletedEvent(this, AnyTypeKind.USER, user.getKey(), AuthContextUtils.getDomain()));
+ publisher.publishEvent(new AnyDeletedEvent(
+ this, AnyTypeKind.USER, user.getKey(), user.getUsername(), AuthContextUtils.getDomain()));
}
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
index e77fb7d..86e2dd5 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
@@ -36,8 +36,6 @@ public abstract class AbstractAny<P extends PlainAttr<?>> extends AbstractAnnota
@ManyToOne(fetch = FetchType.EAGER, optional = false)
private JPARealm realm;
- private String workflowId;
-
@Column(nullable = true)
private String status;
@@ -53,16 +51,6 @@ public abstract class AbstractAny<P extends PlainAttr<?>> extends AbstractAnnota
}
@Override
- public String getWorkflowId() {
- return workflowId;
- }
-
- @Override
- public void setWorkflowId(final String workflowId) {
- this.workflowId = workflowId;
- }
-
- @Override
public String getStatus() {
return status;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
index 1fa7787..96a333a 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.core.persistence.jpa.entity;
+import org.apache.syncope.core.persistence.jpa.entity.user.JPASecurityQuestion;
import org.apache.syncope.core.persistence.api.entity.AccessToken;
import org.apache.syncope.core.persistence.jpa.entity.policy.JPAPasswordPolicy;
import org.apache.syncope.core.persistence.jpa.entity.policy.JPAPullPolicy;
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java
deleted file mode 100644
index ab6e9d5..0000000
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java
+++ /dev/null
@@ -1,47 +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.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
-
-@Entity
-@Table(name = JPASecurityQuestion.TABLE)
-public class JPASecurityQuestion extends AbstractGeneratedKeyEntity implements SecurityQuestion {
-
- private static final long serialVersionUID = 7675321820453579744L;
-
- public static final String TABLE = "SecurityQuestion";
-
- @Column(unique = true)
- private String content;
-
- @Override
- public String getContent() {
- return content;
- }
-
- @Override
- public void setContent(final String content) {
- this.content = content;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
index b84330b..b4be360 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
@@ -95,16 +95,6 @@ public class JPAConf extends AbstractProvidedKeyEntity implements Conf {
}
@Override
- public String getWorkflowId() {
- return null;
- }
-
- @Override
- public void setWorkflowId(final String workflowId) {
- // nothing to do
- }
-
- @Override
public String getStatus() {
return null;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java
new file mode 100644
index 0000000..d82f7ed
--- /dev/null
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java
@@ -0,0 +1,48 @@
+/*
+ * 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.persistence.jpa.entity.user;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
+import org.apache.syncope.core.persistence.jpa.entity.AbstractGeneratedKeyEntity;
+
+@Entity
+@Table(name = JPASecurityQuestion.TABLE)
+public class JPASecurityQuestion extends AbstractGeneratedKeyEntity implements SecurityQuestion {
+
+ private static final long serialVersionUID = 7675321820453579744L;
+
+ public static final String TABLE = "SecurityQuestion";
+
+ @Column(unique = true)
+ private String content;
+
+ @Override
+ public String getContent() {
+ return content;
+ }
+
+ @Override
+ public void setContent(final String content) {
+ this.content = content;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 4686aa6..4ede8b7 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
@@ -49,7 +49,6 @@ import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
import org.apache.syncope.core.persistence.api.entity.user.UPlainAttr;
import org.apache.syncope.core.persistence.api.entity.user.User;
import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
-import org.apache.syncope.core.persistence.jpa.entity.JPASecurityQuestion;
import org.apache.syncope.core.spring.security.Encryptor;
import org.apache.syncope.core.spring.security.SecureRandomUtils;
import org.apache.syncope.core.spring.ApplicationContextProvider;
@@ -96,8 +95,6 @@ public class JPAUser
@Valid
private List<JPAUPlainAttr> plainAttrs = new ArrayList<>();
- private String workflowId;
-
@Column(nullable = true)
private String status;
@@ -144,13 +141,6 @@ public class JPAUser
@Temporal(TemporalType.TIMESTAMP)
private Date changePwdDate;
- @Column(nullable = true)
- private String lastRecertificator;
-
- @Column(nullable = true)
- @Temporal(TemporalType.TIMESTAMP)
- private Date lastRecertification;
-
private Boolean suspended = false;
private Boolean mustChangePassword = false;
@@ -282,16 +272,6 @@ public class JPAUser
}
@Override
- public String getWorkflowId() {
- return workflowId;
- }
-
- @Override
- public void setWorkflowId(final String workflowId) {
- this.workflowId = workflowId;
- }
-
- @Override
public String getStatus() {
return status;
}
@@ -386,31 +366,6 @@ public class JPAUser
}
@Override
- public String getLastRecertificator() {
- return lastRecertificator;
- }
-
- @Override
- public void setLastRecertificator(final String lastRecertificator) {
- this.lastRecertificator = lastRecertificator;
- }
-
- @Override
- public Date getLastRecertification() {
- if (lastRecertification != null) {
- return new Date(lastRecertification.getTime());
- }
- return null;
- }
-
- @Override
- public void setLastRecertification(final Date lastRecertification) {
- this.lastRecertification = lastRecertification == null
- ? null
- : new Date(lastRecertification.getTime());
- }
-
- @Override
public String getUsername() {
return username;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
index b4a598f..a40aa8a 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
@@ -22,7 +22,6 @@ import javax.persistence.Entity;
import org.apache.syncope.core.persistence.jpa.entity.AbstractEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo;
@@ -40,10 +39,9 @@ public class MultiJarAwarePersistenceUnitPostProcessor implements PersistenceUni
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.addIncludeFilter(new AnnotationTypeFilter(Entity.class));
- for (BeanDefinition bd : scanner.findCandidateComponents(AbstractEntity.class.getPackage().getName())) {
+ scanner.findCandidateComponents(AbstractEntity.class.getPackage().getName()).forEach(bd -> {
LOG.debug("Adding JPA entity {}", bd.getBeanClassName());
pui.addManagedClassName(bd.getBeanClassName());
- }
+ });
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 123e500..fd66eb6 100644
--- a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
@@ -126,15 +126,6 @@ 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"/>
-
<!-- JWT lifetime in minutes -->
<SyncopeSchema id="jwt.lifetime.minutes"/>
<PlainSchema id="jwt.lifetime.minutes" type="Long"
@@ -185,10 +176,6 @@ under the License.
<Implementation id="PushJobDelegate" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.pushpull.PushJobDelegate"/>
- <Implementation id="IdentityRecertification" type="TASKJOB_DELEGATE" engine="JAVA"
- body="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
- <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task" active="1"
- jobDelegate_id="IdentityRecertification"/>
<Implementation id="ExpiredAccessTokenCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup"/>
@@ -196,7 +183,7 @@ under the License.
jobDelegate_id="ExpiredAccessTokenCleanup" cronExpression="0 0/5 * * * ?"/>
<Implementation id="ExpiredBatchCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredBatchCleanup"/>
- <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Access Token Cleanup Task" active="1"
+ <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Expired Batch Operations Cleanup Task" active="1"
jobDelegate_id="ExpiredBatchCleanup" cronExpression="0 0/5 * * * ?"/>
<!-- Password reset notifications -->
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
index f505fbe..2f29e17 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
@@ -43,7 +43,7 @@ public class ImplementationTest extends AbstractTest {
List<Implementation> implementations = implementationDAO.findAll();
assertFalse(implementations.isEmpty());
- assertEquals(19, implementations.size());
+ assertEquals(18, implementations.size());
implementations = implementationDAO.find(ImplementationType.PULL_ACTIONS);
assertEquals(1, implementations.size());
@@ -52,7 +52,7 @@ public class ImplementationTest extends AbstractTest {
assertEquals(1, implementations.size());
implementations = implementationDAO.find(ImplementationType.TASKJOB_DELEGATE);
- assertEquals(6, implementations.size());
+ assertEquals(5, implementations.size());
implementations = implementationDAO.find(ImplementationType.REPORTLET);
assertEquals(2, implementations.size());
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
index caabb79..8197a55 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
@@ -76,7 +76,7 @@ public class MultitenancyTest extends AbstractTest {
@Test
public void readPlainSchemas() {
- assertEquals(13, plainSchemaDAO.findAll().size());
+ assertEquals(12, plainSchemaDAO.findAll().size());
}
@Test
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 94fbf40..ff46d62 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
@@ -53,7 +53,7 @@ public class PlainSchemaTest extends AbstractTest {
@Test
public void findAll() {
List<PlainSchema> schemas = plainSchemaDAO.findAll();
- assertEquals(42, schemas.size());
+ assertEquals(41, schemas.size());
}
@Test
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 a912d42..803984e 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(4, taskDAO.findAll(TaskType.SCHEDULED).size());
+ assertEquals(3, 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/66b3a04e/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 1f0fd44..fb05d94 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -126,15 +126,6 @@ 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"/>
-
<!-- JWT lifetime in minutes -->
<SyncopeSchema id="jwt.lifetime.minutes"/>
<PlainSchema id="jwt.lifetime.minutes" type="Long"
@@ -290,30 +281,30 @@ under the License.
<SyncopeRole_Realm role_id="Connector and Resource for realm evenTwo"
realm_id="0679e069-7355-4b20-bd11-a5a0a5453c7c"/>
- <SyncopeUser mustChangePassword="0" id="1417acbe-cbf6-4277-9372-e75e04f97000" workflowId="4" status="active"
+ <SyncopeUser mustChangePassword="0" id="1417acbe-cbf6-4277-9372-e75e04f97000" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="c5b75db1-fce7-470f-b780-3b9934d82a9d"
username="rossini" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
<SyncopeUser_SyncopeRole user_id="1417acbe-cbf6-4277-9372-e75e04f97000" role_id="Other"/>
- <SyncopeUser mustChangePassword="0" id="74cd8ece-715a-44a4-a736-e17b46c4e7e6" workflowId="6" status="active"
+ <SyncopeUser mustChangePassword="0" id="74cd8ece-715a-44a4-a736-e17b46c4e7e6" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="verdi" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
- <SyncopeUser mustChangePassword="0" id="b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" workflowId="8" status="active"
+ <SyncopeUser mustChangePassword="0" id="b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="vivaldi" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
- <SyncopeUser mustChangePassword="0" id="c9b2dec2-00a7-4855-97c0-d854842b4b24" workflowId="10" status="active"
+ <SyncopeUser mustChangePassword="0" id="c9b2dec2-00a7-4855-97c0-d854842b4b24" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="bellini" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
<SyncopeUser_SyncopeRole user_id="c9b2dec2-00a7-4855-97c0-d854842b4b24" role_id="User reviewer"/>
<SyncopeUser_SyncopeRole user_id="c9b2dec2-00a7-4855-97c0-d854842b4b24" role_id="User manager"/>
- <SyncopeUser mustChangePassword="0" id="823074dc-d280-436d-a7dd-07399fae48ec" workflowId="12" status="active"
+ <SyncopeUser mustChangePassword="0" id="823074dc-d280-436d-a7dd-07399fae48ec" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="puccini" creator="admin" lastModifier="admin"
@@ -1210,10 +1201,6 @@ under the License.
body="org.apache.syncope.fit.core.reference.TestSampleJobDelegate"/>
<Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec597979" name="SampleJob Task" active="1"
jobDelegate_id="TestSampleJobDelegate" cronExpression="0 0 0 1 * ?"/>
- <Implementation id="IdentityRecertification" type="TASKJOB_DELEGATE" engine="JAVA"
- body="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
- <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task" active="1"
- jobDelegate_id="IdentityRecertification"/>
<Implementation id="ExpiredAccessTokenCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup"/>
<Task DTYPE="SchedTask" id="89de5014-e3f5-4462-84d8-d97575740baf" name="Access Token Cleanup Task" active="1"
@@ -1335,7 +1322,7 @@ under the License.
unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
<Implementation id="ExpiredBatchCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredBatchCleanup"/>
- <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Access Token Cleanup Task" active="1"
+ <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Expired Batch Operations Cleanup Task" active="1"
jobDelegate_id="ExpiredBatchCleanup" cronExpression="0 0/5 * * * ?"/>
<MailTemplate id="requestPasswordReset"
@@ -2557,7 +2544,7 @@ $$ }
<Report id="0062ea9c-924d-4ecf-9961-4492a8cc6d1b" name="test" active="1" template_id="sample"/>
<Implementation id="UserReportletConf" type="REPORTLET" engine="JAVA"
- body='{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","workflowId","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}'/>
+ body='{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}'/>
<ReportReportlet report_id="0062ea9c-924d-4ecf-9961-4492a8cc6d1b" implementation_id="UserReportletConf"/>
<ReportExec report_id="0062ea9c-924d-4ecf-9961-4492a8cc6d1b" id="c13f39c5-0d35-4bff-ba79-3cd5de940369"
status="SUCCESS" startDate="2012-02-26 15:40:04" endDate="2012-02-26 15:41:04"/>
[24/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java
new file mode 100644
index 0000000..f3f1880
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java
@@ -0,0 +1,488 @@
+/*
+ * 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.flowable.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.core.flowable.api.UserRequestHandler;
+import org.apache.syncope.core.flowable.api.WorkflowTaskManager;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.apache.syncope.core.spring.BeanUtils;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.apache.syncope.core.workflow.java.AbstractUserWorkflowAdapter;
+import org.flowable.bpmn.model.FlowElement;
+import org.flowable.bpmn.model.Gateway;
+import org.flowable.bpmn.model.SequenceFlow;
+import org.flowable.bpmn.model.Process;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class FlowableUserWorkflowAdapter extends AbstractUserWorkflowAdapter implements WorkflowTaskManager {
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ @Autowired
+ protected UserRequestHandler userRequestHandler;
+
+ @Override
+ public String getPrefix() {
+ return "ACT_";
+ }
+
+ @Override
+ public <T> T getVariable(final String executionId, final String variableName, final Class<T> variableClass) {
+ return engine.getRuntimeService().getVariable(executionId, variableName, variableClass);
+ }
+
+ @Override
+ public void setVariable(final String executionId, final String variableName, final Object value) {
+ engine.getRuntimeService().setVariable(executionId, variableName, value);
+ }
+
+ protected User lazyLoad(final User user) {
+ // using BeanUtils to access all user's properties and trigger lazy loading - we are about to
+ // serialize a User instance for availability within workflow tasks, and this breaks transactions
+ BeanUtils.copyProperties(user, entityFactory.newEntity(User.class));
+ return user;
+ }
+
+ @Override
+ protected WorkflowResult<Pair<String, Boolean>> doCreate(
+ final UserTO userTO,
+ final boolean disablePwdPolicyCheck,
+ final Boolean enabled,
+ final boolean storePassword) {
+
+ Map<String, Object> variables = new HashMap<>();
+ variables.put(FlowableRuntimeUtils.WF_EXECUTOR, AuthContextUtils.getUsername());
+ variables.put(FlowableRuntimeUtils.USER_TO, userTO);
+ variables.put(FlowableRuntimeUtils.ENABLED, enabled);
+ variables.put(FlowableRuntimeUtils.STORE_PASSWORD, storePassword);
+
+ ProcessInstance procInst = null;
+ try {
+ procInst = engine.getRuntimeService().
+ startProcessInstanceByKey(FlowableRuntimeUtils.WF_PROCESS_ID, variables);
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(
+ e, "While starting " + FlowableRuntimeUtils.WF_PROCESS_ID + " instance");
+ }
+
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.WF_EXECUTOR);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.USER_TO);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.STORE_PASSWORD);
+
+ User user = engine.getRuntimeService().
+ getVariable(procInst.getProcessInstanceId(), FlowableRuntimeUtils.USER, User.class);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.USER);
+
+ Boolean updatedEnabled = engine.getRuntimeService().
+ getVariable(procInst.getProcessInstanceId(), FlowableRuntimeUtils.ENABLED, Boolean.class);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.ENABLED);
+ if (updatedEnabled != null) {
+ user.setSuspended(!updatedEnabled);
+ }
+
+ // this will make UserValidator not to consider password policies at all
+ if (disablePwdPolicyCheck) {
+ user.removeClearPassword();
+ }
+
+ FlowableRuntimeUtils.updateStatus(engine, procInst.getProcessInstanceId(), user);
+ User created = userDAO.save(user);
+
+ engine.getRuntimeService().updateBusinessKey(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.getWFProcBusinessKey(created.getKey()));
+
+ Boolean propagateEnable = engine.getRuntimeService().getVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.class);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.PROPAGATE_ENABLE);
+ if (propagateEnable == null) {
+ propagateEnable = enabled;
+ }
+
+ PropagationByResource propByRes = new PropagationByResource();
+ propByRes.set(ResourceOperation.CREATE, userDAO.findAllResourceKeys(created.getKey()));
+
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInst.getProcessInstanceId(),
+ created,
+ dataBinder.getUserTO(created, true),
+ userTO.getPassword(),
+ enabled,
+ propByRes);
+
+ Set<String> tasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInst.getProcessInstanceId(), user);
+
+ return new WorkflowResult<>(Pair.of(created.getKey(), propagateEnable), propByRes, tasks);
+ }
+
+ protected Set<String> doExecuteNextTask(
+ final String procInstID,
+ final User user,
+ final Map<String, Object> moreVariables) {
+
+ Set<String> preTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+
+ Map<String, Object> variables = new HashMap<>();
+ variables.put(FlowableRuntimeUtils.WF_EXECUTOR, AuthContextUtils.getUsername());
+ variables.put(FlowableRuntimeUtils.USER, lazyLoad(user));
+
+ if (moreVariables != null && !moreVariables.isEmpty()) {
+ variables.putAll(moreVariables);
+ }
+
+ List<Task> tasks = FlowableRuntimeUtils.createTaskQuery(engine, false).processInstanceId(procInstID).list();
+ String task = null;
+ if (tasks.size() == 1) {
+ try {
+ engine.getTaskService().complete(tasks.get(0).getId(), variables);
+ task = tasks.get(0).getTaskDefinitionKey();
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(
+ e, "While completing task '" + tasks.get(0).getName() + "' for " + user);
+ }
+ } else {
+ LOG.warn("Expected a single task, found {}", tasks.size());
+ }
+
+ Set<String> postTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+ postTasks.removeAll(preTasks);
+ if (task != null) {
+ postTasks.add(task);
+ }
+
+ return postTasks;
+ }
+
+ @Override
+ protected WorkflowResult<String> doActivate(final User user, final String token) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Map<String, Object> variables = new HashMap<>(2);
+ variables.put(FlowableRuntimeUtils.TOKEN, token);
+ variables.put(FlowableRuntimeUtils.TASK, "activate");
+
+ Set<String> tasks = doExecuteNextTask(procInstID, user, variables);
+
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ User updated = userDAO.save(user);
+
+ variables.keySet().forEach(key -> engine.getRuntimeService().removeVariable(procInstID, key));
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ return new WorkflowResult<>(updated.getKey(), null, tasks);
+ }
+
+ @Override
+ protected WorkflowResult<Pair<UserPatch, Boolean>> doUpdate(final User user, final UserPatch userPatch) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ // save some existing variable values for later processing, after actual update is made
+ UserPatch patchBeforeUpdate = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ PropagationByResource propByResBeforeUpdate = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+
+ // whether the initial status is a form task
+ boolean inFormTask = FlowableRuntimeUtils.getFormTask(engine, procInstID) != null;
+
+ Map<String, Object> variables = new HashMap<>(2);
+ variables.put(FlowableRuntimeUtils.USER_PATCH, userPatch);
+ variables.put(FlowableRuntimeUtils.TASK, "update");
+
+ Set<String> tasks = doExecuteNextTask(procInstID, user, variables);
+
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ User updated = userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+
+ // if the original status was a form task, restore the patch as before the process started
+ if (inFormTask) {
+ if (patchBeforeUpdate == null) {
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ } else {
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, patchBeforeUpdate);
+ }
+ }
+
+ // whether the after status is a form task
+ inFormTask = FlowableRuntimeUtils.getFormTask(engine, procInstID) != null;
+ if (!inFormTask) {
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ }
+
+ PropagationByResource propByRes = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE);
+
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ updated,
+ dataBinder.getUserTO(updated, true),
+ userPatch.getPassword() == null ? null : userPatch.getPassword().getValue(),
+ null,
+ propByResBeforeUpdate == null ? propByRes : propByResBeforeUpdate);
+
+ Boolean propagateEnable = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE);
+
+ return new WorkflowResult<>(Pair.of(userPatch, propagateEnable), propByRes, tasks);
+ }
+
+ @Override
+ protected WorkflowResult<String> doSuspend(final User user) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Set<String> performedTasks =
+ doExecuteNextTask(procInstID, user, Collections.singletonMap(FlowableRuntimeUtils.TASK, "suspend"));
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ User updated = userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ return new WorkflowResult<>(updated.getKey(), null, performedTasks);
+ }
+
+ @Override
+ protected WorkflowResult<String> doReactivate(final User user) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Set<String> performedTasks =
+ doExecuteNextTask(procInstID, user, Collections.singletonMap(FlowableRuntimeUtils.TASK, "reactivate"));
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+
+ User updated = userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ return new WorkflowResult<>(updated.getKey(), null, performedTasks);
+ }
+
+ @Override
+ protected void doRequestPasswordReset(final User user) {
+ Map<String, Object> variables = new HashMap<>(3);
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ variables.put(FlowableRuntimeUtils.TASK, "requestPasswordReset");
+ variables.put(FlowableRuntimeUtils.EVENT, "requestPasswordReset");
+
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ doExecuteNextTask(procInstID, user, variables);
+ userDAO.save(user);
+
+ variables.keySet().forEach(key -> engine.getRuntimeService().removeVariable(procInstID, key));
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+ }
+
+ @Override
+ protected WorkflowResult<Pair<UserPatch, Boolean>> doConfirmPasswordReset(
+ final User user, final String token, final String password) {
+
+ Map<String, Object> variables = new HashMap<>(5);
+ variables.put(FlowableRuntimeUtils.TOKEN, token);
+ variables.put(FlowableRuntimeUtils.PASSWORD, password);
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ variables.put(FlowableRuntimeUtils.TASK, "confirmPasswordReset");
+ variables.put(FlowableRuntimeUtils.EVENT, "confirmPasswordReset");
+
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Set<String> tasks = doExecuteNextTask(procInstID, user, variables);
+
+ userDAO.save(user);
+
+ variables.keySet().forEach(key -> engine.getRuntimeService().removeVariable(procInstID, key));
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ PropagationByResource propByRes = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE);
+ UserPatch updatedPatch = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ Boolean propagateEnable = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE);
+
+ return new WorkflowResult<>(Pair.of(updatedPatch, propagateEnable), propByRes, tasks);
+ }
+
+ @Override
+ protected void doDelete(final User user) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ doExecuteNextTask(procInstID, user, Collections.singletonMap(FlowableRuntimeUtils.TASK, "delete"));
+
+ PropagationByResource propByRes = new PropagationByResource();
+ propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceKeys(user.getKey()));
+
+ if (engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceId(procInstID).active().list().isEmpty()) {
+
+ userDAO.delete(user.getKey());
+
+ if (!engine.getHistoryService().createHistoricProcessInstanceQuery().
+ processInstanceId(procInstID).list().isEmpty()) {
+
+ engine.getHistoryService().deleteHistoricProcessInstance(procInstID);
+ }
+ } else {
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ user,
+ dataBinder.getUserTO(user, true),
+ null,
+ null,
+ propByRes);
+
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+ }
+ }
+
+ @Override
+ public WorkflowResult<String> executeNextTask(final WorkflowTaskExecInput workflowTaskExecInput) {
+ User user = userDAO.authFind(workflowTaskExecInput.getUserKey());
+
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Map<String, Object> variables = new HashMap<>();
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ variables.putAll(workflowTaskExecInput.getVariables());
+
+ Set<String> performedTasks = doExecuteNextTask(procInstID, user, variables);
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ user = userDAO.save(user);
+
+ engine.getRuntimeService().setVariable(
+ procInstID, FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+
+ if (engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceId(procInstID).active().list().isEmpty()) {
+
+ userDAO.delete(user.getKey());
+
+ if (!engine.getHistoryService().createHistoricProcessInstanceQuery().
+ processInstanceId(procInstID).list().isEmpty()) {
+
+ engine.getHistoryService().deleteHistoricProcessInstance(procInstID);
+ }
+ } else {
+ PropagationByResource propByRes = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ user,
+ dataBinder.getUserTO(user, true),
+ null,
+ null,
+ propByRes);
+ }
+
+ return new WorkflowResult<>(user.getKey(), null, performedTasks);
+ }
+
+ protected void navigateAvailableTasks(final FlowElement flow, final List<String> availableTasks) {
+ if (flow instanceof Gateway) {
+ ((Gateway) flow).getOutgoingFlows().forEach(subflow -> navigateAvailableTasks(subflow, availableTasks));
+ } else if (flow instanceof SequenceFlow) {
+ navigateAvailableTasks(((SequenceFlow) flow).getTargetFlowElement(), availableTasks);
+ } else if (flow instanceof org.flowable.bpmn.model.Task) {
+ availableTasks.add(flow.getId());
+ } else {
+ LOG.debug("Unexpected flow found: {}", flow);
+ }
+ }
+
+ @Override
+ public List<WorkflowTask> getAvailableTasks(final String userKey) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, userKey);
+
+ List<String> availableTasks = new ArrayList<>();
+ try {
+ Task currentTask = FlowableRuntimeUtils.createTaskQuery(engine, false).
+ processInstanceId(procInstID).singleResult();
+
+ Process process = engine.getRepositoryService().
+ getBpmnModel(FlowableRuntimeUtils.getLatestProcDefByKey(
+ engine, FlowableRuntimeUtils.WF_PROCESS_ID).getId()).getProcesses().get(0);
+ process.getFlowElements().stream().
+ filter(SequenceFlow.class::isInstance).
+ map(SequenceFlow.class::cast).
+ filter(sequenceFlow -> sequenceFlow.getSourceRef().equals(currentTask.getTaskDefinitionKey())).
+ forEach(sequenceFlow -> {
+ navigateAvailableTasks(sequenceFlow.getTargetFlowElement(), availableTasks);
+ });
+ } catch (FlowableException e) {
+ throw new WorkflowException(
+ "While reading available tasks for workflow instance " + procInstID, e);
+ }
+
+ return availableTasks.stream().map(input -> {
+ WorkflowTask workflowTaskTO = new WorkflowTask();
+ workflowTaskTO.setName(input);
+ return workflowTaskTO;
+ }).collect(Collectors.toList());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java
new file mode 100644
index 0000000..d5fcd41
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java
@@ -0,0 +1,47 @@
+/*
+ * 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.flowable.impl;
+
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+public class FlowableWorkflowUtils {
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ @Transactional(readOnly = true)
+ public boolean isUserIngroup(final UserTO user, final String groupName) {
+ return user.getMemberships().stream().
+ anyMatch(membership -> groupName != null && groupName.equals(membership.getGroupName()));
+ }
+
+ public void setUserWorkflowVariable(final String variableName, final Object value, final User user) {
+ engine.getRuntimeService().
+ setVariable(FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey()), variableName, value);
+ }
+
+ public Object getUserWorkflowVariable(final String variableName, final User user) {
+ return engine.getRuntimeService().
+ getVariable(FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey()), variableName);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java
new file mode 100644
index 0000000..eb36838
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java
@@ -0,0 +1,49 @@
+/*
+ * 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.flowable.impl;
+
+import org.flowable.common.engine.impl.interceptor.CommandExecutor;
+import org.flowable.task.api.TaskQuery;
+import org.flowable.task.service.impl.TaskQueryImpl;
+
+public class SyncopeTaskQueryImpl extends TaskQueryImpl {
+
+ private static final long serialVersionUID = 734215641378485689L;
+
+ protected boolean withFormKey;
+
+ protected SyncopeTaskQueryImpl currentOrQueryObject;
+
+ public SyncopeTaskQueryImpl(final CommandExecutor commandExecutor) {
+ super(commandExecutor);
+ }
+
+ public TaskQuery taskWithFormKey() {
+ if (orActive) {
+ currentOrQueryObject.withFormKey = true;
+ } else {
+ this.withFormKey = true;
+ }
+ return this;
+ }
+
+ public boolean isWithFormKey() {
+ return withFormKey;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java
new file mode 100644
index 0000000..1b056c1
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java
@@ -0,0 +1,114 @@
+/*
+ * 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.flowable.support;
+
+import java.util.Collections;
+import java.util.Map;
+import javax.sql.DataSource;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.flowable.engine.DynamicBpmnService;
+import org.flowable.engine.FormService;
+import org.flowable.engine.HistoryService;
+import org.flowable.engine.IdentityService;
+import org.flowable.engine.ManagementService;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.engine.ProcessEngineConfiguration;
+import org.flowable.engine.RepositoryService;
+import org.flowable.engine.RuntimeService;
+import org.flowable.engine.TaskService;
+import org.flowable.engine.impl.ProcessEngineImpl;
+
+/**
+ * {@link ProcessEngine} delegating actual method invocation to the inner map of {@link ProcessEngine} instances,
+ * one for each Syncope domain.
+ */
+public class DomainProcessEngine implements ProcessEngine {
+
+ private final Map<String, ProcessEngine> engines;
+
+ public DomainProcessEngine(final Map<String, ProcessEngine> engines) {
+ this.engines = Collections.synchronizedMap(engines);
+ }
+
+ public Map<String, ProcessEngine> getEngines() {
+ return engines;
+ }
+
+ @Override
+ public String getName() {
+ return engines.get(AuthContextUtils.getDomain()).getName();
+ }
+
+ @Override
+ public void close() {
+ engines.values().forEach(engine -> {
+ engine.close();
+ });
+ }
+
+ @Override
+ public RepositoryService getRepositoryService() {
+ return engines.get(AuthContextUtils.getDomain()).getRepositoryService();
+ }
+
+ @Override
+ public RuntimeService getRuntimeService() {
+ return engines.get(AuthContextUtils.getDomain()).getRuntimeService();
+ }
+
+ @Override
+ public FormService getFormService() {
+ return engines.get(AuthContextUtils.getDomain()).getFormService();
+ }
+
+ @Override
+ public TaskService getTaskService() {
+ return engines.get(AuthContextUtils.getDomain()).getTaskService();
+ }
+
+ @Override
+ public HistoryService getHistoryService() {
+ return engines.get(AuthContextUtils.getDomain()).getHistoryService();
+ }
+
+ @Override
+ public IdentityService getIdentityService() {
+ return engines.get(AuthContextUtils.getDomain()).getIdentityService();
+ }
+
+ @Override
+ public ManagementService getManagementService() {
+ return engines.get(AuthContextUtils.getDomain()).getManagementService();
+ }
+
+ @Override
+ public ProcessEngineConfiguration getProcessEngineConfiguration() {
+ return engines.get(AuthContextUtils.getDomain()).getProcessEngineConfiguration();
+ }
+
+ @Override
+ public DynamicBpmnService getDynamicBpmnService() {
+ return engines.get(AuthContextUtils.getDomain()).getDynamicBpmnService();
+ }
+
+ public DataSource getDataSource() {
+ ProcessEngineImpl engine = (ProcessEngineImpl) engines.get(AuthContextUtils.getDomain());
+ return engine.getProcessEngineConfiguration().getDataSource();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java
new file mode 100644
index 0000000..d1c3299
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java
@@ -0,0 +1,32 @@
+/*
+ * 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.flowable.support;
+
+import java.io.InputStream;
+import org.flowable.spring.SpringProcessEngineConfiguration;
+
+public class DomainProcessEngineConfiguration extends SpringProcessEngineConfiguration {
+
+ private static final String SYNCOPE_MYBATIS_MAPPING_FILE = "org/apache/syncope/ext/flowable/mappings.xml";
+
+ @Override
+ public InputStream getMyBatisXmlConfigurationStream() {
+ return getResourceAsStream(SYNCOPE_MYBATIS_MAPPING_FILE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
new file mode 100644
index 0000000..162b113
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
@@ -0,0 +1,112 @@
+/*
+ * 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.flowable.support;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.DataSource;
+import org.apache.commons.lang3.StringUtils;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.common.engine.impl.cfg.SpringBeanFactoryProxyMap;
+import org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants;
+import org.flowable.engine.impl.util.EngineServiceUtil;
+import org.flowable.idm.spring.SpringIdmEngineConfiguration;
+import org.flowable.spring.SpringExpressionManager;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.PlatformTransactionManager;
+
+/**
+ * Spring factory for {@link DomainProcessEngine} which takes the provided {@link DomainProcessEngineConfiguration} as
+ * template for each of the configured Syncope domains.
+ */
+@Component
+public class DomainProcessEngineFactoryBean
+ implements FactoryBean<DomainProcessEngine>, DisposableBean, ApplicationContextAware {
+
+ private ApplicationContext ctx;
+
+ private DomainProcessEngine engine;
+
+ @Override
+ public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
+ this.ctx = ctx;
+ }
+
+ @Override
+ public DomainProcessEngine getObject() throws Exception {
+ if (engine == null) {
+ Map<String, ProcessEngine> engines = new HashMap<>();
+
+ ctx.getBeansOfType(DataSource.class).forEach((key, dataSource) -> {
+ if (!key.startsWith("local")) {
+ String domain = StringUtils.substringBefore(key, DataSource.class.getSimpleName());
+ PlatformTransactionManager transactionManager = ctx.getBean(
+ domain + "TransactionManager", PlatformTransactionManager.class);
+ Object entityManagerFactory = ctx.getBean(domain + "EntityManagerFactory");
+
+ DomainProcessEngineConfiguration conf = ctx.getBean(DomainProcessEngineConfiguration.class);
+ conf.setDataSource(dataSource);
+ conf.setTransactionManager(transactionManager);
+ conf.setTransactionsExternallyManaged(true);
+ conf.setJpaEntityManagerFactory(entityManagerFactory);
+ if (conf.getBeans() == null) {
+ conf.setBeans(new SpringBeanFactoryProxyMap(ctx));
+ }
+ if (conf.getExpressionManager() == null) {
+ conf.setExpressionManager(new SpringExpressionManager(ctx, conf.getBeans()));
+ }
+ if (EngineServiceUtil.getIdmEngineConfiguration(conf) == null) {
+ conf.addEngineConfiguration(
+ EngineConfigurationConstants.KEY_IDM_ENGINE_CONFIG,
+ ctx.getBean(SpringIdmEngineConfiguration.class));
+ }
+
+ engines.put(domain, conf.buildProcessEngine());
+ }
+ });
+
+ engine = new DomainProcessEngine(engines);
+ }
+
+ return engine;
+ }
+
+ @Override
+ public Class<DomainProcessEngine> getObjectType() {
+ return DomainProcessEngine.class;
+ }
+
+ @Override
+ public boolean isSingleton() {
+ return true;
+ }
+
+ @Override
+ public void destroy() throws Exception {
+ if (engine != null) {
+ engine.close();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java
new file mode 100644
index 0000000..9009abb
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java
@@ -0,0 +1,35 @@
+/*
+ * 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.flowable.support;
+
+import org.apache.syncope.core.persistence.api.entity.Entity;
+import org.flowable.variable.service.impl.types.SerializableType;
+
+/**
+ * Flowable variable type for handling Syncope entities as Flowable variables.
+ * Main purpose: avoid Flowable to handle Syncope entities as JPA entities,
+ * since this can cause troubles with transactions.
+ */
+public class SyncopeEntitiesVariableType extends SerializableType {
+
+ @Override
+ public boolean isAbleToStore(final Object value) {
+ return value instanceof Entity;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java
new file mode 100644
index 0000000..e7437dd
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java
@@ -0,0 +1,89 @@
+/*
+ * 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.flowable.support;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.syncope.core.persistence.api.dao.GroupDAO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.flowable.idm.api.Group;
+import org.flowable.idm.engine.impl.GroupQueryImpl;
+import org.flowable.idm.engine.impl.persistence.entity.GroupEntity;
+import org.flowable.idm.engine.impl.persistence.entity.GroupEntityImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+public class SyncopeGroupQueryImpl extends GroupQueryImpl {
+
+ private static final long serialVersionUID = -2595069675443343682L;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Autowired
+ private GroupDAO groupDAO;
+
+ private List<Group> result;
+
+ private Group fromSyncopeGroup(final String name) {
+ GroupEntity group = new GroupEntityImpl();
+ group.setId(name);
+ return group;
+ }
+
+ private void execute() {
+ if (id != null) {
+ org.apache.syncope.core.persistence.api.entity.group.Group syncopeGroup = groupDAO.findByName(id);
+ if (syncopeGroup == null) {
+ result = Collections.emptyList();
+ } else {
+ result = Collections.singletonList(fromSyncopeGroup(syncopeGroup.getName()));
+ }
+ } else if (userId != null) {
+ result = userDAO.findAllGroupNames(userDAO.findByUsername(userId)).stream().
+ map(groupName -> fromSyncopeGroup(groupName)).
+ collect(Collectors.toList());
+ }
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public long count() {
+ checkQueryOk();
+
+ this.resultType = ResultType.COUNT;
+ if (result == null) {
+ execute();
+ }
+ return result.size();
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public List<Group> list() {
+ checkQueryOk();
+
+ this.resultType = ResultType.LIST;
+ if (result == null) {
+ execute();
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.java
new file mode 100644
index 0000000..6b9c4f6
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.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.core.flowable.support;
+
+import org.flowable.idm.api.GroupQuery;
+import org.flowable.idm.api.UserQuery;
+import org.flowable.idm.engine.impl.IdmIdentityServiceImpl;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ConfigurableApplicationContext;
+
+public class SyncopeIdmIdentityService extends IdmIdentityServiceImpl implements ApplicationContextAware {
+
+ private ConfigurableApplicationContext ctx;
+
+ @Override
+ public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
+ this.ctx = (ConfigurableApplicationContext) ctx;
+ }
+
+ @Override
+ public UserQuery createUserQuery() {
+ return (UserQuery) ctx.getBeanFactory().
+ createBean(SyncopeUserQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+ }
+
+ @Override
+ public GroupQuery createGroupQuery() {
+ return (GroupQuery) ctx.getBeanFactory().
+ createBean(SyncopeGroupQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java
new file mode 100644
index 0000000..56e6c88
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java
@@ -0,0 +1,26 @@
+/*
+ * 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.flowable.support;
+
+import org.flowable.common.engine.impl.interceptor.Session;
+
+public interface SyncopeSession extends Session {
+
+ Class<?> getType();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java
new file mode 100644
index 0000000..0c1789b
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java
@@ -0,0 +1,46 @@
+/*
+ * 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.flowable.support;
+
+import org.flowable.common.engine.impl.interceptor.CommandContext;
+import org.flowable.common.engine.impl.interceptor.Session;
+import org.flowable.common.engine.impl.interceptor.SessionFactory;
+
+public class SyncopeSessionFactory implements SessionFactory {
+
+ private SyncopeSession syncopeSession;
+
+ @Override
+ public Class<?> getSessionType() {
+ return syncopeSession.getType();
+ }
+
+ @Override
+ public Session openSession(final CommandContext cc) {
+ return syncopeSession;
+ }
+
+ public SyncopeSession getSyncopeSession() {
+ return syncopeSession;
+ }
+
+ public void setSyncopeSession(final SyncopeSession syncopeSession) {
+ this.syncopeSession = syncopeSession;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java
new file mode 100644
index 0000000..25d9ab5
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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.flowable.support;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.core.persistence.api.dao.GroupDAO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.group.Group;
+import org.apache.syncope.core.persistence.api.entity.user.UMembership;
+import org.flowable.idm.api.User;
+import org.flowable.idm.engine.impl.UserQueryImpl;
+import org.flowable.idm.engine.impl.persistence.entity.UserEntity;
+import org.flowable.idm.engine.impl.persistence.entity.UserEntityImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+public class SyncopeUserQueryImpl extends UserQueryImpl {
+
+ private static final long serialVersionUID = 4403344392227706318L;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Autowired
+ private GroupDAO groupDAO;
+
+ private List<User> result;
+
+ private User fromSyncopeUser(final org.apache.syncope.core.persistence.api.entity.user.User syncopeUser) {
+ UserEntity user = new UserEntityImpl();
+ user.setId(syncopeUser.getUsername());
+ return user;
+ }
+
+ private void execute() {
+ if (id != null) {
+ org.apache.syncope.core.persistence.api.entity.user.User user = userDAO.findByUsername(id);
+ if (user == null) {
+ result = Collections.<User>emptyList();
+ } else if (groupId == null || userDAO.findAllGroupNames(user).contains(groupId)) {
+ result = Collections.singletonList(fromSyncopeUser(user));
+ }
+ } else if (groupId != null) {
+ Group group = groupDAO.findByName(groupId);
+ if (group == null) {
+ result = Collections.<User>emptyList();
+ } else {
+ result = new ArrayList<>();
+ List<UMembership> memberships = groupDAO.findUMemberships(group);
+ memberships.stream().map(membership -> fromSyncopeUser(membership.getLeftEnd())).
+ filter(user -> (!result.contains(user))).
+ forEachOrdered(user -> {
+ result.add(user);
+ });
+ }
+ }
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public long count() {
+ checkQueryOk();
+
+ this.resultType = ResultType.COUNT;
+ if (result == null) {
+ execute();
+ }
+ return result.size();
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public List<User> list() {
+ checkQueryOk();
+
+ this.resultType = ResultType.LIST;
+ if (result == null) {
+ execute();
+ }
+ return result;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java
new file mode 100644
index 0000000..692a161
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java
@@ -0,0 +1,45 @@
+/*
+ * 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.flowable.task;
+
+import org.flowable.engine.ProcessEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Abstract base class for Flowable's service tasks in Syncope, with Spring support.
+ */
+@Component
+public abstract class AbstractFlowableServiceTask {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractFlowableServiceTask.class);
+
+ @Autowired
+ protected ProcessEngine engine;
+
+ @Transactional(rollbackFor = { Throwable.class })
+ public void execute(final String executionId) {
+ doExecute(executionId);
+ }
+
+ protected abstract void doExecute(final String executionId);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java
new file mode 100644
index 0000000..3febfa0
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java
@@ -0,0 +1,60 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.AnyOperations;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AutoActivate extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+ UserTO userTO = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_TO, UserTO.class);
+ if (userTO != null && userTO.getKey() != null && user.getKey() != null) {
+ user = userDAO.save(user);
+
+ UserPatch userPatch = AnyOperations.diff(userTO, dataBinder.getUserTO(user, true), false);
+ // don't mess with password, as the cleartext values was already properly saved
+ userPatch.setPassword(null);
+
+ dataBinder.update(user, userPatch);
+
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ }
+
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.TRUE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java
new file mode 100644
index 0000000..75bf0ac
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java
@@ -0,0 +1,55 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.persistence.api.entity.EntityFactory;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Create extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private EntityFactory entityFactory;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ UserTO userTO = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_TO, UserTO.class);
+ Boolean storePassword = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.STORE_PASSWORD, Boolean.class);
+
+ // create user
+ User user = entityFactory.newEntity(User.class);
+ dataBinder.create(user, userTO, storePassword == null ? true : storePassword);
+
+ // report user as result
+ engine.getRuntimeService().
+ setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().
+ setVariable(executionId, FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java
new file mode 100644
index 0000000..7f3acf6
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java
@@ -0,0 +1,41 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Delete extends AbstractFlowableServiceTask {
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ // Do something with user...
+ if (user != null) {
+ user.checkToken("");
+ }
+
+ // remove user variable
+ engine.getRuntimeService().removeVariable(executionId, FlowableRuntimeUtils.USER);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java
new file mode 100644
index 0000000..aee2b73
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java
@@ -0,0 +1,44 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.core.persistence.api.dao.ConfDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class GenerateToken extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private ConfDAO confDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ user.generateToken(
+ confDAO.find("token.length", 256L).intValue(),
+ confDAO.find("token.expireTime", 60L).intValue());
+
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java
new file mode 100644
index 0000000..d64032f
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java
@@ -0,0 +1,64 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AuditElements;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.notification.NotificationManager;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * General-purpose notification task for usage within workflow.
+ * It requires a pre-existing Notification with category {@code CUSTOM} and result {@code SUCCESS}.
+ * An {@code event} workflow variable needs to be provided as well.
+ */
+@Component
+public class Notify extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private NotificationManager notificationManager;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+ UserTO userTO = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_TO, UserTO.class);
+ String event = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.EVENT, String.class);
+
+ if (StringUtils.isNotBlank(event)) {
+ notificationManager.createTasks(
+ AuditElements.EventCategoryType.CUSTOM,
+ null,
+ null,
+ event,
+ AuditElements.Result.SUCCESS,
+ userTO,
+ null,
+ user.getToken());
+ } else {
+ LOG.debug("Not sending any notification since no event was found");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java
new file mode 100644
index 0000000..1c36202
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java
@@ -0,0 +1,70 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.patch.PasswordPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class PasswordReset extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+ String token = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.TOKEN, String.class);
+ String password = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.PASSWORD, String.class);
+
+ if (!user.checkToken(token)) {
+ throw new WorkflowException(new IllegalArgumentException("Wrong token: " + token + " for " + user));
+ }
+
+ user.removeToken();
+
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(user.getKey());
+ userPatch.setPassword(new PasswordPatch.Builder().
+ onSyncope(true).
+ resources(userDAO.findAllResourceKeys(user.getKey())).
+ value(password).build());
+
+ PropagationByResource propByRes = dataBinder.update(user, userPatch);
+
+ // report updated user and propagation by resource as result
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER_PATCH, userPatch);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java
new file mode 100644
index 0000000..d6b2c27
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java
@@ -0,0 +1,29 @@
+/*
+ * 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.flowable.task;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class Reactivate extends AbstractFlowableServiceTask {
+
+ @Override
+ protected void doExecute(final String executionId) {
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java
new file mode 100644
index 0000000..8e9439b
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java
@@ -0,0 +1,29 @@
+/*
+ * 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.flowable.task;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class Suspend extends AbstractFlowableServiceTask {
+
+ @Override
+ protected void doExecute(final String executionId) {
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java
new file mode 100644
index 0000000..c7007ad
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java
@@ -0,0 +1,58 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Update extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ UserPatch userPatch = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ if (userPatch == null || userPatch.isEmpty()) {
+ LOG.warn("No actual update is to be performed: null patch");
+ } else {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ user = userDAO.save(user);
+
+ PropagationByResource propByRes = dataBinder.update(user, userPatch);
+
+ // report updated user and propagation by resource as result
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ }
+ }
+}
[09/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
new file mode 100644
index 0000000..5a9cc2d
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.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.
+userDetails=\u30e6\u30fc\u30b6\u30fc\u8a73\u7d30
+userForm=\u30e6\u30fc\u30b6\u30fc\u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
new file mode 100644
index 0000000..00a8971
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.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.
+userDetails=Detalhes do Usu\u00e1rio
+userForm=Detalhes do Usu\u00e1rio
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
new file mode 100644
index 0000000..02c159a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.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.
+#
+# userDetails=\u00d0\u0098\u00d0\u00bd\u00d1\u0084\u00d0\u00be\u00d1\u0080\u00d0\u00bc\u00d0\u00b0\u00d1\u0086\u00d0\u00b8\u00d1\u008f \u00d0\u00be \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5
+userDetails=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
+userForm=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
new file mode 100644
index 0000000..5bf6234
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <section class="content-header">
+ <h1> </h1>
+ <ol class="breadcrumb">
+ <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard">[DASHBOARD]</wicket:message></a></li>
+ <li class="active"><wicket:message key="approvals"/></li>
+ </ol>
+ </section>
+
+ <section class="content" wicket:id="content">
+ <div class="box">
+ <div class="box-body" wicket:id="wfPanel"/>
+ </div>
+ </section>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
new file mode 100644
index 0000000..1ea8063
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=Task
+key=Key
+description=Description
+createTime=Create Time
+dueDate=Due Date
+owner=Owner
+claim=Claim
+manage=Manage
+approvals=Approvals
+delete=Delete
+type=Type
+username=Username
+new_user=New User
+creationDate = Creation Date
+claimDate = Claim Dare
+approval.edit=Approval Edit
+approval.manage=Approval Manage
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
new file mode 100644
index 0000000..7e12ce5
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=Task
+key=Chiave
+description=Descrizione
+createTime=Data di creazione
+dueDate=Scadenza
+owner=Esecutore
+claim=Richiedi
+manage=Gestisci
+approvals=Approvazioni
+delete=Rimuovi
+type=Tipo
+username=Utente
+new_user=Nuovo utente
+creationDate = Data creazione
+claimDate = Data rivendicazione
+approval.manage=Gestisci Approvazione
+approval.edit=Modifica Approvazione
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
new file mode 100644
index 0000000..b2ff626
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=\u30bf\u30b9\u30af
+key=\u30ad\u30fc
+description=\u8aac\u660e
+createTime=\u4f5c\u6210\u6642\u523b
+dueDate=\u671f\u9650
+owner=\u30aa\u30fc\u30ca\u30fc
+claim=\u7533\u8acb
+manage=\u7ba1\u7406
+approvals=\u627f\u8a8d
+delete=\u524a\u9664
+type=\u30bf\u30a4\u30d7
+username=\u30e6\u30fc\u30b6\u30fc\u540d
+new_user=\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc
+creationDate = \u4f5c\u6210\u65e5
+claimDate = \u7533\u8acb\u65e5
+approval.edit=\u627f\u8a8d \u7de8\u96c6
+approval.manage=\u627f\u8a8d \u7ba1\u7406
+any.edit=${anyTO.type} ${anyTO.username} \u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
new file mode 100644
index 0000000..e5ff74c
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
@@ -0,0 +1,34 @@
+# 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.
+taskId=Tarefa
+key=Chave
+description=Descri\u00e7\u00e3o
+createTime=Tempo de Cria\u00e7\u00e3o
+dueDate=Data acordada
+owner=Propriet\u00e1rio
+claim=Requerimento
+manage=Ger\u00eancia
+approvals=Aprova\u00e7\u00f5es
+delete=Excluir
+type=Tipo
+username=Usu\u00e1rio
+new_user=Novo Usu\u00e1rio
+creationDate = Data de cria\u00e7\u00e3o
+claimDate = Data de reivindica\u00e7\u00e3o
+approval.manage=Aprova\u00e7\u00e3o
+approval.edit=Aprova\u00e7\u00e3o
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
new file mode 100644
index 0000000..6f4fb58
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
@@ -0,0 +1,52 @@
+# 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.
+#
+# taskId=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b0
+taskId=\u0417\u0430\u044f\u0432\u043a\u0430
+# key=\u00d0\u0098\u00d0\u00b4\u00d0\u00b5\u00d0\u00bd\u00d1\u0082\u00d0\u00b8\u00d1\u0084\u00d0\u00b8\u00d0\u00ba\u00d0\u00b0\u00d1\u0082\u00d0\u00be\u00d1\u0080
+key=\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440
+# description=\u00d0\u009e\u00d0\u00bf\u00d0\u00b8\u00d1\u0081\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+description=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435
+# createTime=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
+createTime=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
+# dueDate=\u00d0\u00a1\u00d1\u0080\u00d0\u00be\u00d0\u00ba
+dueDate=\u0421\u0440\u043e\u043a
+# owner=\u00d0\u0092\u00d0\u00bb\u00d0\u00b0\u00d0\u00b4\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5\u00d1\u0086
+owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
+# claim=\u00d0\u0092\u00d1\u008b\u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d0\u00bd\u00d0\u00b8\u00d1\u0082\u00d1\u008c \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+claim=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
+# manage=\u00d0\u00a3\u00d0\u00bf\u00d1\u0080\u00d0\u00b0\u00d0\u00b2\u00d0\u00bb\u00d0\u00b5\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+manage=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435
+# approvals=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b8
+approvals=\u0417\u0430\u044f\u0432\u043a\u0438
+# delete=\u00d0\u00a3\u00d0\u00b4\u00d0\u00b0\u00d0\u00bb\u00d0\u00b8\u00d1\u0082\u00d1\u008c
+delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c
+# type=\u00d0\u00a2\u00d0\u00b8\u00d0\u00bf
+type=\u0422\u0438\u043f
+# username=\u00d0\u0098\u00d0\u00bc\u00d1\u008f \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
+username=\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
+# new_user=\u00d0\u00a1\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5 \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
+new_user=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
+# creationDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
+creationDate=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
+# claimDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d0\u00bd\u00d0\u00b0\u00d1\u0087\u00d0\u00b0\u00d0\u00bb\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
+claimDate=\u0414\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
+# approval.edit=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+approval.edit=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
+# approval.manage=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
+approval.manage=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
+any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html
new file mode 100644
index 0000000..b23fab0
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <section class="content-header">
+ <h1> </h1>
+ <ol class="breadcrumb">
+ <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard"/></a></li>
+ <li class="active"><wicket:message key="extensions"/></li>
+ <li class="active">Flowable</li>
+ </ol>
+ </section>
+
+ <section class="content" wicket:id="content">
+ <span wicket:id="disabled"><i><wicket:message key="disabled"/></i></span>
+ <div class="box">
+ <div class="box-body" wicket:id="bpmnProcessesPanel"/>
+ </div>
+ </section>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.properties
new file mode 100644
index 0000000..5b088d6
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable.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.
+xmlEditorTitle=Workflow XML Editor
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
new file mode 100644
index 0000000..e1afe72
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html>
+ <head>
+ <title>Apache Syncope / Flowable Modeler</title>
+
+ <meta http-equiv="refresh" content="0; url=../../flowable-modeler/modeler.html"/>
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.properties
new file mode 100644
index 0000000..37fd859
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_it.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.
+xmlEditorTitle=Workflow XML Editor
+userWorkflow=Workflow utenti
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.properties
new file mode 100644
index 0000000..e811544
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ja.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.
+xmlEditorTitle=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc XML \u30a8\u30c7\u30a3\u30bf\u30fc
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.properties
new file mode 100644
index 0000000..5b088d6
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_pt_BR.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.
+xmlEditorTitle=Workflow XML Editor
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.properties
new file mode 100644
index 0000000..515fa3a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/pages/Flowable_ru.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.
+xmlEditorTitle=XML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
+userWorkflow=User workflow
+external_editor.title=Flowable Modeler
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html
new file mode 100644
index 0000000..a755298
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <span wicket:id="newBpmnProcess"/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html
new file mode 100644
index 0000000..6197d5a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/NewBpmnProcess.html
@@ -0,0 +1,32 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div id="startAtContainer">
+ <form wicket:id="form">
+ <div class="input-group">
+ <input wicket:id="key"/>
+ <div class="input-group-addon">
+ <a wicket:id="submit"><i class="fa fa-file-o" alt="new" title="new"></i></a>
+ </div>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
new file mode 100644
index 0000000..5943197
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
@@ -0,0 +1,49 @@
+<?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:flowable="http://flowable.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://www.flowable.org/processdef">
+
+ <process id="%KEY%" name="%KEY%" isExecutable="true">
+ <startEvent id="startevent1" name="Start"></startEvent>
+ <endEvent id="endevent1" name="End"></endEvent>
+ <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="endevent1"></sequenceFlow>
+ </process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
+ <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
+ <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+ <omgdc:Bounds height="35.0" width="35.0" x="180.0" y="110.0"></omgdc:Bounds>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+ <omgdc:Bounds height="35.0" width="35.0" x="460.0" y="110.0"></omgdc:Bounds>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="215.0" y="127.0"></omgdi:waypoint>
+ <omgdi:waypoint x="460.0" y="127.0"></omgdi:waypoint>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
new file mode 100644
index 0000000..dd5b98f
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=View all approvals
+duedate=Due date
+owner=Owner
+createApproval=Create Approval
+summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
new file mode 100644
index 0000000..7b2287e
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=Tutte le approvazioni
+duedate=Scadenza
+owner=Assegnato
+createApproval=Approvazione Creazione
+summary=${number} approvazioni pendenti
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
new file mode 100644
index 0000000..a6089eb
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=\u3059\u3079\u3066\u306e\u627f\u8a8d\u3092\u8868\u793a
+duedate=\u671f\u9650
+owner=\u30aa\u30fc\u30ca\u30fc
+createApproval=\u627f\u8a8d\u3092\u4f5c\u6210
+summary=${number} \u4fdd\u7559\u306e\u627f\u8a8d
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
new file mode 100644
index 0000000..c24f3d8
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
@@ -0,0 +1,21 @@
+# 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.
+alerts.view.all=View all Approvals
+duedate=Due date
+owner=Owner
+createApproval=Create Approval
+summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
new file mode 100644
index 0000000..10281ff
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
@@ -0,0 +1,22 @@
+# 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.
+#
+alerts.view.all=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u044f\u0432\u043a\u0438
+duedate=\u0421\u0440\u043e\u043a
+owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
+createApproval=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u044f\u0432\u043a\u0443
+summary=\u041e\u0436\u0438\u0434\u0430\u044e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f: ${number}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/save-model.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/save-model.html b/ext/flowable/client-console/src/main/resources/save-model.html
new file mode 100644
index 0000000..abd5ecf
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/save-model.html
@@ -0,0 +1,132 @@
+<!--
+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.
+-->
+<div class="modal" ng-controller="SaveModelCtrl">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h2>{{'MODEL.SAVE.TITLE'| translate}}</h2>
+ </div>
+ <div class="modal-body">
+ <div ng-if="saveDialog.errorMessage && saveDialog.errorMessage.length > 0" class="alert error" style="font-size: 14px; margin-top:20px">
+ <div class="popup-error" style="font-size: 14px">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ <span>{{saveDialog.errorMessage}}</span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label for="nameField">{{'MODEL.NAME'| translate}}</label>
+ <input type="text"
+ ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
+ id="nameField"
+ class="form-control"
+ ng-model="saveDialog.name" readonly="readonly"
+ auto-focus />
+ </div>
+ <div class="form-group" style="display: none">
+ <label for="keyField">{{'MODEL.KEY'| translate}}</label>
+ <input type="text"
+ ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
+ id="keyField"
+ class="form-control"
+ ng-model="saveDialog.key" ng-init="saveDialog.key = saveDialog.name"/>
+ </div>
+ <div class="form-group" style="display: none">
+ <label for="docTextArea">{{'MODEL.DESCRIPTION'| translate}}</label>
+ <textarea id="docTextArea" ng-disabled="status.loading" class="form-control" ng-model="saveDialog.description"></textarea>
+ </div>
+ <div class="checkbox" ng-show="!error && !error.isConflict" style="display: none">
+ <label>
+ <input type="checkbox" ng-disabled="status.loading" ng-model="saveDialog.newVersion" >
+ {{'MODEL.SAVE.NEWVERSION'| translate}}
+ </label>
+ </div>
+ <div class="form-group" ng-if="saveDialog.newVersion">
+ <label for="commentTextArea">{{'MODEL.SAVE.COMMENT'| translate}}</label>
+ <textarea id="commentTextArea" class="form-control" ng-model="saveDialog.comment" ng-disabled="status.loading"></textarea>
+ </div>
+
+ <div ng-if="saveDialog.validationErrors" class="alert error" style="font-size: 14px; margin-top:20px">
+
+ <div class="popup-error" style="font-size: 14px">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ <span>{{'MODEL.VALIDATIONERRORS'| translate:error}}</span>
+ </div>
+ </div>
+
+ <div ng-if="error && error.isConflict && !status.loading" class="alert error" style="font-size: 14px; margin-top:20px">
+
+ <div class="popup-error" style="font-size: 14px">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ <span>{{'MODEL.CONFLICT.WRITE'| translate:error}}</span>
+ </div>
+
+ <div>
+
+ <div style="font-size: 14px; margin-bottom: 10px">{{'MODEL.CONFLICT.WRITE.OPTIONS'| translate}}</div>
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'overwrite'">
+ <input type="radio" name="options" id="option1">
+ {{'MODEL.CONFLICT.WRITE.OPTION.OVERWRITE'| translate}}
+ </label>
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'discardChanges'">
+ <input type="radio" name="options" id="option2">
+ {{'MODEL.CONFLICT.WRITE.OPTION.DISCARDCHANGES'| translate}}
+ </label>
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'saveAs'">
+ <input type="radio" name="options" id="option3" ng-disabled="account.type != 'enterprise'">
+ {{'MODEL.CONFLICT.WRITE.OPTION.SAVEAS'| translate}}
+ </label>
+ <label class="btn btn-danger"
+ ng-click="error.conflictResolveAction = 'newVersion'">
+ <input type="radio" name="options" id="optio43">
+ {{'MODEL.CONFLICT.WRITE.OPTION.NEWVERSION'| translate}}
+ </label>
+ </div>
+
+ <div ng-if="error.conflictResolveAction == 'saveAs'" style="margin-top: 10px">
+ <span>{{'MODEL.CONFLICT.SAVEAS'| translate}}</span>
+ <input type="text" ng-model="error.saveAs" style="width: 300px" auto-focus>
+ </div>
+ </div>
+
+ </div>
+
+ </div>
+ <div class="modal-footer">
+
+ <div class="pull-right">
+ <button type="button" class="btn" ng-click="close()" ng-disabled="status.loading" translate>ACTION.CANCEL</button>
+ <button class="btn btn-primary" ng-click="saveAndClose()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" translate>ACTION.SAVE-AND-CLOSE</button>
+ <button class="btn btn-primary" ng-click="save()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" style="display: none" translate>ACTION.SAVE</button>
+ <button class="btn btn-primary" ng-click="okClicked()" ng-disabled="isOkButtonDisabled()" ng-show="error && error.isConflict" translate>ACTION.OK</button>
+ </div>
+
+ <div class="pull-right popup-error" ng-if="error && !error.isConflict">
+ <span>{{'MODEL.SAVE.ERROR'| translate}}</span>
+ </div>
+
+ <loading></loading>
+
+ </div>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/toolbar.js
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/toolbar.js b/ext/flowable/client-console/src/main/resources/toolbar.js
new file mode 100644
index 0000000..920718c
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/toolbar.js
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ */
+'use strict';
+
+var FLOWABLE = FLOWABLE || {};
+FLOWABLE.TOOLBAR_CONFIG = {
+ "items" : [
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "editor-icon editor-icon-save",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.saveModel"
+ },
+ {
+ "type" : "separator",
+ "title" : "",
+ "cssClass" : "toolbar-separator"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.CUT",
+ "cssClass" : "editor-icon editor-icon-cut",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.cut",
+ "enabled" : false,
+ "enabledAction" : "element"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.COPY",
+ "cssClass" : "editor-icon editor-icon-copy",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.copy",
+ "enabled" : false,
+ "enabledAction" : "element"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.PASTE",
+ "cssClass" : "editor-icon editor-icon-paste",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.paste",
+ "enabled" : false
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.DELETE",
+ "cssClass" : "editor-icon editor-icon-delete",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.deleteItem",
+ "enabled" : false,
+ "enabledAction" : "element"
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.REDO",
+ "cssClass" : "editor-icon editor-icon-redo",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.redo",
+ "enabled" : false
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.UNDO",
+ "cssClass" : "editor-icon editor-icon-undo",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.undo",
+ "enabled" : false
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ALIGNVERTICAL",
+ "cssClass" : "editor-icon editor-icon-align-vertical",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignVertical",
+ "enabled" : false,
+ "enabledAction" : "element",
+ "disableInForm" : true,
+ "minSelectionCount" : 2
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ALIGNHORIZONTAL",
+ "cssClass" : "editor-icon editor-icon-align-horizontal",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignHorizontal",
+ "enabledAction" : "element",
+ "enabled" : false,
+ "disableInForm" : true,
+ "minSelectionCount" : 2
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.SAMESIZE",
+ "cssClass" : "editor-icon editor-icon-same-size",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.sameSize",
+ "enabledAction" : "element",
+ "enabled" : false,
+ "disableInForm" : true,
+ "minSelectionCount" : 2
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator",
+ "disableInForm" : true
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMIN",
+ "cssClass" : "editor-icon editor-icon-zoom-in",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomIn"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMOUT",
+ "cssClass" : "editor-icon editor-icon-zoom-out",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomOut"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMACTUAL",
+ "cssClass" : "editor-icon editor-icon-zoom-actual",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomActual"
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.ZOOMFIT",
+ "cssClass" : "editor-icon editor-icon-zoom-fit",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomFit"
+ },
+ {
+ "type" : "separator",
+ "title" : "TOOLBAR.ACTION.SAVE",
+ "cssClass" : "toolbar-separator",
+ "disableInForm" : true
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.BENDPOINT.ADD",
+ "cssClass" : "editor-icon editor-icon-bendpoint-add",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.addBendPoint",
+ "id" : "add-bendpoint-button",
+ "disableInForm" : true
+ },
+ {
+ "type" : "button",
+ "title" : "TOOLBAR.ACTION.BENDPOINT.REMOVE",
+ "cssClass" : "editor-icon editor-icon-bendpoint-remove",
+ "action" : "FLOWABLE.TOOLBAR.ACTIONS.removeBendPoint",
+ "id" : "remove-bendpoint-button",
+ "disableInForm" : true
+ },
+ {
+ "type" : "separator",
+ "title": "",
+ "cssClass" : "toolbar-separator",
+ "disableInForm" : true
+ }
+ ],
+
+ "secondaryItems" : []
+};
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/resources/url-config.js
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/url-config.js b/ext/flowable/client-console/src/main/resources/url-config.js
new file mode 100644
index 0000000..392d470
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/url-config.js
@@ -0,0 +1,39 @@
+/* Licensed 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.
+ */
+var FLOWABLE = FLOWABLE || {};
+
+FLOWABLE.URL = {
+
+ getModel: function(modelId) {
+ return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
+ + "/bpmnProcessGET?modelId=" + modelId;
+ },
+
+ getStencilSet: function() {
+ return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
+ + "/flowable-modeler/stencilset_bpmn.json";
+ },
+
+ getCmmnStencilSet: function() {
+ return FLOWABLE.CONFIG.contextRoot + '/app/rest/stencil-sets/cmmneditor?version=' + Date.now();
+ },
+
+ putModel: function(modelId) {
+ return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
+ + "/bpmnProcessPUT?modelId=" + modelId;
+ },
+
+ validateModel: function(){
+ return FLOWABLE.CONFIG.contextRoot + '/app/rest/model/validate';
+ }
+};
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/pom.xml b/ext/flowable/common-lib/pom.xml
new file mode 100644
index 0000000..04ffeb7
--- /dev/null
+++ b/ext/flowable/common-lib/pom.xml
@@ -0,0 +1,56 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable Common Lib</name>
+ <description>Apache Syncope Ext: Flowable Common Lib</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.common</groupId>
+ <artifactId>syncope-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java
new file mode 100644
index 0000000..bb67e3e
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/BpmnProcessTO.java
@@ -0,0 +1,72 @@
+/*
+ * 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.common.lib.to;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "bpmnProcess")
+@XmlType
+public class BpmnProcessTO extends AbstractBaseBean implements EntityTO {
+
+ private static final long serialVersionUID = -7044543391316529128L;
+
+ private String key;
+
+ private String modelId;
+
+ private String name;
+
+ private boolean userWorkflow;
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public void setKey(final String key) {
+ this.key = key;
+ }
+
+ public String getModelId() {
+ return modelId;
+ }
+
+ public void setModelId(final String modelId) {
+ this.modelId = modelId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public boolean isUserWorkflow() {
+ return userWorkflow;
+ }
+
+ public void setUserWorkflow(final boolean userWorkflow) {
+ this.userWorkflow = userWorkflow;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java
new file mode 100644
index 0000000..897cfc0
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java
@@ -0,0 +1,147 @@
+/*
+ * 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.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.patch.UserPatch;
+
+@XmlRootElement(name = "userRequestForm")
+@XmlType
+public class UserRequestForm extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -7044543391316529128L;
+
+ private String username;
+
+ private String taskId;
+
+ private String formKey;
+
+ private Date createTime;
+
+ private Date dueDate;
+
+ private String owner;
+
+ private UserTO userTO;
+
+ private UserPatch userPatch;
+
+ private final List<UserRequestFormProperty> properties = new ArrayList<>();
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(final String username) {
+ this.username = username;
+ }
+
+ public String getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(final String taskId) {
+ this.taskId = taskId;
+ }
+
+ public String getFormKey() {
+ return formKey;
+ }
+
+ public void setFormKey(final String formKey) {
+ this.formKey = formKey;
+ }
+
+ public Date getCreateTime() {
+ if (createTime != null) {
+ return new Date(createTime.getTime());
+ }
+ return null;
+ }
+
+ public void setCreateTime(final Date createTime) {
+ if (createTime != null) {
+ this.createTime = new Date(createTime.getTime());
+ } else {
+ this.createTime = null;
+ }
+ }
+
+ public Date getDueDate() {
+ if (dueDate != null) {
+ return new Date(dueDate.getTime());
+ }
+ return null;
+ }
+
+ public void setDueDate(final Date dueDate) {
+ if (dueDate != null) {
+ this.dueDate = new Date(dueDate.getTime());
+ } else {
+ this.dueDate = null;
+ }
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final String owner) {
+ this.owner = owner;
+ }
+
+ public UserTO getUserTO() {
+ return userTO;
+ }
+
+ public void setUserTO(final UserTO userTO) {
+ this.userTO = userTO;
+ }
+
+ public UserPatch getUserPatch() {
+ return userPatch;
+ }
+
+ public void setUserPatch(final UserPatch userPatch) {
+ this.userPatch = userPatch;
+ }
+
+ @JsonIgnore
+ public Optional<UserRequestFormProperty> getProperty(final String id) {
+ return properties.stream().filter(property -> id.equals(property.getId())).findFirst();
+ }
+
+ @XmlElementWrapper(name = "workflowFormProperties")
+ @XmlElement(name = "workflowFormProperty")
+ @JsonProperty("workflowFormProperties")
+ public List<UserRequestFormProperty> getProperties() {
+ return properties;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java
new file mode 100644
index 0000000..0a431c6
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestFormProperty.java
@@ -0,0 +1,124 @@
+/*
+ * 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.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
+import org.apache.syncope.common.lib.types.UserRequestFormPropertyType;
+
+@XmlRootElement(name = "userRequestFormProperty")
+@XmlType
+public class UserRequestFormProperty extends AbstractBaseBean {
+
+ private static final long serialVersionUID = 9139969592634304261L;
+
+ private String id;
+
+ private String name;
+
+ private UserRequestFormPropertyType type;
+
+ private boolean readable;
+
+ private boolean writable;
+
+ private boolean required;
+
+ private String datePattern;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ private final Map<String, String> enumValues = new HashMap<>();
+
+ private String value;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(final String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public boolean isReadable() {
+ return readable;
+ }
+
+ public void setReadable(final boolean readable) {
+ this.readable = readable;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(final boolean required) {
+ this.required = required;
+ }
+
+ public UserRequestFormPropertyType getType() {
+ return type;
+ }
+
+ public void setType(final UserRequestFormPropertyType type) {
+ this.type = type;
+ }
+
+ public boolean isWritable() {
+ return writable;
+ }
+
+ public void setWritable(final boolean writable) {
+ this.writable = writable;
+ }
+
+ public String getDatePattern() {
+ return datePattern;
+ }
+
+ public void setDatePattern(final String datePattern) {
+ this.datePattern = datePattern;
+ }
+
+ @JsonProperty
+ public Map<String, String> getEnumValues() {
+ return enumValues;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(final String value) {
+ this.value = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java
new file mode 100644
index 0000000..d5fad6c
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestTO.java
@@ -0,0 +1,70 @@
+/*
+ * 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.common.lib.to;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "userRequest")
+@XmlType
+public class UserRequestTO extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -8430826310789942133L;
+
+ private String processInstanceId;
+
+ private String executionId;
+
+ private String bpmnProcess;
+
+ private String user;
+
+ public String getProcessInstanceId() {
+ return processInstanceId;
+ }
+
+ public void setProcessInstanceId(final String processInstanceId) {
+ this.processInstanceId = processInstanceId;
+ }
+
+ public String getExecutionId() {
+ return executionId;
+ }
+
+ public void setExecutionId(final String executionId) {
+ this.executionId = executionId;
+ }
+
+ public String getBpmnProcess() {
+ return bpmnProcess;
+ }
+
+ public void setBpmnProcess(final String bpmnProcess) {
+ this.bpmnProcess = bpmnProcess;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(final String user) {
+ this.user = user;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java
new file mode 100644
index 0000000..6b712ab
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTask.java
@@ -0,0 +1,40 @@
+/*
+ * 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.common.lib.to;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "workflowTask")
+@XmlType
+public class WorkflowTask extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -3095016727396210808L;
+
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java
new file mode 100644
index 0000000..0a7e2be
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskExecInput.java
@@ -0,0 +1,55 @@
+/*
+ * 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.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.HashMap;
+import java.util.Map;
+import javax.ws.rs.PathParam;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
+
+@XmlRootElement(name = "workflowTaskExecInput")
+@XmlType
+public class WorkflowTaskExecInput extends AbstractBaseBean {
+
+ private static final long serialVersionUID = 8060283119070901756L;
+
+ private String userKey;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ private final Map<String, String> variables = new HashMap<>();
+
+ public String getUserKey() {
+ return userKey;
+ }
+
+ @PathParam("userKey")
+ public void setUserKey(final String userKey) {
+ this.userKey = userKey;
+ }
+
+ @JsonProperty
+ public Map<String, String> getVariables() {
+ return variables;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java
new file mode 100644
index 0000000..549eb9a
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/BpmnProcessFormat.java
@@ -0,0 +1,29 @@
+/*
+ * 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.common.lib.types;
+
+/**
+ * Format for import / export of workflow definition.
+ */
+public enum BpmnProcessFormat {
+
+ XML,
+ JSON
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java
new file mode 100644
index 0000000..43825a4
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/FlowableEntitlement.java
@@ -0,0 +1,76 @@
+/*
+ * 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.common.lib.types;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Collections;
+import java.util.Set;
+import java.util.TreeSet;
+
+public final class FlowableEntitlement {
+
+ public static final String BPMN_PROCESS_LIST = "BPMN_PROCESS_LIST";
+
+ public static final String BPMN_PROCESS_GET = "BPMN_PROCESS_GET";
+
+ public static final String BPMN_PROCESS_SET = "BPMN_PROCESS_SET";
+
+ public static final String BPMN_PROCESS_DELETE = "BPMN_PROCESS_DELETE";
+
+ public static final String WORKFLOW_TASK_LIST = "WORKFLOW_TASK_LIST";
+
+ public static final String WORKFLOW_FORM_LIST = "WORKFLOW_FORM_LIST";
+
+ public static final String WORKFLOW_FORM_READ = "WORKFLOW_FORM_READ";
+
+ public static final String WORKFLOW_FORM_CLAIM = "WORKFLOW_FORM_CLAIM";
+
+ public static final String WORKFLOW_FORM_SUBMIT = "WORKFLOW_FORM_SUBMIT";
+
+ public static final String USER_REQUEST_DEF_CREATE = "USER_REQUEST_DEF_CREATE";
+
+ public static final String USER_REQUEST_DEF_UPDATE = "USER_REQUEST_DEF_UPDATE";
+
+ public static final String USER_REQUEST_DEF_DELETE = "USER_REQUEST_DEF_DELETE";
+
+ public static final String USER_REQUEST_START = "USER_REQUEST_START";
+
+ public static final String USER_REQUEST_CANCEL = "USER_REQUEST_CANCEL";
+
+ private static final Set<String> VALUES;
+
+ static {
+ Set<String> values = new TreeSet<>();
+ for (Field field : FlowableEntitlement.class.getDeclaredFields()) {
+ if (Modifier.isStatic(field.getModifiers()) && String.class.equals(field.getType())) {
+ values.add(field.getName());
+ }
+ }
+ VALUES = Collections.unmodifiableSet(values);
+ }
+
+ public static Set<String> values() {
+ return VALUES;
+ }
+
+ private FlowableEntitlement() {
+ // private constructor for static utility class
+ }
+}
[22/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml b/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml
new file mode 100644
index 0000000..5a9f1bd
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml
@@ -0,0 +1,228 @@
+<?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:flowable="http://flowable.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://www.flowable.org/processdef">
+
+ <process id="userWorkflow" name="User Workflow" isExecutable="true">
+ <startEvent id="theStart"/>
+ <sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
+ <serviceTask id="create" name="Create" flowable:expression="#{create.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow2" sourceRef="create" targetRef="activate"/>
+ <scriptTask id="activate" name="Activate" scriptFormat="groovy" flowable:autoStoreVariables="false">
+ <script><![CDATA[execution.setVariable("propagateEnable", Boolean.TRUE);]]></script>
+ </scriptTask>
+ <sequenceFlow id="flow3" sourceRef="activate" targetRef="active"/>
+ <userTask id="active" name="Active"/>
+ <sequenceFlow id="flow8" sourceRef="active" targetRef="activeGw"/>
+ <exclusiveGateway id="activeGw"/>
+ <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>
+ <serviceTask id="update" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" sourceRef="update" targetRef="active"/>
+ <serviceTask id="suspend" name="Suspend" flowable: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" flowable:expression="#{reactivate.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
+ <serviceTask id="generateToken4PasswordReset" name="Generate Token" flowable:expression="#{generateToken.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" sourceRef="generateToken4PasswordReset" targetRef="notify4RequestPasswordReset"/>
+ <serviceTask id="notify4RequestPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" sourceRef="notify4RequestPasswordReset" targetRef="active"/>
+ <serviceTask id="checkToken4ConfirmPasswordReset" name="Check token, remove and update password" flowable:expression="#{passwordReset.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" sourceRef="checkToken4ConfirmPasswordReset" targetRef="notify4ConfirmPasswordReset"/>
+ <serviceTask id="notify4ConfirmPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" sourceRef="notify4ConfirmPasswordReset" targetRef="active"/>
+ <serviceTask id="delete" name="Delete" flowable: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="540.0" y="521.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
+ <omgdc:Bounds height="60.0" width="100.0" x="620.0" y="509.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
+ <omgdc:Bounds height="80.0" width="100.0" x="828.0" y="500.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="update" id="BPMNShape_update">
+ <omgdc:Bounds height="60.0" width="100.0" x="1370.0" y="615.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
+ <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="370.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspended" id="BPMNShape_suspended">
+ <omgdc:Bounds height="60.0" width="100.0" x="1640.0" y="370.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
+ <omgdc:Bounds height="40.0" width="40.0" x="1820.0" y="380.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="reactivate" id="BPMNShape_reactivate">
+ <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="290.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="604.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="750.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="664.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="810.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
+ <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="438.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:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
+ <omgdi:waypoint x="1420.0" y="559.9405090390104"/>
+ <omgdi:waypoint x="1420.0" y="615.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
+ <omgdi:waypoint x="1859.9433544303797" y="400.0"/>
+ <omgdi:waypoint x="1990.0" y="400.0"/>
+ <omgdi:waypoint x="1990.0" y="438.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
+ <omgdi:waypoint x="1439.947267871352" y="540.0"/>
+ <omgdi:waypoint x="1785.0" y="540.0"/>
+ <omgdi:waypoint x="1785.3768996960487" y="664.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" id="BPMNEdge_sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C">
+ <omgdi:waypoint x="1370.0" y="645.0"/>
+ <omgdi:waypoint x="1080.0" y="645.0"/>
+ <omgdi:waypoint x="1080.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
+ <omgdi:waypoint x="1859.9339371980675" y="400.0"/>
+ <omgdi:waypoint x="1902.0" y="400.0"/>
+ <omgdi:waypoint x="1902.0" y="320.0"/>
+ <omgdi:waypoint x="1939.9999999999768" y="320.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
+ <omgdi:waypoint x="1439.9482503069637" y="540.0"/>
+ <omgdi:waypoint x="1990.0" y="540.0"/>
+ <omgdi:waypoint x="1990.0" y="497.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" id="BPMNEdge_sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7">
+ <omgdi:waypoint x="1575.5" y="684.9499999999999"/>
+ <omgdi:waypoint x="1575.5" y="750.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="569.9448521215137" y="536.3898700596537"/>
+ <omgdi:waypoint x="620.0" y="537.6956521739131"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+ <omgdi:waypoint x="719.9499999999825" y="539.2401442307691"/>
+ <omgdi:waypoint x="827.9999999999945" y="539.7596153846154"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+ <omgdi:waypoint x="927.9499999999819" y="540.2472772277227"/>
+ <omgdi:waypoint x="1029.9999999999911" y="540.7524752475248"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
+ <omgdi:waypoint x="1439.943568665287" y="540.0"/>
+ <omgdi:waypoint x="1575.0" y="540.0"/>
+ <omgdi:waypoint x="1575.3062200956938" y="604.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" id="BPMNEdge_sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6">
+ <omgdi:waypoint x="1785.5" y="744.9499999999999"/>
+ <omgdi:waypoint x="1785.5" y="810.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+ <omgdi:waypoint x="1589.95" y="400.0"/>
+ <omgdi:waypoint x="1640.0" y="400.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" id="BPMNEdge_sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F">
+ <omgdi:waypoint x="1514.9999999999554" y="790.438950554995"/>
+ <omgdi:waypoint x="1080.0" y="790.0"/>
+ <omgdi:waypoint x="1080.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+ <omgdi:waypoint x="1129.9499999999914" y="540.8529411764707"/>
+ <omgdi:waypoint x="1400.0586510263724" y="540.058504398827"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+ <omgdi:waypoint x="1739.95" y="400.0"/>
+ <omgdi:waypoint x="1820.0" y="400.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow99" id="BPMNEdge_flow99">
+ <omgdi:waypoint x="2039.9499999999982" y="466.5576923076923"/>
+ <omgdi:waypoint x="2080.005704870052" y="465.4022398573087"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
+ <omgdi:waypoint x="1439.9416944213153" y="540.0"/>
+ <omgdi:waypoint x="1540.0" y="540.0"/>
+ <omgdi:waypoint x="1540.0" y="429.95"/>
+ </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"/>
+ <omgdi:waypoint x="1080.0" y="261.0"/>
+ <omgdi:waypoint x="1080.0" y="511.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" id="BPMNEdge_sid-A37806A7-6B7B-48A2-BB37-DAE640231144">
+ <omgdi:waypoint x="1724.9999999998677" y="850.4571226080794"/>
+ <omgdi:waypoint x="1080.0" y="850.0"/>
+ <omgdi:waypoint x="1080.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties b/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties
new file mode 100644
index 0000000..be8a7bb
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties
@@ -0,0 +1,21 @@
+# 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}
+historyLevel=activity
+uwfAdapter=org.apache.syncope.core.flowable.impl.FlowableUserWorkflowAdapter
+gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter
+awfAdapter=org.apache.syncope.core.workflow.java.DefaultAnyObjectWorkflowAdapter
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml b/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml
new file mode 100644
index 0000000..9e27f47
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml
@@ -0,0 +1,62 @@
+<?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"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <bean id="userWorkflowDef" class="org.apache.syncope.core.spring.ResourceWithFallbackLoader">
+ <property name="primary" value="file:${wf.directory}/userWorkflow.bpmn20.xml"/>
+ <property name="fallback" value="classpath:userWorkflow.bpmn20.xml"/>
+ </bean>
+
+ <bean id="syncopeIdmIdentityService" class="org.apache.syncope.core.flowable.support.SyncopeIdmIdentityService"/>
+ <bean id="syncopeIdmEngineConfiguration" class="org.flowable.idm.spring.SpringIdmEngineConfiguration">
+ <property name="idmIdentityService" ref="syncopeIdmIdentityService"/>
+ </bean>
+ <bean id="syncopeIdmEngineConfigurator" class="org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator">
+ <property name="idmEngineConfiguration" ref="syncopeIdmEngineConfiguration"/>
+ </bean>
+
+ <bean class="org.apache.syncope.core.flowable.support.DomainProcessEngineConfiguration" scope="prototype">
+ <property name="databaseSchemaUpdate" value="true"/>
+
+ <property name="jpaHandleTransaction" value="true"/>
+ <property name="jpaCloseEntityManager" value="false"/>
+
+ <property name="history" value="${historyLevel}"/>
+
+ <property name="idmEngineConfigurator" ref="syncopeIdmEngineConfigurator"/>
+ <property name="customPreVariableTypes">
+ <list>
+ <bean class="org.apache.syncope.core.flowable.support.SyncopeEntitiesVariableType"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="bpmnProcessManager" class="org.apache.syncope.core.flowable.impl.FlowableBpmnProcessManager"/>
+ <bean id="userRequestHandler" class="org.apache.syncope.core.flowable.impl.FlowableUserRequestHandler"/>
+ <bean id="flowableUtils" class="org.apache.syncope.core.flowable.impl.FlowableWorkflowUtils"/>
+
+ <context:component-scan base-package="org.apache.syncope.core.flowable"/>
+</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/logic/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/pom.xml b/ext/flowable/logic/pom.xml
new file mode 100644
index 0000000..3ba752c
--- /dev/null
+++ b/ext/flowable/logic/pom.xml
@@ -0,0 +1,61 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>2.1.2-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable Logic</name>
+ <description>Apache Syncope Ext: Flowable Logic</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-logic</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.core</groupId>
+ <artifactId>syncope-core-logic</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-bpmn</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java
new file mode 100644
index 0000000..8d280ac
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java
@@ -0,0 +1,73 @@
+/*
+ * 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.logic;
+
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.util.List;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import org.apache.syncope.core.flowable.api.BpmnProcessManager;
+
+@Component
+public class BpmnProcessLogic extends AbstractTransactionalLogic<BpmnProcessTO> {
+
+ @Autowired
+ private BpmnProcessManager bpmnProcessManager;
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_LIST + "')")
+ @Transactional(readOnly = true)
+ public List<BpmnProcessTO> list() {
+ return bpmnProcessManager.getProcesses();
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_GET + "')")
+ @Transactional(readOnly = true)
+ public void exportDefinition(final String key, final BpmnProcessFormat format, final OutputStream os) {
+ bpmnProcessManager.exportProcess(key, format, os);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_GET + "')")
+ @Transactional(readOnly = true)
+ public void exportDiagram(final String key, final OutputStream os) {
+ bpmnProcessManager.exportDiagram(key, os);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_SET + "')")
+ public void importDefinition(final String key, final BpmnProcessFormat format, final String definition) {
+ bpmnProcessManager.importProcess(key, format, definition);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_DELETE + "')")
+ public void delete(final String key) {
+ bpmnProcessManager.deleteProcess(key);
+ }
+
+ @Override
+ protected BpmnProcessTO resolveReference(final Method method, final Object... args)
+ throws UnresolvedReferenceException {
+
+ throw new UnresolvedReferenceException();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java
new file mode 100644
index 0000000..1acc1da
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java
@@ -0,0 +1,160 @@
+/*
+ * 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.logic;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import org.apache.commons.io.output.NullOutputStream;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.syncope.core.flowable.api.BpmnProcessManager;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationManager;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.api.UserRequestHandler;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Component
+public class UserRequestLogic extends AbstractTransactionalLogic<UserRequestForm> {
+
+ @Autowired
+ private BpmnProcessManager bpmnProcessManager;
+
+ @Autowired
+ private UserRequestHandler userRequestHandler;
+
+ @Autowired
+ private PropagationManager propagationManager;
+
+ @Autowired
+ private PropagationTaskExecutor taskExecutor;
+
+ @Autowired
+ private UserDataBinder binder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ protected UserRequestTO doStart(final String bpmnProcess, final User user) {
+ // check if BPMN process exists
+ bpmnProcessManager.exportProcess(bpmnProcess, BpmnProcessFormat.XML, new NullOutputStream());
+
+ return userRequestHandler.start(bpmnProcess, user);
+ }
+
+ @PreAuthorize("isAuthenticated()")
+ public UserRequestTO start(final String bpmnProcess) {
+ return doStart(bpmnProcess, userDAO.findByUsername(AuthContextUtils.getUsername()));
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.USER_REQUEST_START + "')")
+ public UserRequestTO start(final String bpmnProcess, final String userKey) {
+ return doStart(bpmnProcess, userDAO.authFind(userKey));
+ }
+
+ @PreAuthorize("isAuthenticated()")
+ public void cancel(final String executionId, final String reason) {
+ Pair<ProcessInstance, String> parsed = userRequestHandler.parse(executionId);
+
+ if (!AuthContextUtils.getUsername().equals(userDAO.find(parsed.getRight()).getUsername())
+ && !AuthContextUtils.getAuthorities().stream().
+ anyMatch(auth -> FlowableEntitlement.USER_REQUEST_CANCEL.equals(auth.getAuthority()))) {
+
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.DelegatedAdministration);
+ sce.getElements().add("Canceling " + executionId + " not allowed");
+ throw sce;
+ }
+
+ userRequestHandler.cancel(parsed.getLeft(), reason);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_CLAIM + "')")
+ public UserRequestForm claimForm(final String taskId) {
+ return userRequestHandler.claimForm(taskId);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_READ + "') "
+ + "and hasRole('" + StandardEntitlement.USER_READ + "')")
+ @Transactional(readOnly = true)
+ public List<UserRequestForm> getForms(final String key) {
+ User user = userDAO.authFind(key);
+ return userRequestHandler.getForms(user.getKey());
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_LIST + "')")
+ @Transactional(readOnly = true)
+ public Pair<Integer, List<UserRequestForm>> getForms(
+ final int page,
+ final int size,
+ final List<OrderByClause> orderByClauses) {
+
+ return userRequestHandler.getForms(page, size, orderByClauses);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_SUBMIT + "')")
+ public UserTO submitForm(final UserRequestForm form) {
+ WorkflowResult<UserPatch> wfResult = userRequestHandler.submitForm(form);
+
+ // propByRes can be made empty by the workflow definition if no propagation should occur
+ // (for example, with rejected users)
+ if (wfResult.getPropByRes() != null && !wfResult.getPropByRes().isEmpty()) {
+ List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
+ new WorkflowResult<>(
+ Pair.of(wfResult.getResult(), Boolean.TRUE),
+ wfResult.getPropByRes(),
+ wfResult.getPerformedTasks()));
+
+ taskExecutor.execute(tasks, false);
+ }
+
+ UserTO userTO;
+ if (userDAO.find(wfResult.getResult().getKey()) == null) {
+ userTO = new UserTO();
+ userTO.setKey(wfResult.getResult().getKey());
+ } else {
+ userTO = binder.getUserTO(wfResult.getResult().getKey());
+ }
+ return userTO;
+ }
+
+ @Override
+ protected UserRequestForm resolveReference(final Method method, final Object... args)
+ throws UnresolvedReferenceException {
+
+ throw new UnresolvedReferenceException();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java
new file mode 100644
index 0000000..8d73fae
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java
@@ -0,0 +1,91 @@
+/*
+ * 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.logic;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationManager;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.api.WorkflowTaskManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Component;
+
+@Component
+public class UserWorkflowTaskLogic extends AbstractTransactionalLogic<UserRequestForm> {
+
+ @Autowired
+ private WorkflowTaskManager wfTaskManager;
+
+ @Autowired
+ private PropagationManager propagationManager;
+
+ @Autowired
+ private PropagationTaskExecutor taskExecutor;
+
+ @Autowired
+ private UserDataBinder binder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_TASK_LIST + "') "
+ + "and hasRole('" + StandardEntitlement.USER_READ + "')")
+ public List<WorkflowTask> getAvailableTasks(final String key) {
+ User user = userDAO.authFind(key);
+ return wfTaskManager.getAvailableTasks(user.getKey());
+ }
+
+ @PreAuthorize("hasRole('" + StandardEntitlement.USER_UPDATE + "')")
+ public UserTO executeNextTask(final WorkflowTaskExecInput workflowTaskExecInput) {
+ WorkflowResult<String> updated = wfTaskManager.executeNextTask(workflowTaskExecInput);
+
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(updated.getResult());
+
+ List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
+ new WorkflowResult<>(
+ Pair.<UserPatch, Boolean>of(userPatch, null),
+ updated.getPropByRes(), updated.getPerformedTasks()));
+
+ taskExecutor.execute(tasks, false);
+
+ return binder.getUserTO(updated.getResult());
+ }
+
+ @Override
+ protected UserRequestForm resolveReference(final Method method, final Object... args)
+ throws UnresolvedReferenceException {
+
+ throw new UnresolvedReferenceException();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
new file mode 100644
index 0000000..ea526ad
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
@@ -0,0 +1,98 @@
+/*
+ * 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.logic.init;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.core.flowable.impl.FlowableDeployUtils;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.SyncopeLoader;
+import org.apache.syncope.core.provisioning.api.EntitlementsHolder;
+import org.apache.syncope.core.spring.ResourceWithFallbackLoader;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.flowable.spring.SpringProcessEngineConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class FlowableLoader implements SyncopeLoader {
+
+ private static final Logger LOG = LoggerFactory.getLogger(FlowableLoader.class);
+
+ @Resource(name = "userWorkflowDef")
+ private ResourceWithFallbackLoader userWorkflowDef;
+
+ @Autowired
+ private DomainProcessEngine dpEngine;
+
+ @Override
+ public Integer getPriority() {
+ return Integer.MIN_VALUE;
+ }
+
+ @Override
+ public void load() {
+ EntitlementsHolder.getInstance().init(FlowableEntitlement.values());
+
+ byte[] wfDef = new byte[0];
+
+ try (InputStream wfIn = userWorkflowDef.getResource().getInputStream()) {
+ wfDef = IOUtils.toByteArray(wfIn);
+ } catch (IOException e) {
+ LOG.error("While loading " + userWorkflowDef.getResource().getFilename(), e);
+ }
+
+ for (Map.Entry<String, ProcessEngine> entry : dpEngine.getEngines().entrySet()) {
+ List<ProcessDefinition> processes = entry.getValue().getRepositoryService().
+ createProcessDefinitionQuery().processDefinitionKey(FlowableRuntimeUtils.WF_PROCESS_ID).
+ list();
+ LOG.debug(FlowableRuntimeUtils.WF_PROCESS_ID + " Flowable processes in repository: {}", processes);
+
+ // Only loads process definition from file if not found in repository
+ if (processes.isEmpty()) {
+ entry.getValue().getRepositoryService().createDeployment().addInputStream(
+ userWorkflowDef.getResource().getFilename(), new ByteArrayInputStream(wfDef)).deploy();
+
+ ProcessDefinition procDef = entry.getValue().getRepositoryService().createProcessDefinitionQuery().
+ processDefinitionKey(FlowableRuntimeUtils.WF_PROCESS_ID).latestVersion().
+ singleResult();
+
+ FlowableDeployUtils.deployModel(entry.getValue(), procDef);
+
+ LOG.debug("Flowable Workflow definition loaded for domain {}", entry.getKey());
+ }
+
+ // jump to the next ID block
+ for (int i = 0; i < entry.getValue().getProcessEngineConfiguration().getIdBlockSize(); i++) {
+ SpringProcessEngineConfiguration.class.cast(entry.getValue().getProcessEngineConfiguration()).
+ getIdGenerator().getNextId();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/pom.xml b/ext/flowable/pom.xml
new file mode 100644
index 0000000..764cebd
--- /dev/null
+++ b/ext/flowable/pom.xml
@@ -0,0 +1,49 @@
+<?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-ext</artifactId>
+ <version>2.1.2-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable</name>
+ <description>Apache Syncope Ext: Flowable</description>
+ <groupId>org.apache.syncope.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <packaging>pom</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../..</rootpom.basedir>
+ </properties>
+
+ <modules>
+ <module>common-lib</module>
+ <module>rest-api</module>
+ <module>logic</module>
+ <module>rest-cxf</module>
+ <module>flowable-bpmn</module>
+ <module>client-console</module>
+ </modules>
+
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-api/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/pom.xml b/ext/flowable/rest-api/pom.xml
new file mode 100644
index 0000000..2938b05
--- /dev/null
+++ b/ext/flowable/rest-api/pom.xml
@@ -0,0 +1,76 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>2.1.2-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable REST API</name>
+ <description>Apache Syncope Ext: Flowable REST API</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.common</groupId>
+ <artifactId>syncope-common-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Generating javadoc JAR artifact for usage with CXF's WADL generator (for core) -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java
new file mode 100644
index 0000000..4097afd
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java
@@ -0,0 +1,32 @@
+/*
+ * 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.common.rest.api.beans;
+
+public class UserRequestFormQuery extends AbstractQuery {
+
+ private static final long serialVersionUID = -4762457303770028554L;
+
+ public static class Builder extends AbstractQuery.Builder<UserRequestFormQuery, Builder> {
+
+ @Override
+ protected UserRequestFormQuery newInstance() {
+ return new UserRequestFormQuery();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java
new file mode 100644
index 0000000..06cb056
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java
@@ -0,0 +1,108 @@
+/*
+ * 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.common.rest.api.service;
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.security.SecurityRequirements;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+
+/**
+ * REST operations for BPMN processes.
+ */
+@Tag(name = "Flowable")
+@SecurityRequirements({
+ @SecurityRequirement(name = "BasicAuthentication"),
+ @SecurityRequirement(name = "Bearer") })
+@Path("flowable/bpmnProcesses")
+public interface BpmnProcessService extends JAXRSService {
+
+ /**
+ * Lists the available BPMN processes.
+ *
+ * @return available BPMN processs, for the given any object type
+ */
+ @GET
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ List<BpmnProcessTO> list();
+
+ /**
+ * Exports the BPMN process for matching key.
+ *
+ * @param key BPMN process key
+ * @return BPMN process for matching key
+ */
+ @GET
+ @Path("{key}")
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ Response get(@NotNull @PathParam("key") String key);
+
+ /**
+ * Exports the BPMN diagram representation (if available), for matching key.
+ *
+ * @param key BPMN process key
+ * @return workflow diagram representation
+ */
+ @GET
+ @Path("{key}/diagram.png")
+ @Produces({ RESTHeaders.MEDIATYPE_IMAGE_PNG })
+ Response exportDiagram(@NotNull @PathParam("key") String key);
+
+ /**
+ * Imports the BPMN process under the provided key.
+ *
+ * @param key BPMN process key
+ * @param definition BPMN process for matching kind
+ */
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
+ @PUT
+ @Path("{key}")
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ void set(@NotNull @PathParam("key") String key, @NotNull String definition);
+
+ /**
+ * Removes the BPMN process under the provided key.
+ *
+ * @param key BPMN process key
+ */
+ @Operation(operationId = "deleteBpmnProcess")
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
+ @DELETE
+ @Path("{key}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ void delete(@NotNull @PathParam("key") String key);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java
new file mode 100644
index 0000000..701772d
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java
@@ -0,0 +1,125 @@
+/*
+ * 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.common.rest.api.service;
+
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.security.SecurityRequirements;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.BeanParam;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+
+/**
+ * REST operations related to user workflow.
+ */
+@Tag(name = "Flowable")
+@SecurityRequirements({
+ @SecurityRequirement(name = "BasicAuthentication"),
+ @SecurityRequirement(name = "Bearer") })
+@Path("flowable/userRequests")
+public interface UserRequestService extends JAXRSService {
+
+ /**
+ * Starts a new user request, for the given BOMN Process and
+ * user (if provided) or requesting user (if not provided).
+ *
+ * @param bpmnProcess BPMN process
+ * @param userKey user key
+ * @return data about the started request service, including execution id
+ */
+ @POST
+ @Path("start/{bpmnProcess}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserRequestTO start(
+ @NotNull @PathParam("bpmnProcess") String bpmnProcess,
+ @QueryParam("userKey") String userKey);
+
+ /**
+ * Cancel a running user request.
+ *
+ * @param executionId execution id
+ * @param reason reason to cancel the user request
+ */
+ @DELETE
+ @Path("{executionId}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ void cancel(
+ @NotNull @PathParam("executionId") String executionId,
+ @QueryParam("reason") String reason);
+
+ /**
+ * Returns a list of all available workflow forms.
+ *
+ * @param query query conditions
+ * @return list of all available workflow forms
+ */
+ @GET
+ @Path("forms")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ PagedResult<UserRequestForm> getForms(@BeanParam UserRequestFormQuery query);
+
+ /**
+ * Returns a list of available forms for the given user key.
+ *
+ * @param userKey user key
+ * @return list of available forms for the given user key
+ */
+ @GET
+ @Path("forms/{userKey}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ List<UserRequestForm> getForms(@NotNull @PathParam("userKey") String userKey);
+
+ /**
+ * Claims the form for the given task id.
+ *
+ * @param taskId workflow task id
+ * @return the workflow form for the given task id
+ */
+ @POST
+ @Path("forms/{taskId}/claim")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserRequestForm claimForm(@NotNull @PathParam("taskId") String taskId);
+
+ /**
+ * Submits a workflow form.
+ *
+ * @param form workflow form.
+ * @return updated user
+ */
+ @POST
+ @Path("forms")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserTO submitForm(@NotNull UserRequestForm form);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java
new file mode 100644
index 0000000..54f38d0
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java
@@ -0,0 +1,67 @@
+/*
+ * 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.common.rest.api.service;
+
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.security.SecurityRequirements;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+
+@Tag(name = "Flowable")
+@SecurityRequirements({
+ @SecurityRequirement(name = "BasicAuthentication"),
+ @SecurityRequirement(name = "Bearer") })
+@Path("flowable/userWorkflowTasks")
+public interface UserWorkflowTaskService extends JAXRSService {
+
+ /**
+ * Returns a list of available tasks for the given user key.
+ *
+ * @param userKey user key
+ * @return list of available tasks for the given user key
+ */
+ @GET
+ @Path("tasks/{userKey}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ List<WorkflowTask> getAvailableTasks(@NotNull @PathParam("userKey") String userKey);
+
+ /**
+ * Executes the next workflow task available, for matching user key.
+ *
+ * @param workflowTaskExecInput input for task execution
+ * @return updated user
+ */
+ @POST
+ @Path("tasks/{userKey}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserTO executeNextTask(@NotNull WorkflowTaskExecInput workflowTaskExecInput);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-cxf/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/pom.xml b/ext/flowable/rest-cxf/pom.xml
new file mode 100644
index 0000000..adc476f
--- /dev/null
+++ b/ext/flowable/rest-cxf/pom.xml
@@ -0,0 +1,72 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>2.1.2-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable REST CXF</name>
+ <description>Apache Syncope Ext: Flowable REST CXF</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.core</groupId>
+ <artifactId>syncope-core-rest-cxf</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <version>${project.version}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-logic</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java
new file mode 100644
index 0000000..dd1aea8
--- /dev/null
+++ b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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.rest.cxf.service;
+
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.core.logic.BpmnProcessLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.syncope.common.rest.api.service.BpmnProcessService;
+
+@Service
+public class BpmnProcessServiceImpl extends AbstractServiceImpl implements BpmnProcessService {
+
+ @Autowired
+ private BpmnProcessLogic logic;
+
+ @Override
+ public List<BpmnProcessTO> list() {
+ return logic.list();
+ }
+
+ @Override
+ public Response get(final String key) {
+ BpmnProcessFormat format =
+ messageContext.getHttpHeaders().getAcceptableMediaTypes().contains(MediaType.APPLICATION_JSON_TYPE)
+ ? BpmnProcessFormat.JSON
+ : BpmnProcessFormat.XML;
+
+ StreamingOutput sout = os -> logic.exportDefinition(key, format, os);
+
+ return Response.ok(sout).
+ type(format == BpmnProcessFormat.JSON
+ ? MediaType.APPLICATION_JSON_TYPE : MediaType.APPLICATION_XHTML_XML_TYPE).
+ build();
+ }
+
+ @Override
+ public Response exportDiagram(final String key) {
+ StreamingOutput sout = (os) -> logic.exportDiagram(key, os);
+
+ return Response.ok(sout).
+ type(RESTHeaders.MEDIATYPE_IMAGE_PNG).
+ build();
+ }
+
+ @Override
+ public void set(final String key, final String definition) {
+ BpmnProcessFormat format =
+ messageContext.getHttpHeaders().getMediaType().equals(MediaType.APPLICATION_JSON_TYPE)
+ ? BpmnProcessFormat.JSON
+ : BpmnProcessFormat.XML;
+
+ logic.importDefinition(key, format, definition);
+ }
+
+ @Override
+ public void delete(final String key) {
+ logic.delete(key);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java
new file mode 100644
index 0000000..2f174a0
--- /dev/null
+++ b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java
@@ -0,0 +1,73 @@
+/*
+ * 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.rest.cxf.service;
+
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+import org.apache.syncope.core.logic.UserRequestLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
+
+@Service
+public class UserRequestServiceImpl extends AbstractServiceImpl implements UserRequestService {
+
+ @Autowired
+ private UserRequestLogic logic;
+
+ @Override
+ public UserRequestTO start(final String bpmnProcess, final String userKey) {
+ return userKey == null
+ ? logic.start(bpmnProcess)
+ : logic.start(bpmnProcess, userKey);
+ }
+
+ @Override
+ public void cancel(final String executionId, final String reason) {
+ logic.cancel(executionId, reason);
+ }
+
+ @Override
+ public UserRequestForm claimForm(final String taskId) {
+ return logic.claimForm(taskId);
+ }
+
+ @Override
+ public List<UserRequestForm> getForms(final String userKey) {
+ return logic.getForms(userKey);
+ }
+
+ @Override
+ public PagedResult<UserRequestForm> getForms(final UserRequestFormQuery query) {
+ Pair<Integer, List<UserRequestForm>> result = logic.getForms(
+ query.getPage(), query.getSize(), getOrderByClauses(query.getOrderBy()));
+ return buildPagedResult(result.getRight(), query.getPage(), query.getSize(), result.getLeft());
+ }
+
+ @Override
+ public UserTO submitForm(final UserRequestForm form) {
+ return logic.submitForm(form);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java
new file mode 100644
index 0000000..441973d
--- /dev/null
+++ b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java
@@ -0,0 +1,45 @@
+/*
+ * 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.rest.cxf.service;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.core.logic.UserWorkflowTaskLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.syncope.common.rest.api.service.UserWorkflowTaskService;
+
+@Service
+public class UserWorkflowTaskServiceImpl extends AbstractServiceImpl implements UserWorkflowTaskService {
+
+ @Autowired
+ private UserWorkflowTaskLogic logic;
+
+ @Override
+ public List<WorkflowTask> getAvailableTasks(final String userKey) {
+ return logic.getAvailableTasks(userKey);
+ }
+
+ @Override
+ public UserTO executeNextTask(final WorkflowTaskExecInput workflowTaskExecInput) {
+ return logic.executeNextTask(workflowTaskExecInput);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
----------------------------------------------------------------------
diff --git a/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java b/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
index 66d2ce0..66bb812 100644
--- a/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
+++ b/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
@@ -32,7 +32,8 @@ import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-@ExtPage(label = "OIDC Client", icon = "fa-openid ", listEntitlement = OIDCClientEntitlement.OP_READ, priority = 200)
+@ExtPage(label = "OpenID Connect 1.0 Client", icon = "fa-openid ",
+ listEntitlement = OIDCClientEntitlement.OP_READ, priority = 300)
public class OIDCClient extends BaseExtPage {
private static final long serialVersionUID = -599601954212606001L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/oidcclient/persistence-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/ext/oidcclient/persistence-jpa/pom.xml b/ext/oidcclient/persistence-jpa/pom.xml
index 3ed38a1..df6705b 100644
--- a/ext/oidcclient/persistence-jpa/pom.xml
+++ b/ext/oidcclient/persistence-jpa/pom.xml
@@ -117,7 +117,7 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>sqlgenr</id>
+ <id>sqlgen</id>
<phase>process-classes</phase>
<goals>
<goal>sql</goal>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
----------------------------------------------------------------------
diff --git a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
index 39b719c..37851c5 100644
--- a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
+++ b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
@@ -35,7 +35,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for OpenID Connect Clients.
*/
-@Tag(name = "OIDCClients")
+@Tag(name = "OpenID Connect 1.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
----------------------------------------------------------------------
diff --git a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
index ca55a4a..be7c7be 100644
--- a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
+++ b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
@@ -47,7 +47,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for OpenID Connect Providers.
*/
-@Tag(name = "OIDCProviders")
+@Tag(name = "OpenID Connect 1.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pom.xml b/ext/pom.xml
index cf94f3d..23b799c 100644
--- a/ext/pom.xml
+++ b/ext/pom.xml
@@ -77,6 +77,7 @@ under the License.
</profiles>
<modules>
+ <module>flowable</module>
<module>camel</module>
<module>swagger-ui</module>
<module>saml2sp</module>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java b/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
index 7163ab9..71ef8e5 100644
--- a/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
+++ b/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
@@ -33,7 +33,7 @@ import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-@ExtPage(label = "SAML 2.0 SP", icon = "fa-sign-in", listEntitlement = SAML2SPEntitlement.IDP_READ, priority = 300)
+@ExtPage(label = "SAML 2.0 SP", icon = "fa-sign-in", listEntitlement = SAML2SPEntitlement.IDP_READ, priority = 400)
public class SAML2SP extends BaseExtPage {
private static final long serialVersionUID = -4837201407211278956L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
index 5c47843..196d731 100644
--- a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
+++ b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
@@ -25,7 +25,6 @@ import java.util.Map;
import java.util.Properties;
import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.PropertyUtils;
import org.apache.syncope.core.persistence.api.SyncopeLoader;
import org.apache.syncope.core.provisioning.api.EntitlementsHolder;
@@ -95,9 +94,8 @@ public class SAML2SPLoader implements SyncopeLoader {
public void load() {
EntitlementsHolder.getInstance().init(SAML2SPEntitlement.values());
- Pair<Properties, String> init = PropertyUtils.read(getClass(), SAML2SP_LOGIC_PROPERTIES, "conf.directory");
- Properties props = init.getLeft();
- String confDirectory = init.getRight();
+ Properties props = PropertyUtils.read(getClass(), SAML2SP_LOGIC_PROPERTIES, "conf.directory").getLeft();
+ String confDirectory = props.getProperty("conf.directory");
assertNotNull(confDirectory, "<conf.directory>");
@@ -174,5 +172,4 @@ public class SAML2SPLoader implements SyncopeLoader {
public String getSignatureAlgorithm() {
return signatureAlgorithm;
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/saml2sp/persistence-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/ext/saml2sp/persistence-jpa/pom.xml b/ext/saml2sp/persistence-jpa/pom.xml
index 356f5ed..fbe1e28 100644
--- a/ext/saml2sp/persistence-jpa/pom.xml
+++ b/ext/saml2sp/persistence-jpa/pom.xml
@@ -117,7 +117,7 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>sqlgenr</id>
+ <id>sqlgen</id>
<phase>process-classes</phase>
<goals>
<goal>sql</goal>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
index acfbeb2..a20a3b9 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
@@ -46,7 +46,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for SAML 2.0 Identity Providers.
*/
-@Tag(name = "SAML2IdP")
+@Tag(name = "SAML 2.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
index 06d0996..2495fb1 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
@@ -39,7 +39,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for the provided SAML 2.0 Service Provider.
*/
-@Tag(name = "SAML2SP")
+@Tag(name = "SAML 2.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java b/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
index f243bb5..917b076 100644
--- a/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
+++ b/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
@@ -37,7 +37,7 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@ExtPage(label = "SCIM 2.0", icon = "fa-cloud", listEntitlement = SCIMEntitlement.SCIM_CONF_GET, priority = 100)
+@ExtPage(label = "SCIM 2.0", icon = "fa-cloud", listEntitlement = SCIMEntitlement.SCIM_CONF_GET, priority = 500)
public class SCIMConfPage extends BaseExtPage {
protected static final Logger LOG = LoggerFactory.getLogger(SCIMConfPage.class);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
index 7e10f45..6faca11 100644
--- a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
+++ b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
@@ -36,7 +36,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for SCIM 2.0 configuration.
*/
-@Tag(name = "SCIMConf")
+@Tag(name = "SCIM 2.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
[07/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java
new file mode 100644
index 0000000..f3f1880
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserWorkflowAdapter.java
@@ -0,0 +1,488 @@
+/*
+ * 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.flowable.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.core.flowable.api.UserRequestHandler;
+import org.apache.syncope.core.flowable.api.WorkflowTaskManager;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.apache.syncope.core.spring.BeanUtils;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.apache.syncope.core.workflow.java.AbstractUserWorkflowAdapter;
+import org.flowable.bpmn.model.FlowElement;
+import org.flowable.bpmn.model.Gateway;
+import org.flowable.bpmn.model.SequenceFlow;
+import org.flowable.bpmn.model.Process;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class FlowableUserWorkflowAdapter extends AbstractUserWorkflowAdapter implements WorkflowTaskManager {
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ @Autowired
+ protected UserRequestHandler userRequestHandler;
+
+ @Override
+ public String getPrefix() {
+ return "ACT_";
+ }
+
+ @Override
+ public <T> T getVariable(final String executionId, final String variableName, final Class<T> variableClass) {
+ return engine.getRuntimeService().getVariable(executionId, variableName, variableClass);
+ }
+
+ @Override
+ public void setVariable(final String executionId, final String variableName, final Object value) {
+ engine.getRuntimeService().setVariable(executionId, variableName, value);
+ }
+
+ protected User lazyLoad(final User user) {
+ // using BeanUtils to access all user's properties and trigger lazy loading - we are about to
+ // serialize a User instance for availability within workflow tasks, and this breaks transactions
+ BeanUtils.copyProperties(user, entityFactory.newEntity(User.class));
+ return user;
+ }
+
+ @Override
+ protected WorkflowResult<Pair<String, Boolean>> doCreate(
+ final UserTO userTO,
+ final boolean disablePwdPolicyCheck,
+ final Boolean enabled,
+ final boolean storePassword) {
+
+ Map<String, Object> variables = new HashMap<>();
+ variables.put(FlowableRuntimeUtils.WF_EXECUTOR, AuthContextUtils.getUsername());
+ variables.put(FlowableRuntimeUtils.USER_TO, userTO);
+ variables.put(FlowableRuntimeUtils.ENABLED, enabled);
+ variables.put(FlowableRuntimeUtils.STORE_PASSWORD, storePassword);
+
+ ProcessInstance procInst = null;
+ try {
+ procInst = engine.getRuntimeService().
+ startProcessInstanceByKey(FlowableRuntimeUtils.WF_PROCESS_ID, variables);
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(
+ e, "While starting " + FlowableRuntimeUtils.WF_PROCESS_ID + " instance");
+ }
+
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.WF_EXECUTOR);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.USER_TO);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.STORE_PASSWORD);
+
+ User user = engine.getRuntimeService().
+ getVariable(procInst.getProcessInstanceId(), FlowableRuntimeUtils.USER, User.class);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.USER);
+
+ Boolean updatedEnabled = engine.getRuntimeService().
+ getVariable(procInst.getProcessInstanceId(), FlowableRuntimeUtils.ENABLED, Boolean.class);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.ENABLED);
+ if (updatedEnabled != null) {
+ user.setSuspended(!updatedEnabled);
+ }
+
+ // this will make UserValidator not to consider password policies at all
+ if (disablePwdPolicyCheck) {
+ user.removeClearPassword();
+ }
+
+ FlowableRuntimeUtils.updateStatus(engine, procInst.getProcessInstanceId(), user);
+ User created = userDAO.save(user);
+
+ engine.getRuntimeService().updateBusinessKey(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.getWFProcBusinessKey(created.getKey()));
+
+ Boolean propagateEnable = engine.getRuntimeService().getVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.class);
+ engine.getRuntimeService().removeVariable(
+ procInst.getProcessInstanceId(), FlowableRuntimeUtils.PROPAGATE_ENABLE);
+ if (propagateEnable == null) {
+ propagateEnable = enabled;
+ }
+
+ PropagationByResource propByRes = new PropagationByResource();
+ propByRes.set(ResourceOperation.CREATE, userDAO.findAllResourceKeys(created.getKey()));
+
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInst.getProcessInstanceId(),
+ created,
+ dataBinder.getUserTO(created, true),
+ userTO.getPassword(),
+ enabled,
+ propByRes);
+
+ Set<String> tasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInst.getProcessInstanceId(), user);
+
+ return new WorkflowResult<>(Pair.of(created.getKey(), propagateEnable), propByRes, tasks);
+ }
+
+ protected Set<String> doExecuteNextTask(
+ final String procInstID,
+ final User user,
+ final Map<String, Object> moreVariables) {
+
+ Set<String> preTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+
+ Map<String, Object> variables = new HashMap<>();
+ variables.put(FlowableRuntimeUtils.WF_EXECUTOR, AuthContextUtils.getUsername());
+ variables.put(FlowableRuntimeUtils.USER, lazyLoad(user));
+
+ if (moreVariables != null && !moreVariables.isEmpty()) {
+ variables.putAll(moreVariables);
+ }
+
+ List<Task> tasks = FlowableRuntimeUtils.createTaskQuery(engine, false).processInstanceId(procInstID).list();
+ String task = null;
+ if (tasks.size() == 1) {
+ try {
+ engine.getTaskService().complete(tasks.get(0).getId(), variables);
+ task = tasks.get(0).getTaskDefinitionKey();
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(
+ e, "While completing task '" + tasks.get(0).getName() + "' for " + user);
+ }
+ } else {
+ LOG.warn("Expected a single task, found {}", tasks.size());
+ }
+
+ Set<String> postTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+ postTasks.removeAll(preTasks);
+ if (task != null) {
+ postTasks.add(task);
+ }
+
+ return postTasks;
+ }
+
+ @Override
+ protected WorkflowResult<String> doActivate(final User user, final String token) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Map<String, Object> variables = new HashMap<>(2);
+ variables.put(FlowableRuntimeUtils.TOKEN, token);
+ variables.put(FlowableRuntimeUtils.TASK, "activate");
+
+ Set<String> tasks = doExecuteNextTask(procInstID, user, variables);
+
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ User updated = userDAO.save(user);
+
+ variables.keySet().forEach(key -> engine.getRuntimeService().removeVariable(procInstID, key));
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ return new WorkflowResult<>(updated.getKey(), null, tasks);
+ }
+
+ @Override
+ protected WorkflowResult<Pair<UserPatch, Boolean>> doUpdate(final User user, final UserPatch userPatch) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ // save some existing variable values for later processing, after actual update is made
+ UserPatch patchBeforeUpdate = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ PropagationByResource propByResBeforeUpdate = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+
+ // whether the initial status is a form task
+ boolean inFormTask = FlowableRuntimeUtils.getFormTask(engine, procInstID) != null;
+
+ Map<String, Object> variables = new HashMap<>(2);
+ variables.put(FlowableRuntimeUtils.USER_PATCH, userPatch);
+ variables.put(FlowableRuntimeUtils.TASK, "update");
+
+ Set<String> tasks = doExecuteNextTask(procInstID, user, variables);
+
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ User updated = userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+
+ // if the original status was a form task, restore the patch as before the process started
+ if (inFormTask) {
+ if (patchBeforeUpdate == null) {
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ } else {
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, patchBeforeUpdate);
+ }
+ }
+
+ // whether the after status is a form task
+ inFormTask = FlowableRuntimeUtils.getFormTask(engine, procInstID) != null;
+ if (!inFormTask) {
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ }
+
+ PropagationByResource propByRes = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE);
+
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ updated,
+ dataBinder.getUserTO(updated, true),
+ userPatch.getPassword() == null ? null : userPatch.getPassword().getValue(),
+ null,
+ propByResBeforeUpdate == null ? propByRes : propByResBeforeUpdate);
+
+ Boolean propagateEnable = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE);
+
+ return new WorkflowResult<>(Pair.of(userPatch, propagateEnable), propByRes, tasks);
+ }
+
+ @Override
+ protected WorkflowResult<String> doSuspend(final User user) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Set<String> performedTasks =
+ doExecuteNextTask(procInstID, user, Collections.singletonMap(FlowableRuntimeUtils.TASK, "suspend"));
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ User updated = userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ return new WorkflowResult<>(updated.getKey(), null, performedTasks);
+ }
+
+ @Override
+ protected WorkflowResult<String> doReactivate(final User user) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Set<String> performedTasks =
+ doExecuteNextTask(procInstID, user, Collections.singletonMap(FlowableRuntimeUtils.TASK, "reactivate"));
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+
+ User updated = userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ return new WorkflowResult<>(updated.getKey(), null, performedTasks);
+ }
+
+ @Override
+ protected void doRequestPasswordReset(final User user) {
+ Map<String, Object> variables = new HashMap<>(3);
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ variables.put(FlowableRuntimeUtils.TASK, "requestPasswordReset");
+ variables.put(FlowableRuntimeUtils.EVENT, "requestPasswordReset");
+
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ doExecuteNextTask(procInstID, user, variables);
+ userDAO.save(user);
+
+ variables.keySet().forEach(key -> engine.getRuntimeService().removeVariable(procInstID, key));
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+ }
+
+ @Override
+ protected WorkflowResult<Pair<UserPatch, Boolean>> doConfirmPasswordReset(
+ final User user, final String token, final String password) {
+
+ Map<String, Object> variables = new HashMap<>(5);
+ variables.put(FlowableRuntimeUtils.TOKEN, token);
+ variables.put(FlowableRuntimeUtils.PASSWORD, password);
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ variables.put(FlowableRuntimeUtils.TASK, "confirmPasswordReset");
+ variables.put(FlowableRuntimeUtils.EVENT, "confirmPasswordReset");
+
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Set<String> tasks = doExecuteNextTask(procInstID, user, variables);
+
+ userDAO.save(user);
+
+ variables.keySet().forEach(key -> engine.getRuntimeService().removeVariable(procInstID, key));
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+
+ PropagationByResource propByRes = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE);
+ UserPatch updatedPatch = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ Boolean propagateEnable = engine.getRuntimeService().getVariable(
+ procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROPAGATE_ENABLE);
+
+ return new WorkflowResult<>(Pair.of(updatedPatch, propagateEnable), propByRes, tasks);
+ }
+
+ @Override
+ protected void doDelete(final User user) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ doExecuteNextTask(procInstID, user, Collections.singletonMap(FlowableRuntimeUtils.TASK, "delete"));
+
+ PropagationByResource propByRes = new PropagationByResource();
+ propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceKeys(user.getKey()));
+
+ if (engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceId(procInstID).active().list().isEmpty()) {
+
+ userDAO.delete(user.getKey());
+
+ if (!engine.getHistoryService().createHistoricProcessInstanceQuery().
+ processInstanceId(procInstID).list().isEmpty()) {
+
+ engine.getHistoryService().deleteHistoricProcessInstance(procInstID);
+ }
+ } else {
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ user,
+ dataBinder.getUserTO(user, true),
+ null,
+ null,
+ propByRes);
+
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ userDAO.save(user);
+
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.WF_EXECUTOR);
+ }
+ }
+
+ @Override
+ public WorkflowResult<String> executeNextTask(final WorkflowTaskExecInput workflowTaskExecInput) {
+ User user = userDAO.authFind(workflowTaskExecInput.getUserKey());
+
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey());
+
+ Map<String, Object> variables = new HashMap<>();
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ variables.putAll(workflowTaskExecInput.getVariables());
+
+ Set<String> performedTasks = doExecuteNextTask(procInstID, user, variables);
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ user = userDAO.save(user);
+
+ engine.getRuntimeService().setVariable(
+ procInstID, FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+
+ if (engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceId(procInstID).active().list().isEmpty()) {
+
+ userDAO.delete(user.getKey());
+
+ if (!engine.getHistoryService().createHistoricProcessInstanceQuery().
+ processInstanceId(procInstID).list().isEmpty()) {
+
+ engine.getHistoryService().deleteHistoricProcessInstance(procInstID);
+ }
+ } else {
+ PropagationByResource propByRes = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ user,
+ dataBinder.getUserTO(user, true),
+ null,
+ null,
+ propByRes);
+ }
+
+ return new WorkflowResult<>(user.getKey(), null, performedTasks);
+ }
+
+ protected void navigateAvailableTasks(final FlowElement flow, final List<String> availableTasks) {
+ if (flow instanceof Gateway) {
+ ((Gateway) flow).getOutgoingFlows().forEach(subflow -> navigateAvailableTasks(subflow, availableTasks));
+ } else if (flow instanceof SequenceFlow) {
+ navigateAvailableTasks(((SequenceFlow) flow).getTargetFlowElement(), availableTasks);
+ } else if (flow instanceof org.flowable.bpmn.model.Task) {
+ availableTasks.add(flow.getId());
+ } else {
+ LOG.debug("Unexpected flow found: {}", flow);
+ }
+ }
+
+ @Override
+ public List<WorkflowTask> getAvailableTasks(final String userKey) {
+ String procInstID = FlowableRuntimeUtils.getWFProcInstID(engine, userKey);
+
+ List<String> availableTasks = new ArrayList<>();
+ try {
+ Task currentTask = FlowableRuntimeUtils.createTaskQuery(engine, false).
+ processInstanceId(procInstID).singleResult();
+
+ Process process = engine.getRepositoryService().
+ getBpmnModel(FlowableRuntimeUtils.getLatestProcDefByKey(
+ engine, FlowableRuntimeUtils.WF_PROCESS_ID).getId()).getProcesses().get(0);
+ process.getFlowElements().stream().
+ filter(SequenceFlow.class::isInstance).
+ map(SequenceFlow.class::cast).
+ filter(sequenceFlow -> sequenceFlow.getSourceRef().equals(currentTask.getTaskDefinitionKey())).
+ forEach(sequenceFlow -> {
+ navigateAvailableTasks(sequenceFlow.getTargetFlowElement(), availableTasks);
+ });
+ } catch (FlowableException e) {
+ throw new WorkflowException(
+ "While reading available tasks for workflow instance " + procInstID, e);
+ }
+
+ return availableTasks.stream().map(input -> {
+ WorkflowTask workflowTaskTO = new WorkflowTask();
+ workflowTaskTO.setName(input);
+ return workflowTaskTO;
+ }).collect(Collectors.toList());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java
new file mode 100644
index 0000000..d5fcd41
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableWorkflowUtils.java
@@ -0,0 +1,47 @@
+/*
+ * 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.flowable.impl;
+
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+public class FlowableWorkflowUtils {
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ @Transactional(readOnly = true)
+ public boolean isUserIngroup(final UserTO user, final String groupName) {
+ return user.getMemberships().stream().
+ anyMatch(membership -> groupName != null && groupName.equals(membership.getGroupName()));
+ }
+
+ public void setUserWorkflowVariable(final String variableName, final Object value, final User user) {
+ engine.getRuntimeService().
+ setVariable(FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey()), variableName, value);
+ }
+
+ public Object getUserWorkflowVariable(final String variableName, final User user) {
+ return engine.getRuntimeService().
+ getVariable(FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey()), variableName);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java
new file mode 100644
index 0000000..eb36838
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/SyncopeTaskQueryImpl.java
@@ -0,0 +1,49 @@
+/*
+ * 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.flowable.impl;
+
+import org.flowable.common.engine.impl.interceptor.CommandExecutor;
+import org.flowable.task.api.TaskQuery;
+import org.flowable.task.service.impl.TaskQueryImpl;
+
+public class SyncopeTaskQueryImpl extends TaskQueryImpl {
+
+ private static final long serialVersionUID = 734215641378485689L;
+
+ protected boolean withFormKey;
+
+ protected SyncopeTaskQueryImpl currentOrQueryObject;
+
+ public SyncopeTaskQueryImpl(final CommandExecutor commandExecutor) {
+ super(commandExecutor);
+ }
+
+ public TaskQuery taskWithFormKey() {
+ if (orActive) {
+ currentOrQueryObject.withFormKey = true;
+ } else {
+ this.withFormKey = true;
+ }
+ return this;
+ }
+
+ public boolean isWithFormKey() {
+ return withFormKey;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java
new file mode 100644
index 0000000..1b056c1
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngine.java
@@ -0,0 +1,114 @@
+/*
+ * 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.flowable.support;
+
+import java.util.Collections;
+import java.util.Map;
+import javax.sql.DataSource;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.flowable.engine.DynamicBpmnService;
+import org.flowable.engine.FormService;
+import org.flowable.engine.HistoryService;
+import org.flowable.engine.IdentityService;
+import org.flowable.engine.ManagementService;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.engine.ProcessEngineConfiguration;
+import org.flowable.engine.RepositoryService;
+import org.flowable.engine.RuntimeService;
+import org.flowable.engine.TaskService;
+import org.flowable.engine.impl.ProcessEngineImpl;
+
+/**
+ * {@link ProcessEngine} delegating actual method invocation to the inner map of {@link ProcessEngine} instances,
+ * one for each Syncope domain.
+ */
+public class DomainProcessEngine implements ProcessEngine {
+
+ private final Map<String, ProcessEngine> engines;
+
+ public DomainProcessEngine(final Map<String, ProcessEngine> engines) {
+ this.engines = Collections.synchronizedMap(engines);
+ }
+
+ public Map<String, ProcessEngine> getEngines() {
+ return engines;
+ }
+
+ @Override
+ public String getName() {
+ return engines.get(AuthContextUtils.getDomain()).getName();
+ }
+
+ @Override
+ public void close() {
+ engines.values().forEach(engine -> {
+ engine.close();
+ });
+ }
+
+ @Override
+ public RepositoryService getRepositoryService() {
+ return engines.get(AuthContextUtils.getDomain()).getRepositoryService();
+ }
+
+ @Override
+ public RuntimeService getRuntimeService() {
+ return engines.get(AuthContextUtils.getDomain()).getRuntimeService();
+ }
+
+ @Override
+ public FormService getFormService() {
+ return engines.get(AuthContextUtils.getDomain()).getFormService();
+ }
+
+ @Override
+ public TaskService getTaskService() {
+ return engines.get(AuthContextUtils.getDomain()).getTaskService();
+ }
+
+ @Override
+ public HistoryService getHistoryService() {
+ return engines.get(AuthContextUtils.getDomain()).getHistoryService();
+ }
+
+ @Override
+ public IdentityService getIdentityService() {
+ return engines.get(AuthContextUtils.getDomain()).getIdentityService();
+ }
+
+ @Override
+ public ManagementService getManagementService() {
+ return engines.get(AuthContextUtils.getDomain()).getManagementService();
+ }
+
+ @Override
+ public ProcessEngineConfiguration getProcessEngineConfiguration() {
+ return engines.get(AuthContextUtils.getDomain()).getProcessEngineConfiguration();
+ }
+
+ @Override
+ public DynamicBpmnService getDynamicBpmnService() {
+ return engines.get(AuthContextUtils.getDomain()).getDynamicBpmnService();
+ }
+
+ public DataSource getDataSource() {
+ ProcessEngineImpl engine = (ProcessEngineImpl) engines.get(AuthContextUtils.getDomain());
+ return engine.getProcessEngineConfiguration().getDataSource();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java
new file mode 100644
index 0000000..d1c3299
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java
@@ -0,0 +1,32 @@
+/*
+ * 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.flowable.support;
+
+import java.io.InputStream;
+import org.flowable.spring.SpringProcessEngineConfiguration;
+
+public class DomainProcessEngineConfiguration extends SpringProcessEngineConfiguration {
+
+ private static final String SYNCOPE_MYBATIS_MAPPING_FILE = "org/apache/syncope/ext/flowable/mappings.xml";
+
+ @Override
+ public InputStream getMyBatisXmlConfigurationStream() {
+ return getResourceAsStream(SYNCOPE_MYBATIS_MAPPING_FILE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
new file mode 100644
index 0000000..162b113
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
@@ -0,0 +1,112 @@
+/*
+ * 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.flowable.support;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.DataSource;
+import org.apache.commons.lang3.StringUtils;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.common.engine.impl.cfg.SpringBeanFactoryProxyMap;
+import org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants;
+import org.flowable.engine.impl.util.EngineServiceUtil;
+import org.flowable.idm.spring.SpringIdmEngineConfiguration;
+import org.flowable.spring.SpringExpressionManager;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.PlatformTransactionManager;
+
+/**
+ * Spring factory for {@link DomainProcessEngine} which takes the provided {@link DomainProcessEngineConfiguration} as
+ * template for each of the configured Syncope domains.
+ */
+@Component
+public class DomainProcessEngineFactoryBean
+ implements FactoryBean<DomainProcessEngine>, DisposableBean, ApplicationContextAware {
+
+ private ApplicationContext ctx;
+
+ private DomainProcessEngine engine;
+
+ @Override
+ public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
+ this.ctx = ctx;
+ }
+
+ @Override
+ public DomainProcessEngine getObject() throws Exception {
+ if (engine == null) {
+ Map<String, ProcessEngine> engines = new HashMap<>();
+
+ ctx.getBeansOfType(DataSource.class).forEach((key, dataSource) -> {
+ if (!key.startsWith("local")) {
+ String domain = StringUtils.substringBefore(key, DataSource.class.getSimpleName());
+ PlatformTransactionManager transactionManager = ctx.getBean(
+ domain + "TransactionManager", PlatformTransactionManager.class);
+ Object entityManagerFactory = ctx.getBean(domain + "EntityManagerFactory");
+
+ DomainProcessEngineConfiguration conf = ctx.getBean(DomainProcessEngineConfiguration.class);
+ conf.setDataSource(dataSource);
+ conf.setTransactionManager(transactionManager);
+ conf.setTransactionsExternallyManaged(true);
+ conf.setJpaEntityManagerFactory(entityManagerFactory);
+ if (conf.getBeans() == null) {
+ conf.setBeans(new SpringBeanFactoryProxyMap(ctx));
+ }
+ if (conf.getExpressionManager() == null) {
+ conf.setExpressionManager(new SpringExpressionManager(ctx, conf.getBeans()));
+ }
+ if (EngineServiceUtil.getIdmEngineConfiguration(conf) == null) {
+ conf.addEngineConfiguration(
+ EngineConfigurationConstants.KEY_IDM_ENGINE_CONFIG,
+ ctx.getBean(SpringIdmEngineConfiguration.class));
+ }
+
+ engines.put(domain, conf.buildProcessEngine());
+ }
+ });
+
+ engine = new DomainProcessEngine(engines);
+ }
+
+ return engine;
+ }
+
+ @Override
+ public Class<DomainProcessEngine> getObjectType() {
+ return DomainProcessEngine.class;
+ }
+
+ @Override
+ public boolean isSingleton() {
+ return true;
+ }
+
+ @Override
+ public void destroy() throws Exception {
+ if (engine != null) {
+ engine.close();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java
new file mode 100644
index 0000000..9009abb
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeEntitiesVariableType.java
@@ -0,0 +1,35 @@
+/*
+ * 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.flowable.support;
+
+import org.apache.syncope.core.persistence.api.entity.Entity;
+import org.flowable.variable.service.impl.types.SerializableType;
+
+/**
+ * Flowable variable type for handling Syncope entities as Flowable variables.
+ * Main purpose: avoid Flowable to handle Syncope entities as JPA entities,
+ * since this can cause troubles with transactions.
+ */
+public class SyncopeEntitiesVariableType extends SerializableType {
+
+ @Override
+ public boolean isAbleToStore(final Object value) {
+ return value instanceof Entity;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java
new file mode 100644
index 0000000..e7437dd
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeGroupQueryImpl.java
@@ -0,0 +1,89 @@
+/*
+ * 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.flowable.support;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.syncope.core.persistence.api.dao.GroupDAO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.flowable.idm.api.Group;
+import org.flowable.idm.engine.impl.GroupQueryImpl;
+import org.flowable.idm.engine.impl.persistence.entity.GroupEntity;
+import org.flowable.idm.engine.impl.persistence.entity.GroupEntityImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+public class SyncopeGroupQueryImpl extends GroupQueryImpl {
+
+ private static final long serialVersionUID = -2595069675443343682L;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Autowired
+ private GroupDAO groupDAO;
+
+ private List<Group> result;
+
+ private Group fromSyncopeGroup(final String name) {
+ GroupEntity group = new GroupEntityImpl();
+ group.setId(name);
+ return group;
+ }
+
+ private void execute() {
+ if (id != null) {
+ org.apache.syncope.core.persistence.api.entity.group.Group syncopeGroup = groupDAO.findByName(id);
+ if (syncopeGroup == null) {
+ result = Collections.emptyList();
+ } else {
+ result = Collections.singletonList(fromSyncopeGroup(syncopeGroup.getName()));
+ }
+ } else if (userId != null) {
+ result = userDAO.findAllGroupNames(userDAO.findByUsername(userId)).stream().
+ map(groupName -> fromSyncopeGroup(groupName)).
+ collect(Collectors.toList());
+ }
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public long count() {
+ checkQueryOk();
+
+ this.resultType = ResultType.COUNT;
+ if (result == null) {
+ execute();
+ }
+ return result.size();
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public List<Group> list() {
+ checkQueryOk();
+
+ this.resultType = ResultType.LIST;
+ if (result == null) {
+ execute();
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.java
new file mode 100644
index 0000000..6b9c4f6
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeIdmIdentityService.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.core.flowable.support;
+
+import org.flowable.idm.api.GroupQuery;
+import org.flowable.idm.api.UserQuery;
+import org.flowable.idm.engine.impl.IdmIdentityServiceImpl;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ConfigurableApplicationContext;
+
+public class SyncopeIdmIdentityService extends IdmIdentityServiceImpl implements ApplicationContextAware {
+
+ private ConfigurableApplicationContext ctx;
+
+ @Override
+ public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
+ this.ctx = (ConfigurableApplicationContext) ctx;
+ }
+
+ @Override
+ public UserQuery createUserQuery() {
+ return (UserQuery) ctx.getBeanFactory().
+ createBean(SyncopeUserQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+ }
+
+ @Override
+ public GroupQuery createGroupQuery() {
+ return (GroupQuery) ctx.getBeanFactory().
+ createBean(SyncopeGroupQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java
new file mode 100644
index 0000000..56e6c88
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSession.java
@@ -0,0 +1,26 @@
+/*
+ * 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.flowable.support;
+
+import org.flowable.common.engine.impl.interceptor.Session;
+
+public interface SyncopeSession extends Session {
+
+ Class<?> getType();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java
new file mode 100644
index 0000000..0c1789b
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeSessionFactory.java
@@ -0,0 +1,46 @@
+/*
+ * 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.flowable.support;
+
+import org.flowable.common.engine.impl.interceptor.CommandContext;
+import org.flowable.common.engine.impl.interceptor.Session;
+import org.flowable.common.engine.impl.interceptor.SessionFactory;
+
+public class SyncopeSessionFactory implements SessionFactory {
+
+ private SyncopeSession syncopeSession;
+
+ @Override
+ public Class<?> getSessionType() {
+ return syncopeSession.getType();
+ }
+
+ @Override
+ public Session openSession(final CommandContext cc) {
+ return syncopeSession;
+ }
+
+ public SyncopeSession getSyncopeSession() {
+ return syncopeSession;
+ }
+
+ public void setSyncopeSession(final SyncopeSession syncopeSession) {
+ this.syncopeSession = syncopeSession;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java
new file mode 100644
index 0000000..25d9ab5
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeUserQueryImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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.flowable.support;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.core.persistence.api.dao.GroupDAO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.group.Group;
+import org.apache.syncope.core.persistence.api.entity.user.UMembership;
+import org.flowable.idm.api.User;
+import org.flowable.idm.engine.impl.UserQueryImpl;
+import org.flowable.idm.engine.impl.persistence.entity.UserEntity;
+import org.flowable.idm.engine.impl.persistence.entity.UserEntityImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+public class SyncopeUserQueryImpl extends UserQueryImpl {
+
+ private static final long serialVersionUID = 4403344392227706318L;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Autowired
+ private GroupDAO groupDAO;
+
+ private List<User> result;
+
+ private User fromSyncopeUser(final org.apache.syncope.core.persistence.api.entity.user.User syncopeUser) {
+ UserEntity user = new UserEntityImpl();
+ user.setId(syncopeUser.getUsername());
+ return user;
+ }
+
+ private void execute() {
+ if (id != null) {
+ org.apache.syncope.core.persistence.api.entity.user.User user = userDAO.findByUsername(id);
+ if (user == null) {
+ result = Collections.<User>emptyList();
+ } else if (groupId == null || userDAO.findAllGroupNames(user).contains(groupId)) {
+ result = Collections.singletonList(fromSyncopeUser(user));
+ }
+ } else if (groupId != null) {
+ Group group = groupDAO.findByName(groupId);
+ if (group == null) {
+ result = Collections.<User>emptyList();
+ } else {
+ result = new ArrayList<>();
+ List<UMembership> memberships = groupDAO.findUMemberships(group);
+ memberships.stream().map(membership -> fromSyncopeUser(membership.getLeftEnd())).
+ filter(user -> (!result.contains(user))).
+ forEachOrdered(user -> {
+ result.add(user);
+ });
+ }
+ }
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public long count() {
+ checkQueryOk();
+
+ this.resultType = ResultType.COUNT;
+ if (result == null) {
+ execute();
+ }
+ return result.size();
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public List<User> list() {
+ checkQueryOk();
+
+ this.resultType = ResultType.LIST;
+ if (result == null) {
+ execute();
+ }
+ return result;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java
new file mode 100644
index 0000000..692a161
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AbstractFlowableServiceTask.java
@@ -0,0 +1,45 @@
+/*
+ * 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.flowable.task;
+
+import org.flowable.engine.ProcessEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Abstract base class for Flowable's service tasks in Syncope, with Spring support.
+ */
+@Component
+public abstract class AbstractFlowableServiceTask {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractFlowableServiceTask.class);
+
+ @Autowired
+ protected ProcessEngine engine;
+
+ @Transactional(rollbackFor = { Throwable.class })
+ public void execute(final String executionId) {
+ doExecute(executionId);
+ }
+
+ protected abstract void doExecute(final String executionId);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java
new file mode 100644
index 0000000..3febfa0
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/AutoActivate.java
@@ -0,0 +1,60 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.AnyOperations;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AutoActivate extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+ UserTO userTO = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_TO, UserTO.class);
+ if (userTO != null && userTO.getKey() != null && user.getKey() != null) {
+ user = userDAO.save(user);
+
+ UserPatch userPatch = AnyOperations.diff(userTO, dataBinder.getUserTO(user, true), false);
+ // don't mess with password, as the cleartext values was already properly saved
+ userPatch.setPassword(null);
+
+ dataBinder.update(user, userPatch);
+
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ }
+
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROPAGATE_ENABLE, Boolean.TRUE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java
new file mode 100644
index 0000000..75bf0ac
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Create.java
@@ -0,0 +1,55 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.persistence.api.entity.EntityFactory;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Create extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private EntityFactory entityFactory;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ UserTO userTO = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_TO, UserTO.class);
+ Boolean storePassword = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.STORE_PASSWORD, Boolean.class);
+
+ // create user
+ User user = entityFactory.newEntity(User.class);
+ dataBinder.create(user, userTO, storePassword == null ? true : storePassword);
+
+ // report user as result
+ engine.getRuntimeService().
+ setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().
+ setVariable(executionId, FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java
new file mode 100644
index 0000000..7f3acf6
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Delete.java
@@ -0,0 +1,41 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Delete extends AbstractFlowableServiceTask {
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ // Do something with user...
+ if (user != null) {
+ user.checkToken("");
+ }
+
+ // remove user variable
+ engine.getRuntimeService().removeVariable(executionId, FlowableRuntimeUtils.USER);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java
new file mode 100644
index 0000000..aee2b73
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java
@@ -0,0 +1,44 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.core.persistence.api.dao.ConfDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class GenerateToken extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private ConfDAO confDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ user.generateToken(
+ confDAO.find("token.length", 256L).intValue(),
+ confDAO.find("token.expireTime", 60L).intValue());
+
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java
new file mode 100644
index 0000000..d64032f
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Notify.java
@@ -0,0 +1,64 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AuditElements;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.notification.NotificationManager;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * General-purpose notification task for usage within workflow.
+ * It requires a pre-existing Notification with category {@code CUSTOM} and result {@code SUCCESS}.
+ * An {@code event} workflow variable needs to be provided as well.
+ */
+@Component
+public class Notify extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private NotificationManager notificationManager;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+ UserTO userTO = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_TO, UserTO.class);
+ String event = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.EVENT, String.class);
+
+ if (StringUtils.isNotBlank(event)) {
+ notificationManager.createTasks(
+ AuditElements.EventCategoryType.CUSTOM,
+ null,
+ null,
+ event,
+ AuditElements.Result.SUCCESS,
+ userTO,
+ null,
+ user.getToken());
+ } else {
+ LOG.debug("Not sending any notification since no event was found");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java
new file mode 100644
index 0000000..1c36202
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/PasswordReset.java
@@ -0,0 +1,70 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.patch.PasswordPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class PasswordReset extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+ String token = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.TOKEN, String.class);
+ String password = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.PASSWORD, String.class);
+
+ if (!user.checkToken(token)) {
+ throw new WorkflowException(new IllegalArgumentException("Wrong token: " + token + " for " + user));
+ }
+
+ user.removeToken();
+
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(user.getKey());
+ userPatch.setPassword(new PasswordPatch.Builder().
+ onSyncope(true).
+ resources(userDAO.findAllResourceKeys(user.getKey())).
+ value(password).build());
+
+ PropagationByResource propByRes = dataBinder.update(user, userPatch);
+
+ // report updated user and propagation by resource as result
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER_PATCH, userPatch);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java
new file mode 100644
index 0000000..d6b2c27
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Reactivate.java
@@ -0,0 +1,29 @@
+/*
+ * 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.flowable.task;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class Reactivate extends AbstractFlowableServiceTask {
+
+ @Override
+ protected void doExecute(final String executionId) {
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java
new file mode 100644
index 0000000..8e9439b
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Suspend.java
@@ -0,0 +1,29 @@
+/*
+ * 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.flowable.task;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class Suspend extends AbstractFlowableServiceTask {
+
+ @Override
+ protected void doExecute(final String executionId) {
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java
new file mode 100644
index 0000000..c7007ad
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java
@@ -0,0 +1,58 @@
+/*
+ * 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.flowable.task;
+
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Update extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ UserPatch userPatch = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ if (userPatch == null || userPatch.isEmpty()) {
+ LOG.warn("No actual update is to be performed: null patch");
+ } else {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ user = userDAO.save(user);
+
+ PropagationByResource propByRes = dataBinder.update(user, userPatch);
+
+ // report updated user and propagation by resource as result
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ }
+ }
+}
[34/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
[SYNCOPE-1369] Flowable support refactored as extension + code review (now with variable cleanup)
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/66b3a04e
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/66b3a04e
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/66b3a04e
Branch: refs/heads/2_1_X
Commit: 66b3a04eefea6c23a3f364fbf159bee7c7a00b1f
Parents: 8c103a8
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Sep 25 14:16:59 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Sep 25 14:31:46 2018 +0200
----------------------------------------------------------------------
archetype/pom.xml | 4 -
.../archetype-resources/console/pom.xml | 87 +-
.../resources/archetype-resources/core/pom.xml | 4 +-
archetype/src/main/resources/meta-pom.xml | 6 -
.../syncope/client/cli/commands/info/Info.java | 12 -
.../client/cli/commands/info/InfoCommand.java | 4 -
.../cli/commands/info/InfoResultManager.java | 9 -
.../commands/self/AbstractWorkflowCommand.java | 27 -
.../cli/commands/self/WorkflowCommand.java | 97 --
.../commands/self/WorkflowExportDefinition.java | 61 -
.../commands/self/WorkflowExportDiagram.java | 70 -
.../commands/self/WorkflowResultManager.java | 25 -
.../self/WorkflowSyncopeOperations.java | 41 -
.../cli/src/main/resources/messages.properties | 1 -
.../client/cli/util/CommandUtilsTest.java | 2 +-
.../console/SyncopeConsoleApplication.java | 54 +-
.../client/console/annotations/Resource.java | 41 +
.../client/console/approvals/Approval.java | 206 ---
.../console/approvals/ApprovalDetails.java | 63 -
.../approvals/ApprovalDirectoryPanel.java | 358 -----
.../client/console/approvals/ApprovalModal.java | 82 -
.../client/console/commons/Constants.java | 2 -
.../init/ClassPathScanImplementationLookup.java | 56 +-
.../syncope/client/console/pages/Approvals.java | 41 -
.../syncope/client/console/pages/BasePage.java | 52 +-
.../console/pages/FlowableModelerPopupPage.java | 27 -
.../syncope/client/console/pages/Workflow.java | 64 -
.../console/panels/NewWorkflowProcess.java | 87 --
.../panels/ParametersDirectoryPanel.java | 1 -
.../client/console/panels/TogglePanel.java | 6 -
.../console/panels/WorkflowDirectoryPanel.java | 333 ----
.../resources/AbstractWorkflowResource.java | 51 -
.../console/resources/FilesystemResource.java | 79 -
.../resources/WorkflowDefGETResource.java | 58 -
.../resources/WorkflowDefPUTResource.java | 74 -
.../console/rest/UserWorkflowRestClient.java | 59 -
.../client/console/rest/WorkflowRestClient.java | 73 -
.../wicket/markup/html/form/ActionLink.java | 4 +-
.../html/form/ActionLinksTogglePanel.java | 8 +-
.../wicket/markup/html/form/ActionPanel.java | 2 +-
.../client/console/widgets/ApprovalsWidget.java | 128 --
.../client/console/widgets/ExtAlertWidget.java | 30 +
.../src/main/resources/console.properties | 3 -
.../client/console/approvals/Approval.html | 31 -
.../console/approvals/Approval.properties | 18 -
.../console/approvals/ApprovalDetails.html | 23 -
.../client/console/approvals/ApprovalModal.html | 23 -
.../console/approvals/ApprovalModal.properties | 17 -
.../approvals/ApprovalModal_it.properties | 17 -
.../approvals/ApprovalModal_ja.properties | 17 -
.../approvals/ApprovalModal_pt_BR.properties | 17 -
.../approvals/ApprovalModal_ru.properties | 17 -
.../console/approvals/Approval_it.properties | 18 -
.../console/approvals/Approval_ja.properties | 18 -
.../console/approvals/Approval_pt_BR.properties | 18 -
.../console/approvals/Approval_ru.properties | 20 -
.../syncope/client/console/pages/Approvals.html | 35 -
.../client/console/pages/Approvals.properties | 34 -
.../console/pages/Approvals_it.properties | 34 -
.../console/pages/Approvals_ja.properties | 34 -
.../console/pages/Approvals_pt_BR.properties | 34 -
.../console/pages/Approvals_ru.properties | 52 -
.../syncope/client/console/pages/BasePage.html | 5 +-
.../console/pages/FlowableModelerPopupPage.html | 28 -
.../syncope/client/console/pages/Workflow.html | 37 -
.../client/console/pages/Workflow.properties | 19 -
.../client/console/pages/Workflow_it.properties | 19 -
.../client/console/pages/Workflow_ja.properties | 19 -
.../console/pages/Workflow_pt_BR.properties | 19 -
.../client/console/pages/Workflow_ru.properties | 19 -
.../console/panels/NewWorkflowProcess.html | 32 -
.../console/panels/WorkflowDirectoryPanel.html | 23 -
.../client/console/panels/empty.bpmn20.xml | 49 -
.../markup/html/form/ActionPanel.properties | 6 +-
.../markup/html/form/ActionPanel_it.properties | 6 +-
.../markup/html/form/ActionPanel_ja.properties | 6 +-
.../html/form/ActionPanel_pt_BR.properties | 6 +-
.../markup/html/form/ActionPanel_ru.properties | 6 +-
.../console/widgets/ApprovalsWidget.properties | 21 -
.../widgets/ApprovalsWidget_it.properties | 21 -
.../widgets/ApprovalsWidget_ja.properties | 21 -
.../widgets/ApprovalsWidget_pt_BR.properties | 21 -
.../widgets/ApprovalsWidget_ru.properties | 22 -
.../enduser/SyncopeEnduserApplication.java | 10 +-
.../syncope/common/lib/PropertyUtils.java | 17 +-
.../lib/report/ReconciliationReportletConf.java | 1 -
.../common/lib/report/UserReportletConf.java | 1 -
.../common/lib/to/WorkflowDefinitionTO.java | 71 -
.../common/lib/to/WorkflowFormPropertyTO.java | 124 --
.../syncope/common/lib/to/WorkflowFormTO.java | 147 --
.../syncope/common/lib/to/WorkflowTaskTO.java | 40 -
.../common/lib/types/StandardEntitlement.java | 18 -
.../lib/types/WorkflowFormPropertyType.java | 32 -
.../syncope/common/lib/types/WorkflowTasks.java | 47 -
.../org/apache/syncope/common/lib/JSONTest.java | 10 +-
.../rest/api/beans/WorkflowFormQuery.java | 32 -
.../common/rest/api/service/AnyService.java | 3 +
.../api/service/SecurityQuestionService.java | 2 +-
.../rest/api/service/UserWorkflowService.java | 118 --
.../rest/api/service/WorkflowService.java | 121 --
.../core/logic/SecurityQuestionLogic.java | 6 +-
.../syncope/core/logic/UserWorkflowLogic.java | 137 --
.../syncope/core/logic/WorkflowLogic.java | 113 --
.../core/persistence/api/dao/AnyDAO.java | 2 -
.../core/persistence/api/entity/Any.java | 4 -
.../core/persistence/api/entity/user/User.java | 9 -
.../persistence/jpa/dao/AbstractAnyDAO.java | 18 -
.../persistence/jpa/dao/JPAAnyObjectDAO.java | 4 +-
.../core/persistence/jpa/dao/JPAGroupDAO.java | 4 +-
.../jpa/dao/JPASecurityQuestionDAO.java | 10 +-
.../core/persistence/jpa/dao/JPAUserDAO.java | 4 +-
.../persistence/jpa/entity/AbstractAny.java | 12 -
.../jpa/entity/JPAEntityFactory.java | 1 +
.../jpa/entity/JPASecurityQuestion.java | 47 -
.../persistence/jpa/entity/conf/JPAConf.java | 10 -
.../jpa/entity/user/JPASecurityQuestion.java | 48 +
.../persistence/jpa/entity/user/JPAUser.java | 45 -
...ltiJarAwarePersistenceUnitPostProcessor.java | 6 +-
.../main/resources/domains/MasterContent.xml | 15 +-
.../jpa/inner/ImplementationTest.java | 4 +-
.../persistence/jpa/inner/MultitenancyTest.java | 2 +-
.../persistence/jpa/inner/PlainSchemaTest.java | 2 +-
.../core/persistence/jpa/inner/TaskTest.java | 2 +-
.../test/resources/domains/MasterContent.xml | 27 +-
.../src/test/resources/domains/TwoContent.xml | 14 -
core/pom.xml | 1 -
.../provisioning/api/event/AnyDeletedEvent.java | 8 +
.../java/job/IdentityRecertification.java | 126 --
.../job/report/ReconciliationReportlet.java | 5 -
.../java/job/report/UserReportlet.java | 5 -
.../cxf/service/UserWorkflowServiceImpl.java | 70 -
.../rest/cxf/service/WorkflowServiceImpl.java | 83 -
.../core/spring/security/AuthContextUtils.java | 29 +-
.../core/spring/security/SecureRandomUtils.java | 4 +
core/upgrade/src/main/resources/schema.xml | 5 -
.../core/upgrade/GeneratedUpgradeSQLTest.java | 2 +-
core/upgrade/src/test/resources/syncopedb20.sql | 76 +-
.../workflow/api/AnyObjectWorkflowAdapter.java | 9 -
.../api/AnyObjectWorkflowDefinitionAdapter.java | 22 -
.../core/workflow/api/GroupWorkflowAdapter.java | 9 -
.../api/GroupWorkflowDefinitionAdapter.java | 22 -
.../core/workflow/api/UserWorkflowAdapter.java | 18 -
.../api/UserWorkflowDefinitionAdapter.java | 22 -
.../core/workflow/api/WorkflowAdapter.java | 50 -
.../workflow/api/WorkflowDefinitionAdapter.java | 64 -
.../workflow/api/WorkflowDefinitionFormat.java | 29 -
core/workflow-flowable/pom.xml | 82 -
.../flowable/FlowableDefinitionLoader.java | 92 --
.../workflow/flowable/FlowableDeployUtils.java | 92 --
.../flowable/FlowableUserWorkflowAdapter.java | 1035 -------------
.../core/workflow/flowable/FlowableUtils.java | 31 -
.../flowable/SyncopeEntitiesVariableType.java | 35 -
.../flowable/SyncopeGroupQueryImpl.java | 89 --
.../flowable/SyncopeIdmIdentityService.java | 51 -
.../core/workflow/flowable/SyncopeSession.java | 26 -
.../flowable/SyncopeSessionFactory.java | 46 -
.../workflow/flowable/SyncopeUserQueryImpl.java | 101 --
.../flowable/spring/DomainProcessEngine.java | 114 --
.../spring/DomainProcessEngineFactoryBean.java | 111 --
.../task/AbstractFlowableServiceTask.java | 45 -
.../workflow/flowable/task/AutoActivate.java | 60 -
.../core/workflow/flowable/task/Create.java | 52 -
.../core/workflow/flowable/task/Delete.java | 41 -
.../workflow/flowable/task/GenerateToken.java | 44 -
.../core/workflow/flowable/task/Notify.java | 65 -
.../workflow/flowable/task/PasswordReset.java | 71 -
.../core/workflow/flowable/task/Reactivate.java | 29 -
.../core/workflow/flowable/task/Recertify.java | 58 -
.../core/workflow/flowable/task/Suspend.java | 29 -
.../core/workflow/flowable/task/Update.java | 54 -
.../src/main/resources/userWorkflow.bpmn20.xml | 287 ----
.../src/main/resources/workflow.properties | 21 -
.../main/resources/workflowFlowableContext.xml | 63 -
.../java/AbstractAnyObjectWorkflowAdapter.java | 4 +-
.../java/AbstractGroupWorkflowAdapter.java | 3 +-
.../java/AbstractUserWorkflowAdapter.java | 16 +-
.../java/DefaultAnyObjectWorkflowAdapter.java | 68 -
.../java/DefaultGroupWorkflowAdapter.java | 67 -
.../java/DefaultUserWorkflowAdapter.java | 70 -
deb/console/pom.xml | 5 +
deb/core/pom.xml | 4 +-
docker/console/pom.xml | 4 -
docker/console/src/main/resources/Dockerfile | 1 -
.../main/resources/console.properties.template | 2 -
ext/camel/persistence-jpa/pom.xml | 2 +-
.../rest/api/service/CamelRouteService.java | 2 +-
.../client/ElasticsearchUtils.java | 4 +-
ext/flowable/client-console/pom.xml | 137 ++
.../client/console/approvals/Approval.java | 206 +++
.../console/approvals/ApprovalDetails.java | 63 +
.../approvals/ApprovalDirectoryPanel.java | 355 +++++
.../client/console/approvals/ApprovalModal.java | 82 +
.../syncope/client/console/pages/Approvals.java | 41 +
.../syncope/client/console/pages/Flowable.java | 67 +
.../console/pages/FlowableModelerPopupPage.java | 27 +
.../panels/BpmnProcessDirectoryPanel.java | 308 ++++
.../client/console/panels/NewBpmnProcess.java | 87 ++
.../resources/AbstractBpmnProcessResource.java | 51 +
.../resources/BpmnProcessGETResource.java | 56 +
.../resources/BpmnProcessPUTResource.java | 73 +
.../console/rest/BpmnProcessRestClient.java | 72 +
.../console/rest/UserRequestRestClient.java | 54 +
.../rest/UserWorkflowTaskRestClient.java | 34 +
.../client/console/widgets/ApprovalsWidget.java | 130 ++
.../src/main/resources/app-cfg.js | 25 +
.../client/console/approvals/Approval.html | 31 +
.../console/approvals/Approval.properties | 18 +
.../console/approvals/ApprovalDetails.html | 23 +
.../client/console/approvals/ApprovalModal.html | 23 +
.../console/approvals/ApprovalModal.properties | 17 +
.../approvals/ApprovalModal_it.properties | 17 +
.../approvals/ApprovalModal_ja.properties | 17 +
.../approvals/ApprovalModal_pt_BR.properties | 17 +
.../approvals/ApprovalModal_ru.properties | 17 +
.../console/approvals/Approval_it.properties | 18 +
.../console/approvals/Approval_ja.properties | 18 +
.../console/approvals/Approval_pt_BR.properties | 18 +
.../console/approvals/Approval_ru.properties | 20 +
.../syncope/client/console/pages/Approvals.html | 35 +
.../client/console/pages/Approvals.properties | 34 +
.../console/pages/Approvals_it.properties | 34 +
.../console/pages/Approvals_ja.properties | 34 +
.../console/pages/Approvals_pt_BR.properties | 34 +
.../console/pages/Approvals_ru.properties | 52 +
.../syncope/client/console/pages/Flowable.html | 37 +
.../client/console/pages/Flowable.properties | 19 +
.../console/pages/FlowableModelerPopupPage.html | 28 +
.../client/console/pages/Flowable_it.properties | 19 +
.../client/console/pages/Flowable_ja.properties | 19 +
.../console/pages/Flowable_pt_BR.properties | 19 +
.../client/console/pages/Flowable_ru.properties | 19 +
.../panels/BpmnProcessDirectoryPanel.html | 23 +
.../client/console/panels/NewBpmnProcess.html | 32 +
.../client/console/panels/empty.bpmn20.xml | 49 +
.../console/widgets/ApprovalsWidget.properties | 21 +
.../widgets/ApprovalsWidget_it.properties | 21 +
.../widgets/ApprovalsWidget_ja.properties | 21 +
.../widgets/ApprovalsWidget_pt_BR.properties | 21 +
.../widgets/ApprovalsWidget_ru.properties | 22 +
.../src/main/resources/save-model.html | 132 ++
.../src/main/resources/toolbar.js | 181 +++
.../src/main/resources/url-config.js | 39 +
ext/flowable/common-lib/pom.xml | 56 +
.../syncope/common/lib/to/BpmnProcessTO.java | 72 +
.../syncope/common/lib/to/UserRequestForm.java | 147 ++
.../common/lib/to/UserRequestFormProperty.java | 124 ++
.../syncope/common/lib/to/UserRequestTO.java | 70 +
.../syncope/common/lib/to/WorkflowTask.java | 40 +
.../common/lib/to/WorkflowTaskExecInput.java | 55 +
.../common/lib/types/BpmnProcessFormat.java | 29 +
.../common/lib/types/FlowableEntitlement.java | 76 +
.../lib/types/UserRequestFormPropertyType.java | 32 +
.../syncope/common/lib/types/WorkflowTasks.java | 47 +
ext/flowable/flowable-bpmn/pom.xml | 87 ++
.../core/flowable/api/BpmnProcessManager.java | 65 +
.../core/flowable/api/UserRequestHandler.java | 108 ++
.../core/flowable/api/WorkflowTaskManager.java | 70 +
.../impl/FlowableBpmnProcessManager.java | 212 +++
.../core/flowable/impl/FlowableDeployUtils.java | 92 ++
.../flowable/impl/FlowableRuntimeUtils.java | 225 +++
.../impl/FlowableUserRequestHandler.java | 574 +++++++
.../impl/FlowableUserWorkflowAdapter.java | 488 ++++++
.../flowable/impl/FlowableWorkflowUtils.java | 47 +
.../flowable/impl/SyncopeTaskQueryImpl.java | 49 +
.../flowable/support/DomainProcessEngine.java | 114 ++
.../DomainProcessEngineConfiguration.java | 32 +
.../support/DomainProcessEngineFactoryBean.java | 112 ++
.../support/SyncopeEntitiesVariableType.java | 35 +
.../flowable/support/SyncopeGroupQueryImpl.java | 89 ++
.../support/SyncopeIdmIdentityService.java | 51 +
.../core/flowable/support/SyncopeSession.java | 26 +
.../flowable/support/SyncopeSessionFactory.java | 46 +
.../flowable/support/SyncopeUserQueryImpl.java | 101 ++
.../task/AbstractFlowableServiceTask.java | 45 +
.../core/flowable/task/AutoActivate.java | 60 +
.../syncope/core/flowable/task/Create.java | 55 +
.../syncope/core/flowable/task/Delete.java | 41 +
.../core/flowable/task/GenerateToken.java | 44 +
.../syncope/core/flowable/task/Notify.java | 64 +
.../core/flowable/task/PasswordReset.java | 70 +
.../syncope/core/flowable/task/Reactivate.java | 29 +
.../syncope/core/flowable/task/Suspend.java | 29 +
.../syncope/core/flowable/task/Update.java | 58 +
.../org/apache/syncope/ext/flowable/Task.xml | 1418 ++++++++++++++++++
.../apache/syncope/ext/flowable/mappings.xml | 73 +
.../src/main/resources/userWorkflow.bpmn20.xml | 228 +++
.../src/main/resources/workflow.properties | 21 +
.../main/resources/workflowFlowableContext.xml | 62 +
ext/flowable/logic/pom.xml | 61 +
.../syncope/core/logic/BpmnProcessLogic.java | 73 +
.../syncope/core/logic/UserRequestLogic.java | 160 ++
.../core/logic/UserWorkflowTaskLogic.java | 91 ++
.../syncope/core/logic/init/FlowableLoader.java | 98 ++
ext/flowable/pom.xml | 49 +
ext/flowable/rest-api/pom.xml | 76 +
.../rest/api/beans/UserRequestFormQuery.java | 32 +
.../rest/api/service/BpmnProcessService.java | 108 ++
.../rest/api/service/UserRequestService.java | 125 ++
.../api/service/UserWorkflowTaskService.java | 67 +
ext/flowable/rest-cxf/pom.xml | 72 +
.../cxf/service/BpmnProcessServiceImpl.java | 82 +
.../cxf/service/UserRequestServiceImpl.java | 73 +
.../service/UserWorkflowTaskServiceImpl.java | 45 +
.../client/console/pages/OIDCClient.java | 3 +-
ext/oidcclient/persistence-jpa/pom.xml | 2 +-
.../rest/api/service/OIDCClientService.java | 2 +-
.../rest/api/service/OIDCProviderService.java | 2 +-
ext/pom.xml | 1 +
.../syncope/client/console/pages/SAML2SP.java | 2 +-
.../syncope/core/logic/init/SAML2SPLoader.java | 7 +-
ext/saml2sp/persistence-jpa/pom.xml | 2 +-
.../rest/api/service/SAML2IdPService.java | 2 +-
.../common/rest/api/service/SAML2SPService.java | 2 +-
.../client/console/pages/SCIMConfPage.java | 2 +-
.../rest/api/service/SCIMConfService.java | 2 +-
fit/console-reference/pom.xml | 65 +-
.../src/main/resources/app-cfg.js | 25 -
.../src/main/resources/console.properties | 3 -
.../src/main/resources/save-model.html | 132 --
.../src/main/resources/toolbar.js | 181 ---
.../src/main/resources/url-config.js | 39 -
.../src/test/resources/hotswap-agent.properties | 1 +
fit/core-reference/pom.xml | 16 +-
.../fit/core/reference/AssignDirectorGroup.java | 63 +
.../src/main/resources/all/workflow.properties | 2 +-
.../main/resources/all/workflowTestContext.xml | 27 +
.../resources/directorGroupRequest.bpmn20.xml | 104 ++
.../src/main/resources/userWorkflow.bpmn20.xml | 726 +++++----
.../org/apache/syncope/fit/AbstractITCase.java | 16 +-
.../apache/syncope/fit/FlowableDetector.java | 10 +-
.../syncope/fit/console/AjaxBrowseITCase.java | 7 -
.../syncope/fit/core/AuthenticationITCase.java | 10 +-
.../syncope/fit/core/BpmnProcessITCase.java | 72 +
.../syncope/fit/core/MultitenancyITCase.java | 4 +-
.../apache/syncope/fit/core/PullTaskITCase.java | 2 +-
.../org/apache/syncope/fit/core/RoleITCase.java | 7 +-
.../syncope/fit/core/SchedTaskITCase.java | 26 -
.../org/apache/syncope/fit/core/UserITCase.java | 6 +-
.../syncope/fit/core/UserRequestITCase.java | 144 ++
.../apache/syncope/fit/core/UserSelfITCase.java | 352 ++++-
.../syncope/fit/core/UserWorkflowITCase.java | 361 -----
.../apache/syncope/fit/core/WorkflowITCase.java | 74 -
.../src/test/resources/addFlowableToContent.xsl | 10 +-
.../src/test/resources/console.properties | 3 -
.../src/test/resources/hotswap-agent.properties | 11 +-
.../syncope/installer/files/ConsolePom.java | 86 +-
.../apache/syncope/installer/files/CorePom.java | 6 +-
.../installer/processes/ArchetypeProcess.java | 28 +-
.../installer/processes/ContainerProcess.java | 33 +-
.../main/resources/izpack/ProcessPanel.Spec.xml | 51 +-
.../main/resources/izpack/userInputLang.xml_eng | 1 -
.../main/resources/izpack/userInputLang.xml_ita | 1 -
.../src/main/resources/izpack/userInputSpec.xml | 3 -
pom.xml | 1 -
.../reference-guide/concepts/workflow.adoc | 55 -
.../workingwithapachesyncope/customization.adoc | 15 +-
.../configurationparameters.adoc | 2 -
.../systemadministration/flowablemodeler.adoc | 46 -
.../systemadministration.adoc | 2 -
359 files changed, 11558 insertions(+), 9696 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/archetype/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/pom.xml b/archetype/pom.xml
index ad9180c..d0bbd78 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -244,10 +244,6 @@ under the License.
<targetPath>${project.build.outputDirectory}/archetype-resources/console/src/main/resources</targetPath>
<includes>
<include>log4j2.xml</include>
- <include>save-model.html</include>
- <include>app-cfg.js</include>
- <include>url-config.js</include>
- <include>toolbar.js</include>
</includes>
</resource>
<resource>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/archetype/src/main/resources/archetype-resources/console/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/archetype-resources/console/pom.xml b/archetype/src/main/resources/archetype-resources/console/pom.xml
index 51cec9b..fb5724c 100644
--- a/archetype/src/main/resources/archetype-resources/console/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/console/pom.xml
@@ -122,6 +122,12 @@ under the License.
<dependencies>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${syncope.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-client-console</artifactId>
<version>${syncope.version}</version>
@@ -144,90 +150,9 @@ under the License.
<artifactId>syncope-ext-scimv2-client-console</artifactId>
<version>${syncope.version}</version>
</dependency>
-
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-ui-modeler-app</artifactId>
- <type>war</type>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>setupFlowableModeler</id>
- <phase>process-resources</phase>
- <configuration>
- <target>
- <unzip src="${settings.localRepository}/org/flowable/flowable-ui-modeler-app/${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war"
- dest="${flowable-modeler.directory}">
- <patternset>
- <include name="WEB-INF/classes/static/**"/>
- <include name="WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar"/>
- </patternset>
- </unzip>
-
- <unzip src="${flowable-modeler.directory}/WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar"
- dest="${flowable-modeler.directory}">
- <patternset>
- <include name="stencilset_bpmn.json"/>
- </patternset>
- </unzip>
-
- <move todir="${flowable-modeler.directory}">
- <fileset dir="${flowable-modeler.directory}/WEB-INF/classes/static/">
- <include name="**"/>
- </fileset>
- </move>
- <delete dir="${flowable-modeler.directory}/WEB-INF"/>
-
- <replace file="${flowable-modeler.directory}/index.html"
- token="</head>"
- value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>"/>
- <replace file="${flowable-modeler.directory}/index.html"
- token=" ng-click="backToLanding()""
- value=" disabled="disabled""/>
- <replace file="${flowable-modeler.directory}/index.html"
- token="<ul class="nav navbar-nav" id="main-nav""
- value="<ul class="nav navbar-nav" id="main-nav" style="display: none;""/>
- <replace file="${flowable-modeler.directory}/index.html"
- token="<div class="pull-right"
- value="<div style="display: none;" class="pull-right"/>
- <replace file="${flowable-modeler.directory}/editor-app/editor.html"
- token="<div class="btn-group pull-right""
- value="<div style="display: none;" class="btn-group pull-right""/>
- <replace file="${flowable-modeler.directory}/editor-app/configuration/toolbar-default-actions.js"
- token="$location.path('/processes');"
- value="window.close();"/>
-
- <copy file="${basedir}/src/main/resources/app-cfg.js"
- todir="${flowable-modeler.directory}/scripts"
- overwrite="true"/>
- <copy file="${basedir}/src/main/resources/url-config.js"
- todir="${flowable-modeler.directory}/editor-app/configuration"
- overwrite="true"/>
- <copy file="${basedir}/src/main/resources/toolbar.js"
- todir="${flowable-modeler.directory}/editor-app/configuration"
- overwrite="true"/>
- <copy file="${basedir}/src/main/resources/save-model.html"
- todir="${flowable-modeler.directory}/editor-app/popups"
- overwrite="true"/>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
<resources>
<resource>
<directory>src/main/resources</directory>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/archetype/src/main/resources/archetype-resources/core/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/archetype-resources/core/pom.xml b/archetype/src/main/resources/archetype-resources/core/pom.xml
index f248d9a..f951894 100644
--- a/archetype/src/main/resources/archetype-resources/core/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/core/pom.xml
@@ -160,8 +160,8 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${syncope.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/archetype/src/main/resources/meta-pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/meta-pom.xml b/archetype/src/main/resources/meta-pom.xml
index 0b163ae..d68a0d0 100644
--- a/archetype/src/main/resources/meta-pom.xml
+++ b/archetype/src/main/resources/meta-pom.xml
@@ -69,12 +69,6 @@ under the License.
<artifactId>syncope-core-persistence-jpa</artifactId>
<version>${syncope.version}</version>
</dependency>
-
- <dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
- <version>${syncope.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.syncope.client</groupId>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
index 8167cc5..91cb879 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
@@ -82,18 +82,6 @@ public class Info {
}
}
- public void workflowAdapter() {
- try {
- infoResultManager.printWorkflowAdapter(
- platformInfo.getAnyObjectWorkflowAdapter(),
- platformInfo.getUserWorkflowAdapter(),
- platformInfo.getGroupWorkflowAdapter());
- } catch (final Exception ex) {
- LOG.error("Information error", ex);
- infoResultManager.genericError(ex.getMessage());
- }
- }
-
public void accountRules() {
platformInfo.getJavaImplInfo(ImplementationType.ACCOUNT_RULE).ifPresent(info -> {
try {
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
index 28559be..460d54a 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
@@ -52,9 +52,6 @@ public class InfoCommand extends AbstractCommand {
case PROVISIONING_MANAGER:
info.provisioningManager();
break;
- case WORKFLOW_ADAPTER:
- info.workflowAdapter();
- break;
case ACCOUNT_RULES:
info.accountRules();
break;
@@ -122,7 +119,6 @@ public class InfoCommand extends AbstractCommand {
PWD_RESET_WITH_SECURITY_QUESTION("--pwd-reset-with-question"),
SELF_REG_ALLOWED("--self-reg-allowed"),
PROVISIONING_MANAGER("--provisioning-manager-classes"),
- WORKFLOW_ADAPTER("--workflow-adapter-classes"),
ACCOUNT_RULES("--account-rules-classes"),
CONNID_LOCATION("--connid-locations"),
RECON_FILTER_BUILDERS("--reconciliation-filter-builders"),
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
index d19b0ae..65ba206 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
@@ -48,15 +48,6 @@ public class InfoResultManager extends CommonsResultManager {
"Group provisioning manager class: " + getGroupProvisioningManager);
}
- public void printWorkflowAdapter(final String anyObjectWorkflowAdapter,
- final String userWorkflowAdapter,
- final String groupWorkflowAdapter) {
- genericMessage(
- "Any object workflow adapter class: " + anyObjectWorkflowAdapter,
- "User workflow adapter class: " + userWorkflowAdapter,
- "Group workflow adapter class: " + groupWorkflowAdapter);
- }
-
public void printAccountRules(final Collection<String> rules) {
rules.forEach(accountRule -> {
genericMessage("Account rule: " + accountRule);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java
deleted file mode 100644
index b21abf3..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java
+++ /dev/null
@@ -1,27 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-public abstract class AbstractWorkflowCommand {
-
- protected final WorkflowResultManager workflowResultManager = new WorkflowResultManager();
-
- protected final WorkflowSyncopeOperations workflowSyncopeOperations = new WorkflowSyncopeOperations();
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java
deleted file mode 100644
index 215c865..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java
+++ /dev/null
@@ -1,97 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.cli.Command;
-import org.apache.syncope.client.cli.Input;
-import org.apache.syncope.client.cli.commands.AbstractCommand;
-
-@Command(name = "workflow")
-public class WorkflowCommand extends AbstractCommand {
-
- private final WorkflowResultManager workflowResultManager = new WorkflowResultManager();
-
- @Override
- public void execute(final Input input) {
- if (StringUtils.isBlank(input.getOption())) {
- input.setOption(UserWorkflowOptions.HELP.getOptionName());
- }
-
- switch (UserWorkflowOptions.fromName(input.getOption())) {
- case EXPORT_DIAGRAM:
- new WorkflowExportDiagram(input).export();
- break;
- case EXPORT_DEFINITION:
- new WorkflowExportDefinition(input).export();
- break;
- case HELP:
- System.out.println(getHelpMessage());
- break;
- default:
- workflowResultManager.defaultOptionMessage(input.getOption(), getHelpMessage());
- }
- }
-
- @Override
- public String getHelpMessage() {
- return workflowResultManager.commandHelpMessage(getClass());
- }
-
- private enum UserWorkflowOptions {
-
- HELP("--help"),
- EXPORT_DIAGRAM("--export-diagram"),
- EXPORT_DEFINITION("--export-definition");
-
- private final String optionName;
-
- UserWorkflowOptions(final String optionName) {
- this.optionName = optionName;
- }
-
- public String getOptionName() {
- return optionName;
- }
-
- public boolean equalsOptionName(final String otherName) {
- return (otherName == null) ? false : optionName.equals(otherName);
- }
-
- public static UserWorkflowOptions fromName(final String name) {
- UserWorkflowOptions optionToReturn = HELP;
- for (final UserWorkflowOptions option : UserWorkflowOptions.values()) {
- if (option.equalsOptionName(name)) {
- optionToReturn = option;
- }
- }
- return optionToReturn;
- }
-
- public static List<String> toList() {
- final List<String> options = new ArrayList<>();
- for (final UserWorkflowOptions value : values()) {
- options.add(value.getOptionName());
- }
- return options;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
deleted file mode 100644
index b855ae0..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
+++ /dev/null
@@ -1,61 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import javax.xml.ws.WebServiceException;
-import org.apache.syncope.client.cli.Input;
-import org.apache.syncope.client.cli.util.CommandUtils;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowExportDefinition extends AbstractWorkflowCommand {
-
- private static final Logger LOG = LoggerFactory.getLogger(WorkflowExportDefinition.class);
-
- private static final String EXPORT_HELP_MESSAGE = "workflow --export-definition {ANY-TYPE-KIND}\n";
-
- private final Input input;
-
- public WorkflowExportDefinition(final Input input) {
- this.input = input;
- }
-
- public void export() {
- if (input.parameterNumber() == 1) {
- try {
- workflowSyncopeOperations.exportDefinition(input.firstParameter());
- } catch (final SyncopeClientException | WebServiceException ex) {
- LOG.error("Error", ex);
- if (ex.getMessage().startsWith("NotFound")) {
- workflowResultManager.notFoundError("Workflow", input.firstParameter());
- } else {
- workflowResultManager.genericError(ex.getMessage());
- }
- } catch (final IllegalArgumentException ex) {
- LOG.error("Error", ex);
- workflowResultManager.typeNotValidError(
- "workflow", input.firstParameter(), CommandUtils.fromEnumToArray(AnyTypeKind.class));
- }
- } else {
- workflowResultManager.commandOptionError(EXPORT_HELP_MESSAGE);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
deleted file mode 100644
index 80b6e41..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
+++ /dev/null
@@ -1,70 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import javax.ws.rs.core.Response;
-import javax.xml.ws.WebServiceException;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.syncope.client.cli.Input;
-import org.apache.syncope.client.cli.util.CommandUtils;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-
-public class WorkflowExportDiagram extends AbstractWorkflowCommand {
-
- private static final String EXPORT_HELP_MESSAGE = "workflow --export-diagram {ANY-TYPE-KIND}\n";
-
- private final Input input;
-
- public WorkflowExportDiagram(final Input input) {
- this.input = input;
- }
-
- public void export() {
- if (input.parameterNumber() == 1) {
- try {
- final Response response = workflowSyncopeOperations.exportDiagram(input.firstParameter());
- final byte[] diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
- try (final OutputStream os = Files.newOutputStream(Paths.get("/tmp/diagram.png"))) {
- os.write(diagram);
- os.close();
- }
- workflowResultManager.genericMessage("Diagram created: /tmp/diagram.png");
- } catch (final SyncopeClientException | WebServiceException ex) {
- if (ex.getMessage().startsWith("NotFound")) {
- workflowResultManager.notFoundError("Workflow", input.firstParameter());
- } else {
- workflowResultManager.genericError(ex.getMessage());
- }
- } catch (final IllegalArgumentException ex) {
- workflowResultManager.typeNotValidError(
- "workflow", input.firstParameter(), CommandUtils.fromEnumToArray(AnyTypeKind.class));
- } catch (final IOException ex) {
- workflowResultManager.genericError(ex.getMessage());
- }
- } else {
- workflowResultManager.commandOptionError(EXPORT_HELP_MESSAGE);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java
deleted file mode 100644
index f46be07..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java
+++ /dev/null
@@ -1,25 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import org.apache.syncope.client.cli.commands.CommonsResultManager;
-
-public class WorkflowResultManager extends CommonsResultManager {
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
deleted file mode 100644
index 45025d4..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import javax.ws.rs.core.Response;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.syncope.client.cli.SyncopeServices;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
-
-public class WorkflowSyncopeOperations {
-
- private static final String DEFAULT = "userWorkflow";
-
- private final WorkflowService workflowService = SyncopeServices.get(WorkflowService.class);
-
- public Response exportDiagram(final String anyType) {
- WebClient.client(workflowService).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
- return workflowService.exportDiagram(anyType, DEFAULT);
- }
-
- public Response exportDefinition(final String anyType) {
- return workflowService.get(anyType, DEFAULT);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/main/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/cli/src/main/resources/messages.properties b/client/cli/src/main/resources/messages.properties
index 48cdc15..7bd62fa 100644
--- a/client/cli/src/main/resources/messages.properties
+++ b/client/cli/src/main/resources/messages.properties
@@ -31,5 +31,4 @@ role.help.message=\nUsage: role [options]\n Options:\n --help \n --detail
schema.help.message=\nUsage: schema [options]\n Options:\n --help \n --details \n --list-all\n --list-plain\n --list-derived\n --list-virtual\n --read {SCHEMA-TYPE} {SCHEMA-KEY}\n Schema type: PLAIN / DERIVED / VIRTUAL\n --delete {SCHEMA-TYPE} {SCHEMA-KEY}\n Schema type: PLAIN / DERIVED / VIRTUAL\n
task.help.message=\nUsage: task [options]\n Options:\n --help \n --details\n --list\n Syntax: --list {TASK-TYPE} \n Task type: NOTIFICATION / PROPAGATION / PUSH / SCHEDULED / PULL\n --list-running-jobs \n --list-scheduled-jobs \n --read \n Syntax: --read {TASK-TYPE} {TASK-KEY}\n Task type: PROPAGATION / NOTIFICATION / SCHEDULED / PULL / PUSH\n --delete \n Syntax: --delete {TASK-KEY} {TASK-KEY} [...]\n --delete-all-prop\n --delete-execution \n Syntax: --delete-execution {TASK-EXEC-KEY} {TASK-EXEC-KEY} [...]\n --execute \n Syntax: --execute {TASK-KEY} {DRY-RUN}\n Dry run: true / false\n
user.help.message=\nUsage: user [options]\n Options:\n --help \n --details \n --list \n --get-user-key\n Syntax: --get-user-key {USERNAME}\n --get-username\n Syntax: --get-username {USER-KEY}\n --read-by-userkey \n Syntax: --read-by-userkey {USER-KEY} {USER-KEY} [...]\n --read-by-username\n Syntax: --read-by-username {USERNAME} {USERNAME} [...]\n --search-by-attribute \n Syntax: --search-by-attribute {REALM} {ATTR-NAME}={ATTR-VALUE}\n --search-by-role \n Syntax: --search-by-role {REALM} {ROLE-KEY}\n --search-by-resource \n Syntax: --search-by-resource {REALM} {RESOURCE-KEY}\n --delete \n Syntax: --delete {USER-KEY} {USER-KEY} [...]\n --delete-all \n Syntax: --delete-all {REALM}\n --delete-by-attribute \n Syntax: --delete-by-attribute {REALM} {ATTR-NAME}={ATTR-VALUE}\n
-workflow.help.message=\nUsage: workflow [options]\n Options:\n --help \n --export-diagram {ANY-TYPE-KIND}\n Any type kind: ANY_OBJECT / USER / GROUP\n --export-definition {ANY-TYPE-KIND}\n Any type kind: ANY_OBJECT / USER / GROUP\n
migrate.help.message=\nUsage: migrate [options]\n Options:\n --help \n --conf {SRC} {DST}\n Syncope 1.2.X content.xml SRC absolute path\n Syncope 2.0.X *Content.xml DST absolute path\n
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
----------------------------------------------------------------------
diff --git a/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java b/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
index 2b3c2ae..c752738 100644
--- a/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
+++ b/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
@@ -49,6 +49,6 @@ public class CommandUtilsTest {
public void commands() throws Exception {
List<AbstractCommand> commands = CommandUtils.commands();
assertFalse(commands.isEmpty());
- assertEquals(21, commands.size());
+ assertEquals(20, commands.size());
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index 4ff40d2..cb866c0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -35,6 +35,7 @@ import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.annotations.Resource;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
import org.apache.syncope.client.console.init.ConsoleInitializer;
@@ -42,9 +43,6 @@ import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.pages.Dashboard;
import org.apache.syncope.client.console.pages.MustChangePassword;
import org.apache.syncope.client.console.pages.Login;
-import org.apache.syncope.client.console.resources.FilesystemResource;
-import org.apache.syncope.client.console.resources.WorkflowDefGETResource;
-import org.apache.syncope.client.console.resources.WorkflowDefPUTResource;
import org.apache.syncope.client.console.themes.AdminLTE;
import org.apache.syncope.client.lib.AnonymousAuthenticationHandler;
import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
@@ -61,6 +59,7 @@ import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDa
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.CsrfPreventionRequestCycleListener;
import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
import org.apache.wicket.request.resource.IResource;
import org.apache.wicket.request.resource.ResourceReference;
import org.apache.wicket.resource.DynamicJQueryResourceReference;
@@ -79,8 +78,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
Locale.ENGLISH, Locale.ITALIAN, new Locale("pt", "BR"), new Locale("ru"), Locale.JAPANESE
}));
- private static final String FLOWABLE_MODELER_CONTEXT = "flowable-modeler";
-
public static SyncopeConsoleApplication get() {
return (SyncopeConsoleApplication) WebApplication.get();
}
@@ -91,8 +88,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
private String anonymousKey;
- private String flowableModelerDirectory;
-
private String reconciliationReportKey;
private String scheme;
@@ -203,9 +198,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
mountPage("/login", getSignInPageClass());
- flowableModelerDirectory = props.getProperty("flowableModelerDirectory");
- Args.notNull(flowableModelerDirectory, "<flowableModelerDirectory>");
-
try {
reconciliationReportKey = props.getProperty("reconciliationReportKey");
} catch (NumberFormatException e) {
@@ -213,34 +205,24 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
}
Args.notNull(reconciliationReportKey, "<reconciliationReportKey>");
- mountResource("/" + FLOWABLE_MODELER_CONTEXT, new ResourceReference(FLOWABLE_MODELER_CONTEXT) {
+ for (Class<? extends AbstractResource> resource : lookup.getResources()) {
+ Resource annotation = resource.getAnnotation(Resource.class);
+ try {
+ AbstractResource instance = resource.getDeclaredConstructor().newInstance();
- private static final long serialVersionUID = -128426276529456602L;
+ mountResource(annotation.path(), new ResourceReference(annotation.key()) {
- @Override
- public IResource getResource() {
- return new FilesystemResource(FLOWABLE_MODELER_CONTEXT, flowableModelerDirectory);
- }
+ private static final long serialVersionUID = -128426276529456602L;
- });
- mountResource("/workflowDefGET", new ResourceReference("workflowDefGET") {
-
- private static final long serialVersionUID = -128426276529456602L;
-
- @Override
- public IResource getResource() {
- return new WorkflowDefGETResource();
- }
- });
- mountResource("/workflowDefPUT", new ResourceReference("workflowDefPUT") {
-
- private static final long serialVersionUID = -128426276529456602L;
-
- @Override
- public IResource getResource() {
- return new WorkflowDefPUTResource();
+ @Override
+ public IResource getResource() {
+ return instance;
+ }
+ });
+ } catch (Exception e) {
+ LOG.error("Could not instantiate {}", resource.getName(), e);
}
- });
+ }
// enable component path
if (getDebugSettings().isAjaxDebugModeEnabled()) {
@@ -282,10 +264,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
return anonymousKey;
}
- public String getFlowableModelerDirectory() {
- return flowableModelerDirectory;
- }
-
public String getReconciliationReportKey() {
return reconciliationReportKey;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java b/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java
new file mode 100644
index 0000000..ebdba59
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java
@@ -0,0 +1,41 @@
+/*
+ * 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.client.console.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Resource {
+
+ /**
+ * @return string for {@link org.apache.wicket.request.resource.ResourceReference#ResourceReference}
+ */
+ String key();
+
+ /**
+ * @return path for{@link org.apache.wicket.protocol.http.WebApplication#mountResource}
+ */
+ String path();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
deleted file mode 100644
index c34fb00..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
+++ /dev/null
@@ -1,206 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.math.NumberUtils;
-import org.apache.commons.lang3.time.FastDateFormat;
-import org.apache.syncope.client.console.commons.MapChoiceRenderer;
-import org.apache.syncope.client.console.panels.MultilevelPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxSpinnerFieldPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDateTimeFieldPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.list.ListView;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.LoadableDetachableModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class Approval extends Panel {
-
- private static final long serialVersionUID = -8847854414429745216L;
-
- protected static final Logger LOG = LoggerFactory.getLogger(Approval.class);
-
- public Approval(final PageReference pageRef, final WorkflowFormTO formTO) {
- super(MultilevelPanel.FIRST_LEVEL_ID);
-
- IModel<List<WorkflowFormPropertyTO>> formProps = new LoadableDetachableModel<List<WorkflowFormPropertyTO>>() {
-
- private static final long serialVersionUID = 3169142472626817508L;
-
- @Override
- protected List<WorkflowFormPropertyTO> load() {
- return formTO.getProperties();
- }
- };
-
- final ListView<WorkflowFormPropertyTO> propView = new ListView<WorkflowFormPropertyTO>("propView", formProps) {
-
- private static final long serialVersionUID = 9101744072914090143L;
-
- @Override
- @SuppressWarnings({ "unchecked", "rawtypes" })
- protected void populateItem(final ListItem<WorkflowFormPropertyTO> item) {
- final WorkflowFormPropertyTO prop = item.getModelObject();
-
- String label = StringUtils.isBlank(prop.getName()) ? prop.getId() : prop.getName();
-
- FieldPanel field;
- switch (prop.getType()) {
- case Boolean:
- field = new AjaxDropDownChoicePanel("value", label, new PropertyModel<String>(prop, "value") {
-
- private static final long serialVersionUID = -3743432456095828573L;
-
- @Override
- public String getObject() {
- return StringUtils.isBlank(prop.getValue())
- ? null
- : prop.getValue().equals("true") ? "Yes" : "No";
- }
-
- @Override
- public void setObject(final String object) {
- prop.setValue(String.valueOf(object.equalsIgnoreCase("yes")));
- }
-
- }, false).setChoices(Arrays.asList(new String[] { "Yes", "No" }));
- break;
-
- case Date:
- final FastDateFormat formatter = FastDateFormat.getInstance(prop.getDatePattern());
- field = new AjaxDateTimeFieldPanel("value", label, new PropertyModel<Date>(prop, "value") {
-
- private static final long serialVersionUID = -3743432456095828573L;
-
- @Override
- public Date getObject() {
- try {
- if (StringUtils.isBlank(prop.getValue())) {
- return null;
- } else {
- return formatter.parse(prop.getValue());
- }
- } catch (ParseException e) {
- LOG.error("Unparsable date: {}", prop.getValue(), e);
- return null;
- }
- }
-
- @Override
- public void setObject(final Date object) {
- prop.setValue(formatter.format(object));
- }
-
- }, prop.getDatePattern());
- break;
-
- case Enum:
- MapChoiceRenderer<String, String> enumCR = new MapChoiceRenderer<>(prop.getEnumValues());
-
- field = new AjaxDropDownChoicePanel(
- "value", label, new PropertyModel<String>(prop, "value"), false).
- setChoiceRenderer(enumCR).setChoices(new Model<ArrayList<String>>() {
-
- private static final long serialVersionUID = -858521070366432018L;
-
- @Override
- public ArrayList<String> getObject() {
- return new ArrayList<>(prop.getEnumValues().keySet());
- }
- });
- break;
-
- case Long:
- field = new AjaxSpinnerFieldPanel.Builder<Long>().build(
- "value",
- label,
- Long.class,
- new PropertyModel<Long>(prop, "value") {
-
- private static final long serialVersionUID = -7688359318035249200L;
-
- @Override
- public Long getObject() {
- return StringUtils.isBlank(prop.getValue())
- ? null
- : NumberUtils.toLong(prop.getValue());
- }
-
- @Override
- public void setObject(final Long object) {
- prop.setValue(String.valueOf(object));
- }
- });
- break;
-
- case String:
- default:
- field = new AjaxTextFieldPanel("value", label, new PropertyModel<>(prop, "value"), false);
- break;
- }
-
- field.setReadOnly(!prop.isWritable());
- if (prop.isRequired()) {
- field.addRequiredLabel();
- }
-
- item.add(field);
- }
- };
-
- AjaxLink<String> userDetails = new AjaxLink<String>("userDetails") {
-
- private static final long serialVersionUID = -4804368561204623354L;
-
- @Override
- public void onClick(final AjaxRequestTarget target) {
- viewDetails(target);
- }
- };
- MetaDataRoleAuthorizationStrategy.authorize(userDetails, ENABLE, StandardEntitlement.USER_READ);
-
- boolean enabled = formTO.getUserTO() != null;
- userDetails.setVisible(enabled).setEnabled(enabled);
-
- add(propView);
- add(userDetails);
- }
-
- protected abstract void viewDetails(final AjaxRequestTarget target);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
deleted file mode 100644
index ec9dbab..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
+++ /dev/null
@@ -1,63 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
-import org.apache.syncope.client.console.panels.MultilevelPanel;
-import org.apache.syncope.client.console.rest.AnyTypeRestClient;
-import org.apache.syncope.client.console.wizards.AjaxWizard;
-import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
-import org.apache.syncope.common.lib.AnyOperations;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.wicket.PageReference;
-
-public class ApprovalDetails extends MultilevelPanel.SecondLevel {
-
- private static final long serialVersionUID = -8847854414429745216L;
-
- public ApprovalDetails(final PageReference pageRef, final WorkflowFormTO formTO) {
- super(MultilevelPanel.SECOND_LEVEL_ID);
-
- final UserTO newUserTO;
- final UserTO previousUserTO;
- if (formTO.getUserPatch() == null) {
- newUserTO = formTO.getUserTO();
- previousUserTO = null;
- } else if (formTO.getUserTO() == null) {
- // make it stronger by handling possible NPE
- previousUserTO = new UserTO();
- previousUserTO.setKey(formTO.getUserPatch().getKey());
- newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
- } else {
- formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
- newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
- previousUserTO = formTO.getUserTO();
- }
-
- add(new UserWizardBuilder(
- previousUserTO,
- newUserTO,
- new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
- new UserFormLayoutInfo(),
- pageRef).
- build(AjaxWizard.Mode.READONLY));
- }
-}
[15/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
index 71e5ef4..ac3a256 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
@@ -42,8 +42,6 @@ import org.apache.syncope.common.lib.to.AccessTokenTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.event.IEvent;
@@ -100,12 +98,8 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
header = ((AccessTokenTO) modelObject).getOwner();
} else if (modelObject instanceof ExecTO) {
header = ((ExecTO) modelObject).getKey();
- } else if (modelObject instanceof WorkflowDefinitionTO) {
- header = ((WorkflowDefinitionTO) modelObject).getName();
} else if (modelObject instanceof ProvisioningTaskTO) {
header = ((ProvisioningTaskTO) modelObject).getName();
- } else if (modelObject instanceof WorkflowFormTO) {
- header = ((WorkflowFormTO) modelObject).getKey();
} else if (modelObject instanceof EntityTO) {
header = ((EntityTO) modelObject).getKey();
} else if (modelObject instanceof StatusBean) {
@@ -121,6 +115,8 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
? ((JobTO) modelObject).getRefDesc() : ((JobTO) modelObject).getRefKey();
} else if (modelObject instanceof ResourceProvision) {
header = ((ResourceProvision) modelObject).getAnyType();
+ } else if (modelObject instanceof EntityTO) {
+ header = ((EntityTO) modelObject).getKey();
} else {
header = new ResourceModel("actions", StringUtils.EMPTY).getObject();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
index 6b98619..a4d8775 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
@@ -87,7 +87,7 @@ public final class ActionPanel<T extends Serializable> extends Panel {
public void onClick(final AjaxRequestTarget target) {
}
};
- } else if (action.getType() == ActionType.WORKFLOW_MODELER) {
+ } else if (action.getType() == ActionType.EXTERNAL_EDITOR) {
enabled = action.getLink().isEnabled(obj);
actionLink = new BookmarkablePageLink<>(
"action", action.getLink().getPageClass(), action.getLink().getPageParameters()).
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
deleted file mode 100644
index ee47619..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
+++ /dev/null
@@ -1,128 +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.
- */
-package org.apache.syncope.client.console.widgets;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.image.Icon;
-import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconTypeBuilder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.pages.Approvals;
-import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
-import org.apache.syncope.client.console.wicket.ajax.IndicatorAjaxTimerBehavior;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.util.ListModel;
-import org.apache.wicket.util.time.Duration;
-
-public class ApprovalsWidget extends AlertWidget<WorkflowFormTO> {
-
- private static final long serialVersionUID = 7667120094526529934L;
-
- private final UserWorkflowRestClient restClient = new UserWorkflowRestClient();
-
- private final List<WorkflowFormTO> lastApprovals = new ArrayList<>();
-
- public ApprovalsWidget(final String id, final PageReference pageRef) {
- super(id);
- setOutputMarkupId(true);
-
- latestAlertsList.add(new IndicatorAjaxTimerBehavior(Duration.seconds(30)) {
-
- private static final long serialVersionUID = 7298597675929755960L;
-
- @Override
- protected void onTimer(final AjaxRequestTarget target) {
- if (!latestAlerts.getObject().equals(lastApprovals)) {
- refreshLatestAlerts(target);
- }
- }
- });
- }
-
- public final void refreshLatestAlerts(final AjaxRequestTarget target) {
- latestAlerts.getObject().clear();
- latestAlerts.getObject().addAll(lastApprovals);
-
- int latestAlertSize = getLatestAlertsSize();
- linkAlertsNumber.setDefaultModelObject(latestAlertSize);
- target.add(linkAlertsNumber);
-
- headerAlertsNumber.setDefaultModelObject(latestAlertSize);
- target.add(headerAlertsNumber);
-
- target.add(latestAlertsList);
-
- lastApprovals.clear();
- lastApprovals.addAll(latestAlerts.getObject());
- }
-
- @Override
- protected int getLatestAlertsSize() {
- return SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_LIST)
- && SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_READ)
- ? restClient.countForms()
- : 0;
- }
-
- @Override
- protected IModel<List<WorkflowFormTO>> getLatestAlerts() {
- return new ListModel<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -2583290457773357445L;
-
- @Override
- public List<WorkflowFormTO> getObject() {
- List<WorkflowFormTO> updatedApprovals;
- if (SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_LIST)
- && SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_READ)) {
-
- updatedApprovals = restClient.getForms(1, MAX_SIZE, new SortParam<>("createTime", true));
- } else {
- updatedApprovals = Collections.<WorkflowFormTO>emptyList();
- }
-
- return updatedApprovals;
- }
- };
- }
-
- @Override
- protected AbstractLink getEventsLink(final String linkid) {
- BookmarkablePageLink<Approvals> approvals = BookmarkablePageLinkBuilder.build(linkid, Approvals.class);
- MetaDataRoleAuthorizationStrategy.authorize(approvals, WebPage.ENABLE, StandardEntitlement.WORKFLOW_FORM_LIST);
- return approvals;
- }
-
- @Override
- protected Icon getIcon(final String iconid) {
- return new Icon(iconid,
- FontAwesomeIconTypeBuilder.on(FontAwesomeIconTypeBuilder.FontAwesomeGraphic.handshake_o).build());
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java
new file mode 100644
index 0000000..1453fa9
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java
@@ -0,0 +1,30 @@
+/*
+ * 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.client.console.widgets;
+
+import java.io.Serializable;
+
+public abstract class ExtAlertWidget<T extends Serializable> extends AlertWidget<T> {
+
+ private static final long serialVersionUID = -5622060468533516192L;
+
+ public ExtAlertWidget(final String id) {
+ super(id);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/console.properties b/client/console/src/main/resources/console.properties
index 3139c1c..f8a6467 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -33,15 +33,12 @@ maxWaitTimeOnApplyChanges=30
csrf=true
-flowableModelerDirectory=${flowable-modeler.directory}
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
page.realms=org.apache.syncope.client.console.pages.Realms
page.topology=org.apache.syncope.client.console.topology.Topology
page.reports=org.apache.syncope.client.console.pages.Reports
-page.workflow=org.apache.syncope.client.console.pages.Workflow
page.audit=org.apache.syncope.client.console.pages.Audit
page.implementations=org.apache.syncope.client.console.pages.Implementations
page.logs=org.apache.syncope.client.console.pages.Logs
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
deleted file mode 100644
index 64805b9..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
+++ /dev/null
@@ -1,31 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div wicket:id="propView">
- <span wicket:id="value">[value]</span>
- </div>
-
- <div style="margin: 20px 0">
- <a href="#" alt="user details" class="btn btn-primary btn-circle btn-lg" wicket:id="userDetails" wicket:message="title:userDetails">
- <i class="glyphicon glyphicon-eye-open"></i>
- </a>
- </div>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
deleted file mode 100644
index 450ff50..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=User details
-userForm=Edit User
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
deleted file mode 100644
index 1de2361..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
+++ /dev/null
@@ -1,23 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <span wicket:id="wizard"/>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
deleted file mode 100644
index 5d5d129..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
+++ /dev/null
@@ -1,23 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <span wicket:id="approval">[APPROVAL]</span>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
deleted file mode 100644
index 84106b9..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=\u627f\u8a8d\u8a73\u7d30
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
deleted file mode 100644
index 92c475d..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=Dettagli utente
-userForm=Modifica utente
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
deleted file mode 100644
index 5a9cc2d..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=\u30e6\u30fc\u30b6\u30fc\u8a73\u7d30
-userForm=\u30e6\u30fc\u30b6\u30fc\u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
deleted file mode 100644
index 00a8971..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=Detalhes do Usu\u00e1rio
-userForm=Detalhes do Usu\u00e1rio
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
deleted file mode 100644
index 02c159a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
+++ /dev/null
@@ -1,20 +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.
-#
-# userDetails=\u00d0\u0098\u00d0\u00bd\u00d1\u0084\u00d0\u00be\u00d1\u0080\u00d0\u00bc\u00d0\u00b0\u00d1\u0086\u00d0\u00b8\u00d1\u008f \u00d0\u00be \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5
-userDetails=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
-userForm=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
deleted file mode 100644
index 5bf6234..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
+++ /dev/null
@@ -1,35 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <section class="content-header">
- <h1> </h1>
- <ol class="breadcrumb">
- <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard">[DASHBOARD]</wicket:message></a></li>
- <li class="active"><wicket:message key="approvals"/></li>
- </ol>
- </section>
-
- <section class="content" wicket:id="content">
- <div class="box">
- <div class="box-body" wicket:id="wfPanel"/>
- </div>
- </section>
- </wicket:extend>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
deleted file mode 100644
index 1ea8063..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=Task
-key=Key
-description=Description
-createTime=Create Time
-dueDate=Due Date
-owner=Owner
-claim=Claim
-manage=Manage
-approvals=Approvals
-delete=Delete
-type=Type
-username=Username
-new_user=New User
-creationDate = Creation Date
-claimDate = Claim Dare
-approval.edit=Approval Edit
-approval.manage=Approval Manage
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
deleted file mode 100644
index 7e12ce5..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=Task
-key=Chiave
-description=Descrizione
-createTime=Data di creazione
-dueDate=Scadenza
-owner=Esecutore
-claim=Richiedi
-manage=Gestisci
-approvals=Approvazioni
-delete=Rimuovi
-type=Tipo
-username=Utente
-new_user=Nuovo utente
-creationDate = Data creazione
-claimDate = Data rivendicazione
-approval.manage=Gestisci Approvazione
-approval.edit=Modifica Approvazione
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
deleted file mode 100644
index b2ff626..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=\u30bf\u30b9\u30af
-key=\u30ad\u30fc
-description=\u8aac\u660e
-createTime=\u4f5c\u6210\u6642\u523b
-dueDate=\u671f\u9650
-owner=\u30aa\u30fc\u30ca\u30fc
-claim=\u7533\u8acb
-manage=\u7ba1\u7406
-approvals=\u627f\u8a8d
-delete=\u524a\u9664
-type=\u30bf\u30a4\u30d7
-username=\u30e6\u30fc\u30b6\u30fc\u540d
-new_user=\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc
-creationDate = \u4f5c\u6210\u65e5
-claimDate = \u7533\u8acb\u65e5
-approval.edit=\u627f\u8a8d \u7de8\u96c6
-approval.manage=\u627f\u8a8d \u7ba1\u7406
-any.edit=${anyTO.type} ${anyTO.username} \u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
deleted file mode 100644
index e5ff74c..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=Tarefa
-key=Chave
-description=Descri\u00e7\u00e3o
-createTime=Tempo de Cria\u00e7\u00e3o
-dueDate=Data acordada
-owner=Propriet\u00e1rio
-claim=Requerimento
-manage=Ger\u00eancia
-approvals=Aprova\u00e7\u00f5es
-delete=Excluir
-type=Tipo
-username=Usu\u00e1rio
-new_user=Novo Usu\u00e1rio
-creationDate = Data de cria\u00e7\u00e3o
-claimDate = Data de reivindica\u00e7\u00e3o
-approval.manage=Aprova\u00e7\u00e3o
-approval.edit=Aprova\u00e7\u00e3o
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
deleted file mode 100644
index 6f4fb58..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
+++ /dev/null
@@ -1,52 +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.
-#
-# taskId=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b0
-taskId=\u0417\u0430\u044f\u0432\u043a\u0430
-# key=\u00d0\u0098\u00d0\u00b4\u00d0\u00b5\u00d0\u00bd\u00d1\u0082\u00d0\u00b8\u00d1\u0084\u00d0\u00b8\u00d0\u00ba\u00d0\u00b0\u00d1\u0082\u00d0\u00be\u00d1\u0080
-key=\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440
-# description=\u00d0\u009e\u00d0\u00bf\u00d0\u00b8\u00d1\u0081\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-description=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435
-# createTime=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
-createTime=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
-# dueDate=\u00d0\u00a1\u00d1\u0080\u00d0\u00be\u00d0\u00ba
-dueDate=\u0421\u0440\u043e\u043a
-# owner=\u00d0\u0092\u00d0\u00bb\u00d0\u00b0\u00d0\u00b4\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5\u00d1\u0086
-owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
-# claim=\u00d0\u0092\u00d1\u008b\u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d0\u00bd\u00d0\u00b8\u00d1\u0082\u00d1\u008c \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-claim=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
-# manage=\u00d0\u00a3\u00d0\u00bf\u00d1\u0080\u00d0\u00b0\u00d0\u00b2\u00d0\u00bb\u00d0\u00b5\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-manage=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435
-# approvals=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b8
-approvals=\u0417\u0430\u044f\u0432\u043a\u0438
-# delete=\u00d0\u00a3\u00d0\u00b4\u00d0\u00b0\u00d0\u00bb\u00d0\u00b8\u00d1\u0082\u00d1\u008c
-delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c
-# type=\u00d0\u00a2\u00d0\u00b8\u00d0\u00bf
-type=\u0422\u0438\u043f
-# username=\u00d0\u0098\u00d0\u00bc\u00d1\u008f \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
-username=\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
-# new_user=\u00d0\u00a1\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5 \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
-new_user=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
-# creationDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
-creationDate=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
-# claimDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d0\u00bd\u00d0\u00b0\u00d1\u0087\u00d0\u00b0\u00d0\u00bb\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
-claimDate=\u0414\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
-# approval.edit=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-approval.edit=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
-# approval.manage=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-approval.manage=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
index d477213..6f01bd9 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -65,8 +65,8 @@ under the License.
<span wicket:id="remediationWidget"/>
</li>
- <li class="dropdown tasks-menu">
- <span wicket:id="approvalsWidget"/>
+ <li class="dropdown tasks-menu" wicket:id="extAlertWidgets">
+ <span wicket:id="extAlertWidget"/>
</li>
<li class="dropdown user user-menu">
@@ -122,7 +122,6 @@ under the License.
<li wicket:id="policiesLI"><a href="#" wicket:id="policies"><i class="fa fa-list"></i><wicket:message key="policies"/></a></li>
<li wicket:id="securityLI"><a href="#" wicket:id="security"><i class="fa fa-lock"></i><wicket:message key="security"/></a></li>
<li wicket:id="typesLI"><a href="#" wicket:id="types"><i class="fa fa-wrench"></i><wicket:message key="types"/></a></li>
- <li wicket:id="workflowLI"><a href="#" wicket:id="workflow"><i class="fa fa-briefcase"></i><wicket:message key="workflow"/></a></li>
</ul>
</li>
<li wicket:id="extensionsLI" class="treeview">
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
deleted file mode 100644
index e1afe72..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<!--
-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.
--->
-<html>
- <head>
- <title>Apache Syncope / Flowable Modeler</title>
-
- <meta http-equiv="refresh" content="0; url=../../flowable-modeler/modeler.html"/>
- </head>
- <body>
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
deleted file mode 100644
index 723c46a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
+++ /dev/null
@@ -1,37 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <section class="content-header">
- <h1> </h1>
- <ol class="breadcrumb">
- <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard"/></a></li>
- <li class="active"><wicket:message key="configuration"/></li>
- <li class="active"><wicket:message key="workflow"/></li>
- </ol>
- </section>
-
- <section class="content" wicket:id="content">
- <span wicket:id="disabled"><i><wicket:message key="disabled"/></i></span>
- <div class="box">
- <div class="box-body" wicket:id="workflowsPanel"/>
- </div>
- </section>
- </wicket:extend>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
deleted file mode 100644
index b8abd93..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable not enabled for users
-xmlEditorTitle=Workflow XML Editor
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
deleted file mode 100644
index 1f9eb5a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable non configurato per gli utenti
-xmlEditorTitle=Workflow XML Editor
-main=Principale
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties
deleted file mode 100644
index 11bb74a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=\u30d5\u30ed\u30fc\u53ef\u80fd\u306f\u30e6\u30fc\u30b6\u30fc\u306b\u5bfe\u3057\u3066\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093
-xmlEditorTitle=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc XML \u30a8\u30c7\u30a3\u30bf\u30fc
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
deleted file mode 100644
index 34829e5..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable n\u00e3o habilitado para usu\u00e1rios
-xmlEditorTitle=Workflow XML Editor
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
deleted file mode 100644
index 96c2862..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439
-xmlEditorTitle=XML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
deleted file mode 100644
index 6197d5a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
+++ /dev/null
@@ -1,32 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <div id="startAtContainer">
- <form wicket:id="form">
- <div class="input-group">
- <input wicket:id="key"/>
- <div class="input-group-addon">
- <a wicket:id="submit"><i class="fa fa-file-o" alt="new" title="new"></i></a>
- </div>
- </div>
- </form>
- </div>
- </wicket:extend>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
deleted file mode 100644
index d170041..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
+++ /dev/null
@@ -1,23 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <span wicket:id="newWorkflowProcess"/>
- </wicket:extend>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml b/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
deleted file mode 100644
index 5943197..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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:flowable="http://flowable.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://www.flowable.org/processdef">
-
- <process id="%KEY%" name="%KEY%" isExecutable="true">
- <startEvent id="startevent1" name="Start"></startEvent>
- <endEvent id="endevent1" name="End"></endEvent>
- <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="endevent1"></sequenceFlow>
- </process>
- <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
- <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
- <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
- <omgdc:Bounds height="35.0" width="35.0" x="180.0" y="110.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
- <omgdc:Bounds height="35.0" width="35.0" x="460.0" y="110.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="215.0" y="127.0"></omgdi:waypoint>
- <omgdi:waypoint x="460.0" y="127.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
-</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
index 1086b88..af1d580 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
@@ -262,6 +262,6 @@ zoom_out.class=fa fa-search-minus
zoom_out.title=zoom-out
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
index 5538d75..4bfa686 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
@@ -253,9 +253,9 @@ zoom_in.alt=zoom-in icon
zoom_out.class=fa fa-search-minus
zoom_out.title=zoom-out
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
index 6789a9b..6b011c7 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
@@ -254,9 +254,9 @@ zoom_out.class=fa fa-search-minus
zoom_out.title=\u30ba\u30fc\u30e0\u30a2\u30a6\u30c8
zoom_out.alt=\u30ba\u30fc\u30e0\u30a2\u30a6\u30c8
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30e2\u30c7\u30e9\u2015
-workflow_modeler.alt=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30e2\u30c7\u30e9\u2015
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
index c996263..b362779 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
@@ -253,9 +253,9 @@ zoom_in.alt=zoom-in icon
zoom_out.class=fa fa-search-minus
zoom_out.title=zoom-out
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
index d697f25..dfea5ea 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
@@ -253,9 +253,9 @@ zoom_in.alt=zoom-in icon
zoom_out.class=fa fa-search-minus
zoom_out.title=rimpicciolisci
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
deleted file mode 100644
index dd5b98f..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=View all approvals
-duedate=Due date
-owner=Owner
-createApproval=Create Approval
-summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
deleted file mode 100644
index 7b2287e..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=Tutte le approvazioni
-duedate=Scadenza
-owner=Assegnato
-createApproval=Approvazione Creazione
-summary=${number} approvazioni pendenti
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
deleted file mode 100644
index a6089eb..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=\u3059\u3079\u3066\u306e\u627f\u8a8d\u3092\u8868\u793a
-duedate=\u671f\u9650
-owner=\u30aa\u30fc\u30ca\u30fc
-createApproval=\u627f\u8a8d\u3092\u4f5c\u6210
-summary=${number} \u4fdd\u7559\u306e\u627f\u8a8d
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
deleted file mode 100644
index c24f3d8..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=View all Approvals
-duedate=Due date
-owner=Owner
-createApproval=Create Approval
-summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
deleted file mode 100644
index 10281ff..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
+++ /dev/null
@@ -1,22 +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.
-#
-alerts.view.all=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u044f\u0432\u043a\u0438
-duedate=\u0421\u0440\u043e\u043a
-owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
-createApproval=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u044f\u0432\u043a\u0443
-summary=\u041e\u0436\u0438\u0434\u0430\u044e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f: ${number}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index be67966..207c789 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -268,16 +268,15 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
}
// mount resources
- ClassPathScanImplementationLookup classPathScanImplementationLookup =
- (ClassPathScanImplementationLookup) getServletContext().
- getAttribute(EnduserInitializer.CLASSPATH_LOOKUP);
- for (final Class<? extends AbstractResource> resource : classPathScanImplementationLookup.getResources()) {
+ ClassPathScanImplementationLookup lookup = (ClassPathScanImplementationLookup) getServletContext().
+ getAttribute(EnduserInitializer.CLASSPATH_LOOKUP);
+ for (Class<? extends AbstractResource> resource : lookup.getResources()) {
Resource annotation = resource.getAnnotation(Resource.class);
if (annotation == null) {
LOG.debug("No @Resource annotation found on {}, ignoring", resource.getName());
} else {
try {
- final AbstractResource instance = resource.getDeclaredConstructor().newInstance();
+ AbstractResource instance = resource.getDeclaredConstructor().newInstance();
mountResource(annotation.path(), new ResourceReference(annotation.key()) {
@@ -365,5 +364,4 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
public CustomTemplateInfo getCustomTemplate() {
return customTemplate;
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java b/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
index 1dd9066..7e2f323 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
@@ -23,37 +23,44 @@ import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.lang3.tuple.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Utility class for manipulating properties files.
*/
public final class PropertyUtils {
- public static Pair<Properties, String> read(
+ private static final Logger LOG = LoggerFactory.getLogger(PropertyUtils.class);
+
+ public static Pair<Properties, File> read(
final Class<?> clazz, final String propertiesFileName, final String confDirProp) {
Properties props = new Properties();
- String confDirName = null;
+ File confDir = null;
try (InputStream is = clazz.getResourceAsStream("/" + propertiesFileName)) {
props.load(is);
- confDirName = props.getProperty(confDirProp);
+ String confDirName = props.getProperty(confDirProp);
if (confDirName != null) {
- File confDir = new File(confDirName);
+ confDir = new File(confDirName);
if (confDir.exists() && confDir.canRead() && confDir.isDirectory()) {
File confDirProps = new File(confDir, propertiesFileName);
if (confDirProps.exists() && confDirProps.canRead() && confDirProps.isFile()) {
props.clear();
props.load(new FileInputStream(confDirProps));
}
+ } else {
+ confDir = null;
+ LOG.warn("{} not existing, unreadable or not a directory, ignoring", confDirName);
}
}
} catch (Exception e) {
throw new RuntimeException("Could not read " + propertiesFileName, e);
}
- return Pair.of(props, confDirName);
+ return Pair.of(props, confDir);
}
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java b/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
index 8b3403b..6d43e1f 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
@@ -40,7 +40,6 @@ public class ReconciliationReportletConf extends AbstractReportletConf {
key,
username,
groupName,
- workflowId,
status,
creationDate,
lastLoginDate,
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java b/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
index 1608563..8f364ec 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
@@ -51,7 +51,6 @@ public class UserReportletConf extends AbstractAnyReportletConf {
key,
username,
- workflowId,
status,
creator,
creationDate,
[27/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
new file mode 100644
index 0000000..e16f5c2
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
@@ -0,0 +1,355 @@
+/*
+ * 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.client.console.approvals;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.DirectoryDataProvider;
+import org.apache.syncope.client.console.panels.DirectoryPanel;
+import org.apache.syncope.client.console.rest.UserRequestRestClient;
+import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel.ApprovalProvider;
+import org.apache.syncope.client.console.layout.FormLayoutInfoUtils;
+import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
+import org.apache.syncope.client.console.widgets.ApprovalsWidget;
+import org.apache.syncope.client.console.wizards.AjaxWizard;
+import org.apache.syncope.client.console.wizards.any.AnyWrapper;
+import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
+import org.apache.syncope.common.lib.AnyOperations;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.patch.PasswordPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.ProvisioningResult;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+
+public class ApprovalDirectoryPanel
+ extends DirectoryPanel<UserRequestForm, UserRequestForm, ApprovalProvider, UserRequestRestClient> {
+
+ private static final long serialVersionUID = -7122136682275797903L;
+
+ protected final BaseModal<UserRequestForm> manageApprovalModal = new BaseModal<UserRequestForm>("outer") {
+
+ private static final long serialVersionUID = 389935548143327858L;
+
+ @Override
+ protected void onConfigure() {
+ super.onConfigure();
+ addSubmitButton();
+ size(Modal.Size.Large);
+ }
+
+ };
+
+ public ApprovalDirectoryPanel(final String id, final PageReference pageReference) {
+ super(id, pageReference, true);
+ disableCheckBoxes();
+ setFooterVisibility(false);
+ modal.size(Modal.Size.Large);
+
+ addOuterObject(manageApprovalModal);
+
+ manageApprovalModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ updateResultTable(target);
+
+ Serializable widget = SyncopeConsoleSession.get().getAttribute(ApprovalsWidget.class.getName());
+ if (widget instanceof ApprovalsWidget) {
+ ((ApprovalsWidget) widget).refreshLatestAlerts(target);
+ }
+
+ manageApprovalModal.show(false);
+ }
+ });
+
+ restClient = new UserRequestRestClient();
+
+ initResultTable();
+
+ MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, FlowableEntitlement.WORKFLOW_FORM_SUBMIT);
+ }
+
+ @Override
+ protected List<IColumn<UserRequestForm, String>> getColumns() {
+ List<IColumn<UserRequestForm, String>> columns = new ArrayList<>();
+
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("taskId"), "taskId", "taskId"));
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("key"), "formKey", "formKey"));
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("username"), "username"));
+ columns.add(new DatePropertyColumn<>(
+ new ResourceModel("createTime"), "createTime", "createTime"));
+ columns.add(new DatePropertyColumn<>(
+ new ResourceModel("dueDate"), "dueDate", "dueDate"));
+ columns.add(new PropertyColumn<>(
+ new ResourceModel("owner"), "owner", "owner"));
+
+ return columns;
+ }
+
+ @Override
+ public ActionsPanel<UserRequestForm> getActions(final IModel<UserRequestForm> model) {
+ final ActionsPanel<UserRequestForm> panel = super.getActions(model);
+
+ panel.add(new ActionLink<UserRequestForm>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final UserRequestForm ignore) {
+ claimForm(model.getObject().getTaskId());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ target.add(container);
+ }
+ }, ActionLink.ActionType.CLAIM, FlowableEntitlement.WORKFLOW_FORM_CLAIM);
+
+ panel.add(new ActionLink<UserRequestForm>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final UserRequestForm ignore) {
+ manageApprovalModal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
+
+ target.add(manageApprovalModal.setContent(
+ new ApprovalModal(manageApprovalModal, pageRef, model.getObject()) {
+
+ private static final long serialVersionUID = 5546519445061007248L;
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target) {
+ try {
+ super.onSubmit(target);
+
+ ApprovalDirectoryPanel.this.getTogglePanel().close(target);
+ } catch (SyncopeClientException e) {
+ SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ }));
+
+ manageApprovalModal.header(new Model<>(getString("approval.manage", new Model<>(model.getObject()))));
+ manageApprovalModal.show(true);
+ }
+
+ @Override
+ protected boolean statusCondition(final UserRequestForm modelObject) {
+ return SyncopeConsoleSession.get().getSelfTO().getUsername().
+ equals(model.getObject().getOwner());
+ }
+
+ }, ActionLink.ActionType.MANAGE_APPROVAL, FlowableEntitlement.WORKFLOW_FORM_READ);
+
+ // SYNCOPE-1200 edit user while in approval state
+ panel.add(new ActionLink<UserRequestForm>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final UserRequestForm ignore) {
+ modal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
+
+ UserRequestForm formTO = model.getObject();
+ UserTO newUserTO;
+ UserTO previousUserTO;
+ if (formTO.getUserPatch() == null) {
+ newUserTO = formTO.getUserTO();
+ previousUserTO = null;
+ } else if (formTO.getUserTO() == null) {
+ // make it stronger by handling possible NPE
+ previousUserTO = new UserTO();
+ previousUserTO.setKey(formTO.getUserPatch().getKey());
+ newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
+ } else {
+ previousUserTO = formTO.getUserTO();
+ formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
+ formTO.getUserTO().setPassword(null);
+ newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
+ }
+
+ AjaxWizard.EditItemActionEvent<UserTO> editItemActionEvent =
+ new AjaxWizard.EditItemActionEvent<>(newUserTO, target);
+ editItemActionEvent.forceModalPanel(new ApprovalUserWizardBuilder(
+ model.getObject(),
+ previousUserTO,
+ newUserTO,
+ new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
+ FormLayoutInfoUtils.fetch(Collections.singletonList(AnyTypeKind.USER.name())).getLeft(),
+ pageRef
+ ).build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT));
+
+ send(ApprovalDirectoryPanel.this, Broadcast.EXACT, editItemActionEvent);
+ }
+
+ @Override
+ protected boolean statusCondition(final UserRequestForm modelObject) {
+ return SyncopeConsoleSession.get().getSelfTO().getUsername().
+ equals(model.getObject().getOwner());
+ }
+
+ }, ActionLink.ActionType.EDIT_APPROVAL, FlowableEntitlement.WORKFLOW_FORM_SUBMIT);
+
+ return panel;
+ }
+
+ @Override
+ protected ApprovalProvider dataProvider() {
+ return new ApprovalProvider(rows);
+ }
+
+ @Override
+ protected String paginatorRowsKey() {
+ return Constants.PREF_WORKFLOW_FORM_PAGINATOR_ROWS;
+ }
+
+ public static class ApprovalProvider extends DirectoryDataProvider<UserRequestForm> {
+
+ private static final long serialVersionUID = -2311716167583335852L;
+
+ private final UserRequestRestClient restClient = new UserRequestRestClient();
+
+ public ApprovalProvider(final int paginatorRows) {
+ super(paginatorRows);
+
+ setSort("createTime", SortOrder.ASCENDING);
+ }
+
+ @Override
+ public Iterator<UserRequestForm> iterator(final long first, final long count) {
+ int page = ((int) first / paginatorRows);
+ return restClient.getForms((page < 0 ? 0 : page) + 1, paginatorRows, getSort()).iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.countForms();
+ }
+
+ @Override
+ public IModel<UserRequestForm> model(final UserRequestForm form) {
+ return new IModel<UserRequestForm>() {
+
+ private static final long serialVersionUID = -2566070996511906708L;
+
+ @Override
+ public UserRequestForm getObject() {
+ return form;
+ }
+ };
+ }
+ }
+
+ @Override
+ protected Collection<ActionLink.ActionType> getBatches() {
+ return Collections.<ActionLink.ActionType>emptyList();
+ }
+
+ private void claimForm(final String taskId) {
+ try {
+ restClient.claimForm(taskId);
+ } catch (SyncopeClientException scee) {
+ SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ }
+ }
+
+ private class ApprovalUserWizardBuilder extends UserWizardBuilder {
+
+ private static final long serialVersionUID = 1854981134836384069L;
+
+ private final UserRequestForm formTO;
+
+ ApprovalUserWizardBuilder(
+ final UserRequestForm formTO,
+ final UserTO previousUserTO,
+ final UserTO userTO,
+ final List<String> anyTypeClasses,
+ final UserFormLayoutInfo formLayoutInfo,
+ final PageReference pageRef) {
+
+ super(previousUserTO, userTO, anyTypeClasses, formLayoutInfo, pageRef);
+ this.formTO = formTO;
+ }
+
+ @Override
+ protected Serializable onApplyInternal(final AnyWrapper<UserTO> modelObject) {
+ UserTO inner = modelObject.getInnerObject();
+
+ ProvisioningResult<UserTO> result;
+
+ UserPatch patch = AnyOperations.diff(inner, formTO.getUserTO(), false);
+
+ if (StringUtils.isNotBlank(inner.getPassword())) {
+ PasswordPatch passwordPatch = new PasswordPatch.Builder().
+ value(inner.getPassword()).onSyncope(true).resources(inner.
+ getResources()).
+ build();
+ patch.setPassword(passwordPatch);
+ }
+ // update just if it is changed
+ if (patch.isEmpty()) {
+ result = new ProvisioningResult<>();
+ result.setEntity(inner);
+ } else {
+ result = userRestClient.update(getOriginalItem().getInnerObject().getETagValue(), patch);
+ UserRequestForm workFlowTO = restClient.getForms(result.getEntity().getKey()).get(0);
+ if (workFlowTO != null) {
+ claimForm(workFlowTO.getTaskId());
+ }
+ }
+
+ return result;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
new file mode 100644
index 0000000..0cae1c8
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
@@ -0,0 +1,82 @@
+/*
+ * 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.client.console.approvals;
+
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.panels.MultilevelPanel;
+import org.apache.syncope.client.console.rest.UserRequestRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.syncope.client.console.panels.SubmitableModalPanel;
+import org.apache.syncope.client.console.panels.WizardModalPanel;
+
+public class ApprovalModal extends Panel implements SubmitableModalPanel, WizardModalPanel<UserRequestForm> {
+
+ private static final long serialVersionUID = -8847854414429745216L;
+
+ private final UserRequestRestClient restClient = new UserRequestRestClient();
+
+ private final BaseModal<?> modal;
+
+ private final UserRequestForm formTO;
+
+ private final PageReference pageRef;
+
+ public ApprovalModal(final BaseModal<?> modal, final PageReference pageRef, final UserRequestForm formTO) {
+ super(BaseModal.CONTENT_ID);
+ this.modal = modal;
+ this.formTO = formTO;
+ this.pageRef = pageRef;
+
+ MultilevelPanel mlp = new MultilevelPanel("approval");
+ mlp.setFirstLevel(new Approval(pageRef, formTO) {
+
+ private static final long serialVersionUID = -2195387360323687302L;
+
+ @Override
+ protected void viewDetails(final AjaxRequestTarget target) {
+ mlp.next(getString("approval.details"), new ApprovalDetails(pageRef, formTO), target);
+ }
+ });
+ add(mlp);
+ }
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target) {
+ this.restClient.submitForm(formTO);
+ this.modal.show(false);
+ this.modal.close(target);
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ }
+
+ @Override
+ public void onError(final AjaxRequestTarget target) {
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ @Override
+ public UserRequestForm getItem() {
+ return this.formTO;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
new file mode 100644
index 0000000..0dbc4db
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
@@ -0,0 +1,41 @@
+/*
+ * 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.client.console.pages;
+
+import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
+import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public class Approvals extends BasePage {
+
+ private static final long serialVersionUID = -1100228004207271271L;
+
+ public Approvals(final PageParameters parameters) {
+ super(parameters);
+
+ body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
+
+ WebMarkupContainer content = new WebMarkupContainer("content");
+ content.setOutputMarkupId(true);
+ body.add(content);
+
+ content.add(new ApprovalDirectoryPanel("wfPanel", getPageReference()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java
new file mode 100644
index 0000000..562aad1
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/Flowable.java
@@ -0,0 +1,67 @@
+/*
+ * 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.client.console.pages;
+
+import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.annotations.ExtPage;
+import org.apache.syncope.client.console.panels.BpmnProcessDirectoryPanel;
+import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+@ExtPage(label = "Flowable", icon = "fa-briefcase",
+ listEntitlement = FlowableEntitlement.BPMN_PROCESS_LIST, priority = 200)
+public class Flowable extends BaseExtPage {
+
+ private static final long serialVersionUID = -8781434495150074529L;
+
+ public Flowable(final PageParameters parameters) {
+ super(parameters);
+
+ body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
+
+ WebMarkupContainer content = new WebMarkupContainer("content");
+ content.setOutputMarkupId(true);
+ body.add(content);
+
+ WebMarkupContainer disabled = new WebMarkupContainer("disabled");
+ disabled.setOutputMarkupPlaceholderTag(true);
+ content.add(disabled);
+
+ WizardMgtPanel<BpmnProcessTO> bpmnProcessesPanel = new BpmnProcessDirectoryPanel.Builder(getPageReference()) {
+
+ private static final long serialVersionUID = -5960765294082359003L;
+
+ }.disableCheckBoxes().build("bpmnProcessesPanel");
+ bpmnProcessesPanel.setOutputMarkupPlaceholderTag(true);
+ MetaDataRoleAuthorizationStrategy.authorize(bpmnProcessesPanel, ENABLE, FlowableEntitlement.BPMN_PROCESS_LIST);
+
+ content.add(bpmnProcessesPanel);
+
+ if (SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Flowable")) {
+ disabled.setVisible(false);
+ } else {
+ bpmnProcessesPanel.setVisible(false);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
new file mode 100644
index 0000000..b55d2b5
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
@@ -0,0 +1,27 @@
+/*
+ * 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.client.console.pages;
+
+import org.apache.wicket.markup.html.WebPage;
+
+public class FlowableModelerPopupPage extends WebPage {
+
+ private static final long serialVersionUID = -7031206743629422898L;
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java
new file mode 100644
index 0000000..b7914bb
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/BpmnProcessDirectoryPanel.java
@@ -0,0 +1,308 @@
+/*
+ * 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.client.console.panels;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.DirectoryDataProvider;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.pages.ModelerPopupPage;
+import org.apache.syncope.client.console.panels.BpmnProcessDirectoryPanel.BpmProcessDataProvider;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.ImageModalPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.XMLEditorPanel;
+import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.wizard.WizardModel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.io.IOUtils;
+
+public class BpmnProcessDirectoryPanel extends DirectoryPanel<
+ BpmnProcessTO, BpmnProcessTO, BpmProcessDataProvider, BpmnProcessRestClient> {
+
+ private static final long serialVersionUID = 2705668831139984998L;
+
+ private static final String FLOWABLE_MODELER_CTX = "flowable-modeler";
+
+ private final BaseModal<String> utility;
+
+ protected BpmnProcessDirectoryPanel(final String id, final Builder builder) {
+ super(id, builder);
+
+ this.addNewItemPanelBuilder(new AjaxWizardBuilder<BpmnProcessTO>(new BpmnProcessTO(), pageRef) {
+
+ private static final long serialVersionUID = 1633859795677053912L;
+
+ @Override
+ protected WizardModel buildModelSteps(
+ final BpmnProcessTO modelObject, final WizardModel wizardModel) {
+
+ return wizardModel;
+ }
+ }, false);
+ NewBpmnProcess newBpmnProcess = new NewBpmnProcess("newBpmnProcess", container, pageRef);
+ addInnerObject(newBpmnProcess);
+ AjaxLink<Void> newBpmnProcessLink = new AjaxLink<Void>("add") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ newBpmnProcess.toggle(target, true);
+ }
+ };
+ ((WebMarkupContainer) get("container:content")).addOrReplace(newBpmnProcessLink);
+
+ setShowResultPage(true);
+
+ modal.size(Modal.Size.Large);
+
+ utility = new BaseModal<>("outer");
+ addOuterObject(utility);
+ utility.size(Modal.Size.Large);
+ AjaxSubmitLink xmlEditorSubmit = utility.addSubmitButton();
+ MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, RENDER, FlowableEntitlement.BPMN_PROCESS_SET);
+ utility.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ utility.show(false);
+ utility.close(target);
+ }
+ });
+ initResultTable();
+ }
+
+ @Override
+ protected BpmProcessDataProvider dataProvider() {
+ return new BpmProcessDataProvider(rows);
+ }
+
+ @Override
+ protected String paginatorRowsKey() {
+ return Constants.PREF_WORKFLOW_PAGINATOR_ROWS;
+ }
+
+ @Override
+ protected List<IColumn<BpmnProcessTO, String>> getColumns() {
+ List<IColumn<BpmnProcessTO, String>> columns = new ArrayList<>();
+
+ columns.add(new PropertyColumn<>(new ResourceModel("key"), "key"));
+ columns.add(new PropertyColumn<>(new ResourceModel("name"), "name", "name"));
+
+ return columns;
+ }
+
+ @Override
+ public ActionsPanel<BpmnProcessTO> getActions(final IModel<BpmnProcessTO> model) {
+ final ActionsPanel<BpmnProcessTO> panel = super.getActions(model);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = -184018732772021627L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ final IModel<String> wfDefinition = new Model<>();
+ try {
+ wfDefinition.setObject(IOUtils.toString(restClient.getDefinition(
+ MediaType.APPLICATION_XML_TYPE, model.getObject().getKey())));
+ } catch (IOException e) {
+ LOG.error("Could not get workflow definition", e);
+ }
+
+ utility.header(Model.of(model.getObject().getKey()));
+ utility.setContent(new XMLEditorPanel(utility, wfDefinition, false, pageRef) {
+
+ private static final long serialVersionUID = -7688359318035249200L;
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target) {
+ if (StringUtils.isNotBlank(wfDefinition.getObject())) {
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_XML_TYPE,
+ model.getObject().getKey(), wfDefinition.getObject());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+
+ target.add(container);
+ utility.show(false);
+ utility.close(target);
+ } catch (SyncopeClientException e) {
+ SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
+ ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ }
+ });
+ utility.show(target);
+ target.add(utility);
+ }
+ }, ActionLink.ActionType.EDIT, FlowableEntitlement.BPMN_PROCESS_SET);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ modal.header(Model.of(model.getObject().getKey()));
+ modal.setContent(new ImageModalPanel<>(
+ modal, restClient.getDiagram(model.getObject().getKey()), pageRef));
+ modal.show(target);
+ target.add(modal);
+ }
+ }, ActionLink.ActionType.VIEW, FlowableEntitlement.BPMN_PROCESS_GET);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = -184018732772021627L;
+
+ @Override
+ public Class<? extends Page> getPageClass() {
+ return ModelerPopupPage.class;
+ }
+
+ @Override
+ public PageParameters getPageParameters() {
+ PageParameters parameters = new PageParameters();
+ parameters.add(Constants.MODELER_CONTEXT, FLOWABLE_MODELER_CTX);
+ parameters.add(Constants.MODEL_ID_PARAM, model.getObject().getModelId());
+
+ return parameters;
+ }
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ // do nothing
+ }
+ }, ActionLink.ActionType.EXTERNAL_EDITOR, FlowableEntitlement.BPMN_PROCESS_SET);
+
+ panel.add(new ActionLink<BpmnProcessTO>() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected boolean statusCondition(final BpmnProcessTO modelObject) {
+ return !modelObject.isUserWorkflow();
+ }
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final BpmnProcessTO ignore) {
+ try {
+ restClient.deleteDefinition(model.getObject().getKey());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ target.add(container);
+ } catch (SyncopeClientException e) {
+ LOG.error("While deleting BPMN definition {}", model.getObject().getName(), e);
+ SyncopeConsoleSession.get().error(
+ StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, FlowableEntitlement.BPMN_PROCESS_DELETE, true);
+
+ return panel;
+ }
+
+ @Override
+ protected Collection<ActionLink.ActionType> getBatches() {
+ return Collections.emptyList();
+ }
+
+ public abstract static class Builder
+ extends DirectoryPanel.Builder<BpmnProcessTO, BpmnProcessTO, BpmnProcessRestClient> {
+
+ private static final long serialVersionUID = 5088962796986706805L;
+
+ public Builder(final PageReference pageRef) {
+ super(new BpmnProcessRestClient(), pageRef);
+ }
+
+ @Override
+ protected WizardMgtPanel<BpmnProcessTO> newInstance(final String id, final boolean wizardInModal) {
+ return new BpmnProcessDirectoryPanel(id, this);
+ }
+ }
+
+ protected class BpmProcessDataProvider extends DirectoryDataProvider<BpmnProcessTO> {
+
+ private static final long serialVersionUID = 1764153405387687592L;
+
+ private final SortableDataProviderComparator<BpmnProcessTO> comparator;
+
+ private final BpmnProcessRestClient restClient = new BpmnProcessRestClient();
+
+ public BpmProcessDataProvider(final int paginatorRows) {
+ super(paginatorRows);
+ this.comparator = new SortableDataProviderComparator<>(this);
+ setSort("key", SortOrder.ASCENDING);
+ }
+
+ @Override
+ public Iterator<BpmnProcessTO> iterator(final long first, final long count) {
+ List<BpmnProcessTO> result = restClient.getDefinitions();
+ Collections.sort(result, comparator);
+ return result.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.getDefinitions().size();
+ }
+
+ @Override
+ public IModel<BpmnProcessTO> model(final BpmnProcessTO object) {
+ return new CompoundPropertyModel<>(object);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java
new file mode 100644
index 0000000..e28fb62
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/NewBpmnProcess.java
@@ -0,0 +1,87 @@
+/*
+ * 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.client.console.panels;
+
+import java.io.Serializable;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.pdfbox.util.Charsets;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.Model;
+
+public class NewBpmnProcess extends TogglePanel<Serializable> {
+
+ private static final long serialVersionUID = -4886361549305302161L;
+
+ private final BpmnProcessRestClient restClient = new BpmnProcessRestClient();
+
+ private final Form<?> form;
+
+ public NewBpmnProcess(final String id, final WebMarkupContainer container, final PageReference pageRef) {
+ super(id, pageRef);
+
+ form = new Form<>("form");
+ addInnerObject(form);
+
+ final TextField<String> key = new TextField<>("key", new Model<>());
+ key.setRequired(true);
+ form.add(key);
+
+ form.add(new AjaxSubmitLink("submit", form) {
+
+ private static final long serialVersionUID = 4947613489823025052L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target) {
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_XML_TYPE, key.getModelObject(),
+ IOUtils.toString(
+ getClass().getResourceAsStream("empty.bpmn20.xml"),
+ Charsets.UTF_8.name()).replaceAll("%KEY%", key.getModelObject()));
+
+ key.getModel().setObject(null);
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ toggle(target, false);
+ target.add(container);
+ } catch (Exception e) {
+ LOG.error("While creating new BPMN process", e);
+ SyncopeConsoleSession.get().error(
+ StringUtils.isBlank(e.getMessage())
+ ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target) {
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.java
new file mode 100644
index 0000000..91a42e3
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/AbstractBpmnProcessResource.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.client.console.resources;
+
+import javax.ws.rs.NotFoundException;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.string.StringValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+abstract class AbstractBpmnProcessResource extends AbstractResource {
+
+ private static final long serialVersionUID = 5163553843196539019L;
+
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractBpmnProcessResource.class);
+
+ protected final BpmnProcessRestClient restClient = new BpmnProcessRestClient();
+
+ protected BpmnProcessTO getBpmnProcess(final Attributes attributes) {
+ StringValue modelId = attributes.getRequest().getQueryParameters().getParameterValue(Constants.MODEL_ID_PARAM);
+
+ BpmnProcessTO bpmnProcess = modelId == null || modelId.isNull()
+ ? null
+ : restClient.getDefinitions().stream().
+ filter(object -> modelId.toString().equals(object.getModelId())).findAny().orElse(null);
+ if (bpmnProcess == null) {
+ throw new NotFoundException("BPMN process with modelId " + modelId);
+ }
+
+ return bpmnProcess;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java
new file mode 100644
index 0000000..ba34502
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessGETResource.java
@@ -0,0 +1,56 @@
+/*
+ * 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.client.console.resources;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.client.console.annotations.Resource;
+import org.apache.syncope.client.console.rest.BpmnProcessRestClient;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.wicket.util.io.IOUtils;
+
+/**
+ * Mirror REST resource for obtaining BPMN process in JSON (used by Flowable Modeler).
+ */
+@Resource(key = "bpmnProcessGET", path = "/bpmnProcessGET")
+public class BpmnProcessGETResource extends AbstractBpmnProcessResource {
+
+ private static final long serialVersionUID = 4637304868056148970L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ final BpmnProcessTO toGet = getBpmnProcess(attributes);
+
+ ResourceResponse response = new ResourceResponse();
+ response.disableCaching();
+ response.setContentType(MediaType.APPLICATION_JSON);
+ response.setTextEncoding(StandardCharsets.UTF_8.name());
+ response.setWriteCallback(new WriteCallback() {
+
+ @Override
+ public void writeData(final Attributes attributes) throws IOException {
+ IOUtils.copy(new BpmnProcessRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE, toGet.getKey()),
+ attributes.getResponse().getOutputStream());
+ }
+ });
+
+ return response;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java
new file mode 100644
index 0000000..d583396
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/resources/BpmnProcessPUTResource.java
@@ -0,0 +1,73 @@
+/*
+ * 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.client.console.resources;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.cxf.common.util.UrlUtils;
+import org.apache.syncope.client.console.annotations.Resource;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.wicket.util.io.IOUtils;
+
+/**
+ * Mirror REST resource for setting BPMN process in JSON (used by Flowable Modeler).
+ */
+@Resource(key = "bpmnProcessPUT", path = "/bpmnProcessPUT")
+public class BpmnProcessPUTResource extends AbstractBpmnProcessResource {
+
+ private static final long serialVersionUID = 2964542005207297944L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ String definition = null;
+ try {
+ HttpServletRequest request = (HttpServletRequest) attributes.getRequest().getContainerRequest();
+ String requestBody = IOUtils.toString(request.getInputStream());
+ String[] split = requestBody.split("&");
+ for (int i = 0; i < split.length && definition == null; i++) {
+ String keyValue = split[i];
+ if (keyValue.startsWith("json_xml=")) {
+ definition = UrlUtils.urlDecode(keyValue.split("=")[1]);
+ }
+ }
+ } catch (IOException e) {
+ LOG.error("Could not extract BPMN process", e);
+ }
+
+ BpmnProcessTO toSet = getBpmnProcess(attributes);
+
+ if (definition == null || toSet == null) {
+ return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
+ setError(Response.Status.BAD_REQUEST.getStatusCode(),
+ "Could not extract BPMN process' model id and / or definition");
+ }
+
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_JSON_TYPE, toSet.getKey(), definition);
+ return new ResourceResponse().setStatusCode(Response.Status.NO_CONTENT.getStatusCode());
+ } catch (Exception e) {
+ LOG.error("While updating BPMN process", e);
+ return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
+ setError(Response.Status.BAD_REQUEST.getStatusCode(),
+ "While updating BPMN process: " + e.getMessage());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java
new file mode 100644
index 0000000..2b7c368
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/BpmnProcessRestClient.java
@@ -0,0 +1,72 @@
+/*
+ * 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.client.console.rest;
+
+import java.io.InputStream;
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.BpmnProcessService;
+
+public class BpmnProcessRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 5049285686167071017L;
+
+ private BpmnProcessService getService(final MediaType mediaType) {
+ return SyncopeConsoleSession.get().getService(mediaType, BpmnProcessService.class);
+ }
+
+ public List<BpmnProcessTO> getDefinitions() {
+ return getService(BpmnProcessService.class).list();
+ }
+
+ public InputStream getDefinition(final MediaType mediaType, final String key) {
+ Response response = getService(mediaType).get(key);
+
+ return (InputStream) response.getEntity();
+ }
+
+ public byte[] getDiagram(final String key) {
+ BpmnProcessService service = getService(BpmnProcessService.class);
+ WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
+ Response response = service.exportDiagram(key);
+
+ byte[] diagram;
+ try {
+ diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
+ } catch (Exception e) {
+ LOG.error("Could not get workflow diagram", e);
+ diagram = new byte[0];
+ }
+ return diagram;
+ }
+
+ public void setDefinition(final MediaType mediaType, final String key, final String definition) {
+ getService(mediaType).set(key, definition);
+ }
+
+ public void deleteDefinition(final String key) {
+ getService(BpmnProcessService.class).delete(key);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java
new file mode 100644
index 0000000..555555b
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserRequestRestClient.java
@@ -0,0 +1,54 @@
+/*
+ * 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.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
+
+public class UserRequestRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -4785231164900813921L;
+
+ public int countForms() {
+ return getService(UserRequestService.class).
+ getForms(new UserRequestFormQuery.Builder().page(1).size(1).build()).
+ getTotalCount();
+ }
+
+ public List<UserRequestForm> getForms(final int page, final int size, final SortParam<String> sort) {
+ return getService(UserRequestService.class).
+ getForms(new UserRequestFormQuery.Builder().page(page).size(size).orderBy(toOrderBy(sort)).build()).
+ getResult();
+ }
+
+ public List<UserRequestForm> getForms(final String userKey) {
+ return getService(UserRequestService.class).getForms(userKey);
+ }
+
+ public UserRequestForm claimForm(final String taskKey) {
+ return getService(UserRequestService.class).claimForm(taskKey);
+ }
+
+ public void submitForm(final UserRequestForm form) {
+ getService(UserRequestService.class).submitForm(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java
new file mode 100644
index 0000000..68d5856
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowTaskRestClient.java
@@ -0,0 +1,34 @@
+/*
+ * 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.client.console.rest;
+
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.common.rest.api.service.UserWorkflowTaskService;
+
+public class UserWorkflowTaskRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 5765024947677482995L;
+
+ public UserTO executeNextTask(final UserTO userTO) {
+ WorkflowTaskExecInput input = new WorkflowTaskExecInput();
+ input.setUserKey(userTO.getKey());
+ return getService(UserWorkflowTaskService.class).executeNextTask(input);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
new file mode 100644
index 0000000..8f8329e
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
@@ -0,0 +1,130 @@
+/*
+ * 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.client.console.widgets;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.image.Icon;
+import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconTypeBuilder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.annotations.ExtWidget;
+import org.apache.syncope.client.console.pages.Approvals;
+import org.apache.syncope.client.console.rest.UserRequestRestClient;
+import org.apache.syncope.client.console.wicket.ajax.IndicatorAjaxTimerBehavior;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.util.time.Duration;
+
+@ExtWidget(priority = 10)
+public class ApprovalsWidget extends ExtAlertWidget<UserRequestForm> {
+
+ private static final long serialVersionUID = 7667120094526529934L;
+
+ private final UserRequestRestClient restClient = new UserRequestRestClient();
+
+ private final List<UserRequestForm> lastApprovals = new ArrayList<>();
+
+ public ApprovalsWidget(final String id, final PageReference pageRef) {
+ super(id);
+ setOutputMarkupId(true);
+
+ latestAlertsList.add(new IndicatorAjaxTimerBehavior(Duration.seconds(30)) {
+
+ private static final long serialVersionUID = 7298597675929755960L;
+
+ @Override
+ protected void onTimer(final AjaxRequestTarget target) {
+ if (!latestAlerts.getObject().equals(lastApprovals)) {
+ refreshLatestAlerts(target);
+ }
+ }
+ });
+ }
+
+ public final void refreshLatestAlerts(final AjaxRequestTarget target) {
+ latestAlerts.getObject().clear();
+ latestAlerts.getObject().addAll(lastApprovals);
+
+ int latestAlertSize = getLatestAlertsSize();
+ linkAlertsNumber.setDefaultModelObject(latestAlertSize);
+ target.add(linkAlertsNumber);
+
+ headerAlertsNumber.setDefaultModelObject(latestAlertSize);
+ target.add(headerAlertsNumber);
+
+ target.add(latestAlertsList);
+
+ lastApprovals.clear();
+ lastApprovals.addAll(latestAlerts.getObject());
+ }
+
+ @Override
+ protected int getLatestAlertsSize() {
+ return SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_LIST)
+ && SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_READ)
+ ? restClient.countForms()
+ : 0;
+ }
+
+ @Override
+ protected IModel<List<UserRequestForm>> getLatestAlerts() {
+ return new ListModel<UserRequestForm>() {
+
+ private static final long serialVersionUID = -2583290457773357445L;
+
+ @Override
+ public List<UserRequestForm> getObject() {
+ List<UserRequestForm> updatedApprovals;
+ if (SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_LIST)
+ && SyncopeConsoleSession.get().owns(FlowableEntitlement.WORKFLOW_FORM_READ)) {
+
+ updatedApprovals = restClient.getForms(1, MAX_SIZE, new SortParam<>("createTime", true));
+ } else {
+ updatedApprovals = Collections.<UserRequestForm>emptyList();
+ }
+
+ return updatedApprovals;
+ }
+ };
+ }
+
+ @Override
+ protected AbstractLink getEventsLink(final String linkid) {
+ BookmarkablePageLink<Approvals> approvals = BookmarkablePageLinkBuilder.build(linkid, Approvals.class);
+ MetaDataRoleAuthorizationStrategy.authorize(approvals, WebPage.ENABLE, FlowableEntitlement.WORKFLOW_FORM_LIST);
+ return approvals;
+ }
+
+ @Override
+ protected Icon getIcon(final String iconid) {
+ return new Icon(iconid,
+ FontAwesomeIconTypeBuilder.on(FontAwesomeIconTypeBuilder.FontAwesomeGraphic.handshake_o).build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/app-cfg.js
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/app-cfg.js b/ext/flowable/client-console/src/main/resources/app-cfg.js
new file mode 100644
index 0000000..15ec23a
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/app-cfg.js
@@ -0,0 +1,25 @@
+/* Copyright 2005-2015 Alfresco Software, Ltd.
+ *
+ * Licensed 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.
+ */
+
+'use strict';
+
+var FLOWABLE = FLOWABLE || {};
+
+FLOWABLE.CONFIG = {
+ 'onPremise' : true,
+ 'contextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler')) + '/flowable-modeler',
+ 'webContextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler') + '/flowable-modeler'),
+ 'datesLocalization' : false
+};
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
new file mode 100644
index 0000000..64805b9
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
@@ -0,0 +1,31 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div wicket:id="propView">
+ <span wicket:id="value">[value]</span>
+ </div>
+
+ <div style="margin: 20px 0">
+ <a href="#" alt="user details" class="btn btn-primary btn-circle btn-lg" wicket:id="userDetails" wicket:message="title:userDetails">
+ <i class="glyphicon glyphicon-eye-open"></i>
+ </a>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
new file mode 100644
index 0000000..450ff50
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.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.
+userDetails=User details
+userForm=Edit User
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
new file mode 100644
index 0000000..1de2361
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <span wicket:id="wizard"/>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
new file mode 100644
index 0000000..5d5d129
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <span wicket:id="approval">[APPROVAL]</span>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
new file mode 100644
index 0000000..84106b9
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=\u627f\u8a8d\u8a73\u7d30
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
new file mode 100644
index 0000000..941c896
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
@@ -0,0 +1,17 @@
+# 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.
+approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
new file mode 100644
index 0000000..92c475d
--- /dev/null
+++ b/ext/flowable/client-console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.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.
+userDetails=Dettagli utente
+userForm=Modifica utente
[02/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java
new file mode 100644
index 0000000..5446894
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java
@@ -0,0 +1,144 @@
+/*
+ * 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 static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+import org.apache.syncope.fit.AbstractITCase;
+import org.apache.syncope.fit.FlowableDetector;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+public class UserRequestITCase extends AbstractITCase {
+
+ @BeforeAll
+ public static void loadBpmnProcesses() throws IOException {
+ WebClient.client(bpmnProcessService).type(MediaType.APPLICATION_XML_TYPE);
+ bpmnProcessService.set("directorGroupRequest",
+ IOUtils.toString(UserRequestITCase.class.getResourceAsStream("/directorGroupRequest.bpmn20.xml")));
+ }
+
+ @Test
+ public void twoLevelsApproval() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("twoLevelsApproval@tirasa.net")).getEntity();
+ assertNotNull(user);
+ assertFalse(user.getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request
+ UserRequestTO req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // 1st approval -> reject
+ UserRequestForm form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("firstLevelApprove").get().setValue(Boolean.FALSE.toString());
+ userRequestService.submitForm(form);
+
+ // no more forms, group not assigned
+ assertTrue(userRequestService.getForms(user.getKey()).isEmpty());
+ assertFalse(userService.read(user.getKey()).getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request again
+ req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // 1st approval -> accept
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("firstLevelApprove").get().setValue(Boolean.TRUE.toString());
+ userRequestService.submitForm(form);
+
+ // 2nd approval -> reject
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("secondLevelApprove").get().setValue(Boolean.FALSE.toString());
+ user = userRequestService.submitForm(form);
+
+ // no more forms, group not assigned
+ assertTrue(userRequestService.getForms(user.getKey()).isEmpty());
+ assertFalse(userService.read(user.getKey()).getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request again
+ req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // 1st approval -> accept
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("firstLevelApprove").get().setValue(Boolean.TRUE.toString());
+ userRequestService.submitForm(form);
+
+ // 2nd approval -> accept
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("secondLevelApprove").get().setValue(Boolean.TRUE.toString());
+ user = userRequestService.submitForm(form);
+
+ // check that the director group was effectively assigned
+ assertTrue(user.getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+ assertTrue(userService.read(user.getKey()).getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+ }
+
+ @Test
+ public void cancel() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ PagedResult<UserRequestForm> forms =
+ userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("twoLevelsApproval@tirasa.net")).getEntity();
+ assertNotNull(user);
+ assertFalse(user.getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request
+ UserRequestTO req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // check that form was generated
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ assertEquals(1, userRequestService.getForms(user.getKey()).size());
+
+ // cancel request
+ userRequestService.cancel(req.getExecutionId(), "nothing in particular");
+
+ // check that form was removed
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms, forms.getTotalCount());
+
+ assertTrue(userRequestService.getForms(user.getKey()).isEmpty());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
index 48d9d55..0e48cf2 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
@@ -27,11 +27,15 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
+import java.util.Collections;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.UUID;
import javax.sql.DataSource;
import javax.ws.rs.ForbiddenException;
import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.client.lib.SyncopeClient;
@@ -46,18 +50,22 @@ import org.apache.syncope.common.lib.to.MembershipTO;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.ProvisioningResult;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.to.WorkflowTask;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.PatchOperation;
import org.apache.syncope.common.rest.api.beans.AnyQuery;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
import org.apache.syncope.common.rest.api.service.UserSelfService;
import org.apache.syncope.common.rest.api.service.UserService;
import org.apache.syncope.fit.AbstractITCase;
import org.apache.syncope.fit.FlowableDetector;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
@@ -74,7 +82,7 @@ public class UserSelfITCase extends AbstractITCase {
@Test
public void create() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// 1. self-registration as admin: failure
try {
@@ -96,7 +104,7 @@ public class UserSelfITCase extends AbstractITCase {
@Test
public void createAndApprove() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// self-create user with membership: goes 'createApproval' with resources and membership but no propagation
UserTO userTO = UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org");
@@ -122,10 +130,10 @@ public class UserSelfITCase extends AbstractITCase {
}
// now approve and verify that propagation has happened
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
- userTO = userWorkflowService.submitForm(form);
+ userTO = userRequestService.submitForm(form);
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());
assertNotNull(resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey()));
@@ -133,17 +141,17 @@ public class UserSelfITCase extends AbstractITCase {
@Test
public void read() {
- UserService userService2 = clientFactory.create("rossini", ADMIN_PWD).getService(UserService.class);
-
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("selfread@syncope.apache.org")).getEntity();
+ UserService us2 = clientFactory.create(user.getUsername(), "password123").getService(UserService.class);
try {
- userService2.read("1417acbe-cbf6-4277-9372-e75e04f97000");
+ us2.read(user.getKey());
fail("This should not happen");
} catch (ForbiddenException e) {
assertNotNull(e);
}
- Pair<Map<String, Set<String>>, UserTO> self = clientFactory.create("rossini", ADMIN_PWD).self();
- assertEquals("rossini", self.getRight().getUsername());
+ Pair<Map<String, Set<String>>, UserTO> self = clientFactory.create(user.getUsername(), "password123").self();
+ assertEquals(user.getUsername(), self.getRight().getUsername());
}
@Test
@@ -174,14 +182,14 @@ public class UserSelfITCase extends AbstractITCase {
readEntity(new GenericType<ProvisioningResult<UserTO>>() {
}).getEntity();
assertNotNull(updated);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active" : "created", updated.getStatus());
assertTrue(updated.getUsername().endsWith("XX"));
}
@Test
public void updateWithApproval() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// 1. create user as admin
UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org")).getEntity();
@@ -220,10 +228,10 @@ public class UserSelfITCase extends AbstractITCase {
}
// 3. approve self-update as admin
- WorkflowFormTO form = userWorkflowService.getFormForUser(updated.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
+ UserRequestForm form = userRequestService.getForms(updated.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
form.getProperty("approveUpdate").get().setValue(Boolean.TRUE.toString());
- updated = userWorkflowService.submitForm(form);
+ updated = userRequestService.submitForm(form);
assertNotNull(updated);
assertEquals("active", updated.getStatus());
assertTrue(updated.getUsername().endsWith("XX"));
@@ -244,17 +252,11 @@ public class UserSelfITCase extends AbstractITCase {
new GenericType<ProvisioningResult<UserTO>>() {
}).getEntity();
assertNotNull(deleted);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "deleteApproval" : null, deleted.getStatus());
}
@Test
- public void issueSYNCOPE373() {
- UserTO userTO = adminClient.self().getRight();
- assertEquals(ADMIN_UNAME, userTO.getUsername());
- }
-
- @Test
public void passwordReset() {
// 0. ensure that password request DOES require security question
configurationService.set(attrTO("passwordReset.securityQuestion", "true"));
@@ -400,4 +402,308 @@ public class UserSelfITCase extends AbstractITCase {
assertFalse(self.getRight().isMustChangePassword());
}
+ @Test
+ public void createWithReject() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ // User with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
+ userTO.getMemberships().add(new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
+
+ // 1. create user with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f
+ userTO = createUser(userTO).getEntity();
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
+ assertEquals("createApproval", userTO.getStatus());
+
+ // 2. request if there is any pending task for user just created
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ assertNotNull(form);
+ assertNotNull(form.getUsername());
+ assertEquals(userTO.getUsername(), form.getUsername());
+ assertNotNull(form.getTaskId());
+ assertNull(form.getOwner());
+
+ // 3. claim task as rossini, with role "User manager" granting entitlement to claim forms but not in
+ // groupForWorkflowApproval, designated for approval in workflow definition: fail
+ UserTO rossini = userService.read("1417acbe-cbf6-4277-9372-e75e04f97000");
+ if (!rossini.getRoles().contains("User manager")) {
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey("1417acbe-cbf6-4277-9372-e75e04f97000");
+ userPatch.getRoles().add(new StringPatchItem.Builder().
+ operation(PatchOperation.ADD_REPLACE).value("User manager").build());
+ rossini = updateUser(userPatch).getEntity();
+ }
+ assertTrue(rossini.getRoles().contains("User manager"));
+
+ UserRequestService userService2 = clientFactory.create("rossini", ADMIN_PWD).
+ getService(UserRequestService.class);
+ try {
+ userService2.claimForm(form.getTaskId());
+ fail("This should not happen");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.Workflow, e.getType());
+ }
+
+ // 4. claim task from bellini, with role "User manager" and in groupForWorkflowApproval
+ UserRequestService userService3 = clientFactory.create("bellini", ADMIN_PWD).
+ getService(UserRequestService.class);
+ form = userService3.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getOwner());
+
+ // 5. reject user
+ form.getProperty("approveCreate").get().setValue(Boolean.FALSE.toString());
+ form.getProperty("rejectReason").get().setValue("I don't like him.");
+ userTO = userService3.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals("rejected", userTO.getStatus());
+
+ // 6. check that rejected user was not propagated to external resource (SYNCOPE-364)
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ Exception exception = null;
+ try {
+ jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
+ new String[] { userTO.getUsername() }, Integer.class);
+ } catch (EmptyResultDataAccessException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ }
+
+ @Test
+ public void createWithApproval() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ // read forms *before* any operation
+ PagedResult<UserRequestForm> forms =
+ userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("createWithApproval@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ // User with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
+ userTO.getMemberships().add(
+ new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
+
+ // 1. create user and verify that no propagation occurred)
+ ProvisioningResult<UserTO> result = createUser(userTO);
+ assertNotNull(result);
+ userTO = result.getEntity();
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
+ assertEquals("createApproval", userTO.getStatus());
+ assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
+
+ assertTrue(result.getPropagationStatuses().isEmpty());
+
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ Exception exception = null;
+ try {
+ jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
+ new String[] { userTO.getUsername() }, Integer.class);
+ } catch (EmptyResultDataAccessException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+
+ // 2. request if there is any pending form for user just created
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ // 3. as admin, update user: still pending approval
+ String updatedUsername = "changed-" + UUID.randomUUID().toString();
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(userTO.getKey());
+ userPatch.setUsername(new StringReplacePatchItem.Builder().value(updatedUsername).build());
+ updateUser(userPatch);
+
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getUserTO());
+ assertEquals(updatedUsername, form.getUserTO().getUsername());
+ assertNull(form.getUserPatch());
+ assertNull(form.getOwner());
+
+ // 4. claim task (as admin)
+ form = userRequestService.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getUserTO());
+ assertEquals(updatedUsername, form.getUserTO().getUsername());
+ assertNull(form.getUserPatch());
+ assertNotNull(form.getOwner());
+
+ // 5. approve user (and verify that propagation occurred)
+ form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
+ userTO = userRequestService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals(updatedUsername, userTO.getUsername());
+ assertEquals("active", userTO.getStatus());
+ assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
+
+ String username = queryForObject(
+ jdbcTemplate, 50, "SELECT id FROM test WHERE id=?", String.class, userTO.getUsername());
+ assertEquals(userTO.getUsername(), username);
+
+ // 6. update user
+ userPatch = new UserPatch();
+ userPatch.setKey(userTO.getKey());
+ userPatch.setPassword(new PasswordPatch.Builder().value("anotherPassword123").build());
+
+ userTO = updateUser(userPatch).getEntity();
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void updateApproval() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ // read forms *before* any operation
+ PagedResult<UserRequestForm> forms = userRequestService.getForms(new UserRequestFormQuery.Builder().
+ page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO created = createUser(UserITCase.getUniqueSampleTO("updateApproval@syncope.apache.org")).getEntity();
+ assertNotNull(created);
+ assertEquals("/", created.getRealm());
+ assertEquals(0, created.getMemberships().size());
+
+ UserPatch patch = new UserPatch();
+ patch.setKey(created.getKey());
+ patch.getMemberships().add(new MembershipPatch.Builder().group("b1f7c12d-ec83-441f-a50e-1691daaedf3b").build());
+
+ SyncopeClient client = clientFactory.create(created.getUsername(), "password123");
+ Response response = client.getService(UserSelfService.class).update(patch);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ assertEquals("updateApproval", userService.read(created.getKey()).getStatus());
+
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ UserRequestForm form = userRequestService.getForms(created.getKey()).get(0);
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNull(form.getOwner());
+ assertNotNull(form.getUserTO());
+ assertNotNull(form.getUserPatch());
+ assertEquals(patch, form.getUserPatch());
+
+ // as admin, update user: still pending approval
+ UserPatch adminPatch = new UserPatch();
+ adminPatch.setKey(created.getKey());
+ adminPatch.setRealm(new StringReplacePatchItem.Builder().value("/even/two").build());
+
+ UserTO updated = updateUser(adminPatch).getEntity();
+ assertEquals("updateApproval", updated.getStatus());
+ assertEquals("/even/two", updated.getRealm());
+ assertEquals(0, updated.getMemberships().size());
+
+ // the patch is not updated in the approval form
+ form = userRequestService.getForms(created.getKey()).get(0);
+ assertEquals(patch, form.getUserPatch());
+
+ // approve the user
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("approveUpdate").get().setValue(Boolean.TRUE.toString());
+ userRequestService.submitForm(form);
+
+ // verify that the approved user bears both original and further changes
+ UserTO approved = userService.read(created.getKey());
+ assertEquals("active", approved.getStatus());
+ assertEquals("/even/two", approved.getRealm());
+ assertEquals(1, approved.getMemberships().size());
+ assertTrue(approved.getMembership("b1f7c12d-ec83-441f-a50e-1691daaedf3b").isPresent());
+ }
+
+ @Test
+ public void availableTasks() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("availableTasks@apache.org")).getEntity();
+ assertEquals("active", user.getStatus());
+
+ List<WorkflowTask> tasks = userWorkflowTaskService.getAvailableTasks(user.getKey());
+ assertNotNull(tasks);
+ assertTrue(tasks.stream().anyMatch(task -> "update".equals(task.getName())));
+ assertTrue(tasks.stream().anyMatch(task -> "suspend".equals(task.getName())));
+ assertTrue(tasks.stream().anyMatch(task -> "delete".equals(task.getName())));
+ }
+
+ @Test
+ public void issueSYNCOPE15() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ // read forms *before* any operation
+ PagedResult<UserRequestForm> forms = userRequestService.getForms(new UserRequestFormQuery.Builder().
+ page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("issueSYNCOPE15@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getMemberships().clear();
+
+ // Users with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
+ userTO.getMemberships().add(
+ new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
+
+ // 1. create user with group 9 (and verify that no propagation occurred)
+ userTO = createUser(userTO).getEntity();
+ assertNotNull(userTO);
+ assertNotEquals(0L, userTO.getKey());
+ assertNotNull(userTO.getCreationDate());
+ assertNotNull(userTO.getCreator());
+ assertNotNull(userTO.getLastChangeDate());
+ assertNotNull(userTO.getLastModifier());
+ assertEquals(userTO.getCreationDate(), userTO.getLastChangeDate());
+
+ // 2. request if there is any pending form for user just created
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ assertNotNull(form);
+
+ // 3. first claim by bellini ....
+ UserRequestService userService3 = clientFactory.create("bellini", ADMIN_PWD).
+ getService(UserRequestService.class);
+ form = userService3.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getOwner());
+
+ // 4. second claim task by admin
+ form = userRequestService.claimForm(form.getTaskId());
+ assertNotNull(form);
+
+ // 5. approve user
+ form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
+
+ // 6. submit approve
+ userTO = userRequestService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals(preForms,
+ userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build()).
+ getTotalCount());
+ assertTrue(userRequestService.getForms(userTO.getKey()).isEmpty());
+
+ // 7.check that no more forms are still to be processed
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms, forms.getTotalCount());
+ }
+
+ @Test
+ public void issueSYNCOPE373() {
+ UserTO userTO = adminClient.self().getRight();
+ assertEquals(ADMIN_UNAME, userTO.getUsername());
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java
deleted file mode 100644
index 24dc61d..0000000
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java
+++ /dev/null
@@ -1,361 +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.
- */
-package org.apache.syncope.fit.core;
-
-import org.apache.syncope.fit.FlowableDetector;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.UUID;
-import javax.sql.DataSource;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.patch.MembershipPatch;
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.StringPatchItem;
-import org.apache.syncope.common.lib.patch.StringReplacePatchItem;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.ProvisioningResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.PatchOperation;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.syncope.fit.AbstractITCase;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-
-@SpringJUnitConfig(locations = { "classpath:testJDBCEnv.xml" })
-public class UserWorkflowITCase extends AbstractITCase {
-
- @Autowired
- private DataSource testDataSource;
-
- @Test
- public void createWithReject() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- // User with group 9 are defined in workflow as subject to approval
- userTO.getMemberships().add(
- new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
-
- // 1. create user with group 9
- userTO = createUser(userTO).getEntity();
- assertNotNull(userTO);
- assertEquals(1, userTO.getMemberships().size());
- assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
- assertEquals("createApproval", userTO.getStatus());
-
- // 2. request if there is any pending task for user just created
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
- assertNotNull(form.getUsername());
- assertEquals(userTO.getUsername(), form.getUsername());
- assertNotNull(form.getTaskId());
- assertNull(form.getOwner());
-
- // 3. claim task as rossini, with role "User manager" granting entitlement to claim forms but not in group 7,
- // designated for approval in workflow definition: fail
- UserTO rossini = userService.read("1417acbe-cbf6-4277-9372-e75e04f97000");
- if (!rossini.getRoles().contains("User manager")) {
- UserPatch userPatch = new UserPatch();
- userPatch.setKey("1417acbe-cbf6-4277-9372-e75e04f97000");
- userPatch.getRoles().add(new StringPatchItem.Builder().
- operation(PatchOperation.ADD_REPLACE).value("User manager").build());
- rossini = updateUser(userPatch).getEntity();
- }
- assertTrue(rossini.getRoles().contains("User manager"));
-
- UserWorkflowService userService2 = clientFactory.create("rossini", ADMIN_PWD).
- getService(UserWorkflowService.class);
- try {
- userService2.claimForm(form.getTaskId());
- fail("This should not happen");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.Workflow, e.getType());
- }
-
- // 4. claim task from bellini, with role "User manager" and in group 7
- UserWorkflowService userService3 = clientFactory.create("bellini", ADMIN_PWD).
- getService(UserWorkflowService.class);
- form = userService3.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getOwner());
-
- // 5. reject user
- form.getProperty("approveCreate").get().setValue(Boolean.FALSE.toString());
- form.getProperty("rejectReason").get().setValue("I don't like him.");
- userTO = userService3.submitForm(form);
- assertNotNull(userTO);
- assertEquals("rejected", userTO.getStatus());
-
- // 6. check that rejected user was not propagated to external resource (SYNCOPE-364)
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- Exception exception = null;
- try {
- jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
- new String[] { userTO.getUsername() }, Integer.class);
- } catch (EmptyResultDataAccessException e) {
- exception = e;
- }
- assertNotNull(exception);
- }
-
- @Test
- public void createWithApproval() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- PagedResult<WorkflowFormTO> forms =
- userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- int preForms = forms.getTotalCount();
-
- UserTO userTO = UserITCase.getUniqueSampleTO("createWithApproval@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- // User with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
- userTO.getMemberships().add(
- new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
-
- // 1. create user and verify that no propagation occurred)
- ProvisioningResult<UserTO> result = createUser(userTO);
- assertNotNull(result);
- userTO = result.getEntity();
- assertEquals(1, userTO.getMemberships().size());
- assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
- assertEquals("createApproval", userTO.getStatus());
- assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
-
- assertTrue(result.getPropagationStatuses().isEmpty());
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- Exception exception = null;
- try {
- jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
- new String[] { userTO.getUsername() }, Integer.class);
- } catch (EmptyResultDataAccessException e) {
- exception = e;
- }
- assertNotNull(exception);
-
- // 2. request if there is any pending form for user just created
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms + 1, forms.getTotalCount());
-
- // 3. as admin, request for changes: still pending approval
- String updatedUsername = "changed-" + UUID.randomUUID().toString();
- userTO.setUsername(updatedUsername);
- userWorkflowService.executeTask("default", userTO);
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getUserTO());
- assertEquals(updatedUsername, form.getUserTO().getUsername());
- assertNull(form.getUserPatch());
- assertNull(form.getOwner());
-
- // 4. claim task (as admin)
- form = userWorkflowService.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getUserTO());
- assertEquals(updatedUsername, form.getUserTO().getUsername());
- assertNull(form.getUserPatch());
- assertNotNull(form.getOwner());
-
- // 5. approve user (and verify that propagation occurred)
- form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals(updatedUsername, userTO.getUsername());
- assertEquals("active", userTO.getStatus());
- assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
-
- String username = queryForObject(
- jdbcTemplate, 50, "SELECT id FROM test WHERE id=?", String.class, userTO.getUsername());
- assertEquals(userTO.getUsername(), username);
-
- // 6. update user
- UserPatch userPatch = new UserPatch();
- userPatch.setKey(userTO.getKey());
- userPatch.setPassword(new PasswordPatch.Builder().value("anotherPassword123").build());
-
- userTO = updateUser(userPatch).getEntity();
- assertNotNull(userTO);
- }
-
- @Test
- public void updateApproval() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- PagedResult<WorkflowFormTO> forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build());
- int preForms = forms.getTotalCount();
-
- UserTO created = createUser(UserITCase.getUniqueSampleTO("updateApproval@syncope.apache.org")).getEntity();
- assertNotNull(created);
- assertEquals("/", created.getRealm());
- assertEquals(0, created.getMemberships().size());
-
- UserPatch patch = new UserPatch();
- patch.setKey(created.getKey());
- patch.getMemberships().add(new MembershipPatch.Builder().group("b1f7c12d-ec83-441f-a50e-1691daaedf3b").build());
-
- SyncopeClient client = clientFactory.create(created.getUsername(), "password123");
- Response response = client.getService(UserSelfService.class).update(patch);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertEquals("updateApproval", userService.read(created.getKey()).getStatus());
-
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms + 1, forms.getTotalCount());
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(created.getKey());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNull(form.getOwner());
- assertNotNull(form.getUserTO());
- assertNotNull(form.getUserPatch());
- assertEquals(patch, form.getUserPatch());
-
- // as admin, request for more changes: still pending approval
- patch.setRealm(new StringReplacePatchItem.Builder().value("/even/two").build());
- response = userService.update(patch);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertEquals("updateApproval", userService.read(created.getKey()).getStatus());
-
- // the patch is updated in the approval form
- form = userWorkflowService.getFormForUser(created.getKey());
- assertEquals(patch, form.getUserPatch());
-
- // approve the user
- form = userWorkflowService.claimForm(form.getTaskId());
- form.getProperty("approveUpdate").get().setValue(Boolean.TRUE.toString());
- userWorkflowService.submitForm(form);
-
- // verify that the approved user bears both original and further changes
- UserTO approved = userService.read(created.getKey());
- assertNotNull(approved);
- assertEquals("/even/two", approved.getRealm());
- assertEquals(1, approved.getMemberships().size());
- assertNotNull(approved.getMembership("b1f7c12d-ec83-441f-a50e-1691daaedf3b").get());
- }
-
- @Test
- public void availableTasks() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- UserTO user = createUser(UserITCase.getUniqueSampleTO("availableTasks@apache.org")).getEntity();
- assertEquals("active", user.getStatus());
-
- List<WorkflowTaskTO> tasks = userWorkflowService.getAvailableTasks(user.getKey());
- assertNotNull(tasks);
- assertTrue(tasks.stream().anyMatch(task -> "update".equals(task.getName())));
- assertTrue(tasks.stream().anyMatch(task -> "suspend".equals(task.getName())));
- assertTrue(tasks.stream().anyMatch(task -> "delete".equals(task.getName())));
- }
-
- @Test
- public void issueSYNCOPE15() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- PagedResult<WorkflowFormTO> forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build());
- int preForms = forms.getTotalCount();
-
- UserTO userTO = UserITCase.getUniqueSampleTO("issueSYNCOPE15@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().clear();
- userTO.getMemberships().clear();
-
- // Users with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
- userTO.getMemberships().add(
- new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
-
- // 1. create user with group 9 (and verify that no propagation occurred)
- userTO = createUser(userTO).getEntity();
- assertNotNull(userTO);
- assertNotEquals(0L, userTO.getKey());
- assertNotNull(userTO.getCreationDate());
- assertNotNull(userTO.getCreator());
- assertNotNull(userTO.getLastChangeDate());
- assertNotNull(userTO.getLastModifier());
- assertEquals(userTO.getCreationDate(), userTO.getLastChangeDate());
-
- // 2. request if there is any pending form for user just created
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms + 1, forms.getTotalCount());
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
-
- // 3. first claim by bellini ....
- UserWorkflowService userService3 = clientFactory.create("bellini", ADMIN_PWD).
- getService(UserWorkflowService.class);
- form = userService3.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getOwner());
-
- // 4. second claim task by admin
- form = userWorkflowService.claimForm(form.getTaskId());
- assertNotNull(form);
-
- // 5. approve user
- form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
-
- // 6. submit approve
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals(
- preForms,
- userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build()).getTotalCount());
- assertNull(userWorkflowService.getFormForUser(userTO.getKey()));
-
- // 7.check that no more forms are still to be processed
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms, forms.getTotalCount());
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java
deleted file mode 100644
index 3a921f9..0000000
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java
+++ /dev/null
@@ -1,74 +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.
- */
-package org.apache.syncope.fit.core;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.Optional;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.fit.AbstractITCase;
-import org.apache.syncope.fit.FlowableDetector;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-public class WorkflowITCase extends AbstractITCase {
-
- private static String defaultUserKey = null;
-
- @BeforeAll
- public static void findDefault() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
- Optional<WorkflowDefinitionTO> found = workflowService.list(AnyTypeKind.USER.name()).stream().
- filter(object -> object.isMain()).findAny();
- if (found.isPresent()) {
- defaultUserKey = found.get().getKey();
- }
- assertNotNull(defaultUserKey);
- }
-
- @Test
- public void exportUserDefinition() throws IOException {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
- Response response = workflowService.get(AnyTypeKind.USER.name(), defaultUserKey);
- assertTrue(response.getMediaType().toString().
- startsWith(clientFactory.getContentType().getMediaType().toString()));
- assertTrue(response.getEntity() instanceof InputStream);
- String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
- assertNotNull(definition);
- assertFalse(definition.isEmpty());
- }
-
- @Test
- public void updateUserDefinition() throws IOException {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
- Response response = workflowService.get(AnyTypeKind.USER.name(), defaultUserKey);
- String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
-
- workflowService.set(AnyTypeKind.USER.name(), defaultUserKey, definition);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/resources/addFlowableToContent.xsl
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/addFlowableToContent.xsl b/fit/core-reference/src/test/resources/addFlowableToContent.xsl
index 746580d..7bb0d1e 100644
--- a/fit/core-reference/src/test/resources/addFlowableToContent.xsl
+++ b/fit/core-reference/src/test/resources/addFlowableToContent.xsl
@@ -24,19 +24,19 @@
<dataset>
<xsl:apply-templates/>
- <ACT_RU_EXECUTION ID_="4" REV_="2" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="4" REV_="2" PROC_INST_ID_="4" BUSINESS_KEY_="userWorkflow:1417acbe-cbf6-4277-9372-e75e04f97000" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="5" REV_="2" EXECUTION_ID_="4" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="6" REV_="2" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="6" REV_="2" PROC_INST_ID_="6" BUSINESS_KEY_="userWorkflow:74cd8ece-715a-44a4-a736-e17b46c4e7e6" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="7" REV_="2" EXECUTION_ID_="6" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="8" REV_="2" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="8" REV_="2" PROC_INST_ID_="8" BUSINESS_KEY_="userWorkflow:b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="9" REV_="2" EXECUTION_ID_="8" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="10" REV_="2" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="10" REV_="2" PROC_INST_ID_="10" BUSINESS_KEY_="userWorkflow:c9b2dec2-00a7-4855-97c0-d854842b4b24" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="11" REV_="2" EXECUTION_ID_="10" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="12" REV_="2" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="12" REV_="2" PROC_INST_ID_="12" BUSINESS_KEY_="userWorkflow:823074dc-d280-436d-a7dd-07399fae48ec" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="13" REV_="2" EXECUTION_ID_="12" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
</dataset>
</xsl:template>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/console.properties b/fit/core-reference/src/test/resources/console.properties
index 4d39cf0..6e47934 100644
--- a/fit/core-reference/src/test/resources/console.properties
+++ b/fit/core-reference/src/test/resources/console.properties
@@ -33,15 +33,12 @@ maxWaitTimeOnApplyChanges=30
csrf=false
-flowableModelerDirectory=${flowable-modeler.directory}
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
page.realms=org.apache.syncope.client.console.pages.Realms
page.topology=org.apache.syncope.client.console.topology.Topology
page.reports=org.apache.syncope.client.console.pages.Reports
-page.workflow=org.apache.syncope.client.console.pages.Workflow
page.audit=org.apache.syncope.client.console.pages.Audit
page.implementations=org.apache.syncope.client.console.pages.Implementations
page.logs=org.apache.syncope.client.console.pages.Logs
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/resources/hotswap-agent.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/hotswap-agent.properties b/fit/core-reference/src/test/resources/hotswap-agent.properties
index aa6d8e8..b834eb6 100644
--- a/fit/core-reference/src/test/resources/hotswap-agent.properties
+++ b/fit/core-reference/src/test/resources/hotswap-agent.properties
@@ -32,8 +32,15 @@ ${basedir}/../../core/provisioning-api/target/classes,\
${basedir}/../../core/provisioning-java/target/classes/org,\
${basedir}/../../core/workflow-api/target/classes,\
${basedir}/../../core/workflow-java/target/classes/org,\
-${basedir}/../../core/workflow-activiti/target/classes/org,\
-${basedir}/../../core/migration/target/classes,\
+${basedir}/../../ext/flowable/common-lib/target/classes,\
+${basedir}/../../ext/flowable/flowable-bpmn/target/classes/org,\
+${basedir}/../../ext/flowable/logic/target/classes,\
+${basedir}/../../ext/flowable/persistence-api/target/classes,\
+${basedir}/../../ext/flowable/persistence-jpa/target/classes/org/apache/syncope/core/persistence/jpa/dao,\
+${basedir}/../../ext/flowable/provisioning-api/target/classes,\
+${basedir}/../../ext/flowable/provisioning-java/target/classes,\
+${basedir}/../../ext/flowable/rest-api/target/classes,\
+${basedir}/../../ext/flowable/rest-cxf/target/classes/org,\
${basedir}/../../ext/camel/common-lib/target/classes,\
${basedir}/../../ext/camel/logic/target/classes,\
${basedir}/../../ext/camel/provisioning-camel/target/classes/org,\
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java b/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
index f5944b0..c0dfc65 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
@@ -22,88 +22,10 @@ public final class ConsolePom {
public static final String FLOWABLE_PLACEHOLDER = "</dependencies>";
- public static final String FLOWABLE_CONTENT_TO_ADD = "<dependency>\n"
- + " <groupId>org.flowable</groupId>\n"
- + " <artifactId>flowable-ui-modeler-app</artifactId>\n"
- + " <type>war</type>\n"
- + " <scope>test</scope>\n"
- + " </dependency>\n"
- + " </dependencies>\n";
-
- public static final String MODELER_PLACEHOLDER = "</finalName>";
-
- public static final String MODELER_CONTENT_TO_ADD = "</finalName><plugins>\n"
- + " <plugin>\n"
- + " <groupId>org.apache.maven.plugins</groupId>\n"
- + " <artifactId>maven-antrun-plugin</artifactId>\n"
- + " <inherited>true</inherited>\n"
- + " <executions>\n"
- + " <execution>\n"
- + " <id>setupFlowableModeler</id>\n"
- + " <phase>process-resources</phase>\n"
- + " <configuration>\n"
- + " <target>\n"
- + " <unzip src=\"${settings.localRepository}/org/flowable/flowable-ui-modeler-app/"
- + "${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war\" \n"
- + " dest=\"${flowable-modeler.directory}\">\n" + " <patternset>\n"
- + " <include name=\"WEB-INF/classes/static/**\"/>\n"
- + " <include name=\"WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar\"/>\n"
- + " </patternset>\n" + " </unzip>\n" + " \n"
- + " <unzip src=\"${flowable-modeler.directory}/WEB-INF/lib/"
- + "flowable-ui-modeler-logic-${flowable.version}.jar\"\n"
- + " dest=\"${flowable-modeler.directory}\">\n" + " <patternset>\n"
- + " <include name=\"stencilset_bpmn.json\"/>\n" + " </patternset>\n"
- + " </unzip>\n" + " \n"
- + " <move todir=\"${flowable-modeler.directory}\">\n"
- + " <fileset dir=\"${flowable-modeler.directory}/WEB-INF/classes/static/\">\n"
- + " <include name=\"**\"/>\n" + " </fileset>\n"
- + " </move>\n"
- + " <delete dir=\"${flowable-modeler.directory}/WEB-INF\"/>\n"
- + " \n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\"</head>\"\n"
- + " value=\"<script type="text/javascript">window.onunload = "
- + "refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>"
- + "\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\" ng-click="backToLanding()"\"\n"
- + " value=\" disabled="disabled"\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\"<ul class="nav navbar-nav" id="main-nav"\"\n"
- + " value=\"<ul class="nav navbar-nav" id="main-nav" "
- + "style="display: none;"\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\"<div class="pull-right\"\n"
- + " value=\"<div style="display: none;" class="pull-right\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/editor-app/editor.html\"\n"
- + " token=\"<div class="btn-group pull-right"\"\n"
- + " value=\"<div style="display: none;" class="btn-group "
- + "pull-right"\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/editor-app/configuration/"
- + "toolbar-default-actions.js\"\n"
- + " token=\"$location.path('/processes');\"\n"
- + " value=\"window.close();\"/>\n" + " \n"
- + " <copy file=\"${basedir}/src/main/resources/app-cfg.js\" \n"
- + " todir=\"${flowable-modeler.directory}/scripts\"\n"
- + " overwrite=\"true\"/>\n"
- + " <copy file=\"${basedir}/src/main/resources/url-config.js\" \n"
- + " todir=\"${flowable-modeler.directory}/editor-app/configuration\"\n"
- + " overwrite=\"true\"/>\n"
- + " <copy file=\"${basedir}/src/main/resources/toolbar.js\" \n"
- + " todir=\"${flowable-modeler.directory}/editor-app/configuration\"\n"
- + " overwrite=\"true\"/>\n"
- + " <copy file=\"${basedir}/src/main/resources/save-model.html\" \n"
- + " todir=\"${flowable-modeler.directory}/editor-app/popups\"\n"
- + " overwrite=\"true\"/>"
- + " </target>\n"
- + " </configuration>\n"
- + " <goals>\n"
- + " <goal>run</goal>\n"
- + " </goals>\n"
- + " </execution>\n"
- + " </executions>\n"
- + " </plugin>\n"
- + " </plugins>";
+ public static final String FLOWABLE_CONTENT_TO_ADD = " <dependency>\n"
+ + " <groupId>org.apache.syncope.ext.flowable</groupId>\n"
+ + " <artifactId>syncope-ext-flowable-client-console</artifactId>\n"
+ + " <version>${project.version}</version>\n" + " </dependency>\n";
private ConsolePom() {
// private constructor for static utility class
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
index faeb5af..044da8a 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
@@ -32,9 +32,9 @@ public final class CorePom {
public static final String FLOWABLE_PLACEHOLDER = "</dependencies>";
public static final String FLOWABLE_CONTENT_TO_ADD = " <dependency>\n"
- + " <groupId>org.apache.syncope.core</groupId>\n"
- + " <artifactId>syncope-core-workflow-flowable</artifactId>\n"
- + " </dependency>\n"
+ + " <groupId>org.apache.syncope.ext.flowable</groupId>\n"
+ + " <artifactId>syncope-ext-flowable-rest-cxf</artifactId>\n"
+ + " </dependency>\n"
+ " </dependencies>\n";
private CorePom() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
index a530867..e1c43b4 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
@@ -41,18 +41,17 @@ public class ArchetypeProcess extends BaseProcess {
final String confDirectory = args[6];
final String logsDirectory = args[7];
final String bundlesDirectory = args[8];
- final String modelerDirectory = args[9];
- final String syncopeVersion = args[10];
- final String syncopeAdminPassword = args[11];
- final boolean isProxyEnabled = Boolean.valueOf(args[12]);
- final String proxyHost = args[13];
- final String proxyPort = args[14];
- final String proxyUser = args[15];
- final String proxyPwd = args[16];
- final boolean mavenProxyAutoconf = Boolean.valueOf(args[17]);
- final boolean swagger = Boolean.valueOf(args[18]);
- final boolean flowable = Boolean.valueOf(args[19]);
- final String jwsKey = args[20];
+ final String syncopeVersion = args[9];
+ final String syncopeAdminPassword = args[10];
+ final boolean isProxyEnabled = Boolean.valueOf(args[11]);
+ final String proxyHost = args[12];
+ final String proxyPort = args[13];
+ final String proxyUser = args[14];
+ final String proxyPwd = args[15];
+ final boolean mavenProxyAutoconf = Boolean.valueOf(args[16]);
+ final boolean swagger = Boolean.valueOf(args[17]);
+ final boolean flowable = Boolean.valueOf(args[18]);
+ final String jwsKey = args[19];
setSyncopeInstallDir(installPath, artifactId);
@@ -103,7 +102,6 @@ public class ArchetypeProcess extends BaseProcess {
fileSystemUtils.createDirectory(confDirectory);
fileSystemUtils.createDirectory(logsDirectory);
fileSystemUtils.createDirectory(bundlesDirectory);
- fileSystemUtils.createDirectory(modelerDirectory);
if (flowable) {
File pomFile = new File(
@@ -129,15 +127,13 @@ public class ArchetypeProcess extends BaseProcess {
contentPomFile = fileSystemUtils.readFile(pomFile);
fileSystemUtils.writeToFile(
pomFile,
- contentPomFile.replace(ConsolePom.FLOWABLE_PLACEHOLDER, ConsolePom.FLOWABLE_CONTENT_TO_ADD).
- replace(ConsolePom.MODELER_PLACEHOLDER, ConsolePom.MODELER_CONTENT_TO_ADD));
+ contentPomFile.replace(ConsolePom.FLOWABLE_PLACEHOLDER, ConsolePom.FLOWABLE_CONTENT_TO_ADD));
}
final Properties syncopeProperties = new Properties();
syncopeProperties.setProperty("conf.directory", confDirectory);
syncopeProperties.setProperty("log.directory", logsDirectory);
syncopeProperties.setProperty("bundles.directory", bundlesDirectory);
- syncopeProperties.setProperty("flowable-modeler.directory", modelerDirectory);
mavenUtils.mvnCleanPackageWithProperties(
installPath + File.separator + artifactId, syncopeProperties, customMavenProxySettings);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
index 0429c30..6f5c79a 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
@@ -73,8 +73,6 @@ public final class ContainerProcess extends BaseProcess {
private String bundlesDirectory;
- private String modelerDirectory;
-
private boolean withDataSource;
private boolean jbossSsl;
@@ -83,8 +81,6 @@ public final class ContainerProcess extends BaseProcess {
private String jbossPort;
- private String jbossJdbcModuleName;
-
private String jbossAdminUsername;
private String jbossAdminPassword;
@@ -121,21 +117,19 @@ public final class ContainerProcess extends BaseProcess {
confDirectory = args[13];
logsDirectory = args[14];
bundlesDirectory = args[15];
- modelerDirectory = args[16];
- withDataSource = Boolean.valueOf(args[17]);
- jbossSsl = Boolean.valueOf(args[18]);
- jbossHost = args[19];
- jbossPort = args[20];
- jbossJdbcModuleName = args[21];
- jbossAdminUsername = args[22];
- jbossAdminPassword = args[23];
- jbossManagementPort = args[24];
- isProxyEnabled = Boolean.valueOf(args[25]);
- proxyHost = args[26];
- proxyPort = args[27];
- proxyUser = args[28];
- proxyPwd = args[29];
- mavenProxyAutoconf = Boolean.valueOf(args[30]);
+ withDataSource = Boolean.valueOf(args[16]);
+ jbossSsl = Boolean.valueOf(args[17]);
+ jbossHost = args[18];
+ jbossPort = args[19];
+ jbossAdminUsername = args[20];
+ jbossAdminPassword = args[21];
+ jbossManagementPort = args[22];
+ isProxyEnabled = Boolean.valueOf(args[23]);
+ proxyHost = args[24];
+ proxyPort = args[25];
+ proxyUser = args[26];
+ proxyPwd = args[27];
+ mavenProxyAutoconf = Boolean.valueOf(args[28]);
handler.logOutput("Configure web.xml file according to " + selectedContainer + " properties", true);
InstallLog.getInstance().info("Configure web.xml file according to " + selectedContainer + " properties");
@@ -211,7 +205,6 @@ public final class ContainerProcess extends BaseProcess {
mvnProperties.setProperty("conf.directory", confDirectory);
mvnProperties.setProperty("log.directory", logsDirectory);
mvnProperties.setProperty("bundles.directory", bundlesDirectory);
- mvnProperties.setProperty("flowable-modeler.directory", modelerDirectory);
mavenUtils.mvnCleanPackageWithProperties(
installPath + File.separator + artifactId, mvnProperties, customMavenProxySettings);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
index 2bbde9b..07de880 100644
--- a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
+++ b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
@@ -35,18 +35,17 @@ under the License.
<arg>$mvn.conf.directory</arg><!-- 6 -->
<arg>$mvn.log.directory</arg><!-- 7 -->
<arg>$mvn.bundle.directory</arg><!-- 8 -->
- <arg>$mvn.modeler.directory</arg><!-- 9 -->
- <arg>$mvn.syncope.version</arg><!-- 10 -->
- <arg>$mvn.syncope.admin.password</arg><!-- 11 -->
- <arg>$mvn.proxy</arg><!-- 12 -->
- <arg>$mvn.proxy.host</arg><!-- 13 -->
- <arg>$mvn.proxy.port</arg><!-- 14 -->
- <arg>$mvn.proxy.user</arg><!-- 15 -->
- <arg>$mvn.proxy.pwd</arg><!-- 16 -->
- <arg>$mvn.proxy.autoconf</arg><!-- 17 -->
- <arg>$options.swagger</arg><!-- 18 -->
- <arg>$options.flowable.workflow.adapter</arg><!-- 19 -->
- <arg>$mvn.jws.key</arg><!-- 20 -->
+ <arg>$mvn.syncope.version</arg><!-- 9 -->
+ <arg>$mvn.syncope.admin.password</arg><!-- 10 -->
+ <arg>$mvn.proxy</arg><!-- 11 -->
+ <arg>$mvn.proxy.host</arg><!-- 12 -->
+ <arg>$mvn.proxy.port</arg><!-- 13 -->
+ <arg>$mvn.proxy.user</arg><!-- 14 -->
+ <arg>$mvn.proxy.pwd</arg><!-- 15 -->
+ <arg>$mvn.proxy.autoconf</arg><!-- 16 -->
+ <arg>$options.swagger</arg><!-- 17 -->
+ <arg>$options.flowable.workflow.adapter</arg><!-- 18 -->
+ <arg>$mvn.jws.key</arg><!-- 19 -->
</executeclass>
</job>
<job name="Persistence configuration...">
@@ -79,21 +78,19 @@ under the License.
<arg>$mvn.conf.directory</arg><!-- 13 -->
<arg>$mvn.log.directory</arg><!-- 14 -->
<arg>$mvn.bundle.directory</arg><!-- 15 -->
- <arg>$mvn.modeler.directory</arg><!-- 16 -->
- <arg>$with.datasuorce</arg><!-- 17 -->
- <arg>$jboss.container.ssl</arg><!-- 18 -->
- <arg>$jboss.container.host</arg><!-- 19 -->
- <arg>$jboss.container.port</arg><!-- 20 -->
- <arg>$jboss.container.jdbc.module</arg><!-- 21 -->
- <arg>$jboss.container.user</arg><!-- 22 -->
- <arg>$jboss.container.pwd</arg><!-- 23 -->
- <arg>$jboss.container.management.port</arg><!-- 24 -->
- <arg>$mvn.proxy</arg><!-- 25 -->
- <arg>$mvn.proxy.host</arg><!-- 26 -->
- <arg>$mvn.proxy.port</arg><!-- 27 -->
- <arg>$mvn.proxy.user</arg><!-- 28 -->
- <arg>$mvn.proxy.pwd</arg><!-- 29 -->
- <arg>$mvn.proxy.autoconf</arg><!-- 30 -->
+ <arg>$with.datasuorce</arg><!-- 16 -->
+ <arg>$jboss.container.ssl</arg><!-- 17 -->
+ <arg>$jboss.container.host</arg><!-- 18 -->
+ <arg>$jboss.container.port</arg><!-- 19 -->
+ <arg>$jboss.container.user</arg><!-- 20 -->
+ <arg>$jboss.container.pwd</arg><!-- 21 -->
+ <arg>$jboss.container.management.port</arg><!-- 22 -->
+ <arg>$mvn.proxy</arg><!-- 23 -->
+ <arg>$mvn.proxy.host</arg><!-- 24 -->
+ <arg>$mvn.proxy.port</arg><!-- 25 -->
+ <arg>$mvn.proxy.user</arg><!-- 26 -->
+ <arg>$mvn.proxy.pwd</arg><!-- 27 -->
+ <arg>$mvn.proxy.autoconf</arg><!-- 28 -->
</executeclass>
</job>
<onFail previous="true" next="false" />
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/resources/izpack/userInputLang.xml_eng
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_eng b/installer/src/main/resources/izpack/userInputLang.xml_eng
index 2bf1e2c..8d7ca08 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_eng
+++ b/installer/src/main/resources/izpack/userInputLang.xml_eng
@@ -32,7 +32,6 @@ under the License.
<str id="archetype.mvn.conf.directory" txt="Conf directory name:"/>
<str id="archetype.mvn.log.directory" txt="Log directory name:"/>
<str id="archetype.mvn.bundle.directory" txt="Bundle directory name:"/>
- <str id="archetype.mvn.modeler.directory" txt="Flowable modeler directory name:"/>
<str id="mvn.syncope.version.id" txt="Syncope Version:"/>
<str id="mvn.syncope.admin.password.id" txt="Admin Password:"/>
<str id="mvn.proxy.id" txt="Use Proxy Server:"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/resources/izpack/userInputLang.xml_ita
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_ita b/installer/src/main/resources/izpack/userInputLang.xml_ita
index 1cbad84..fd9f26f 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_ita
+++ b/installer/src/main/resources/izpack/userInputLang.xml_ita
@@ -32,7 +32,6 @@ under the License.
<str id="archetype.mvn.conf.directory" txt="Conf directory name:"/>
<str id="archetype.mvn.log.directory" txt="Log directory name:"/>
<str id="archetype.mvn.bundle.directory" txt="Bundle directory name:"/>
- <str id="archetype.mvn.modeler.directory" txt="Flowable modeler directory name:"/>
<str id="mvn.syncope.version.id" txt="Syncope Version:"/>
<str id="mvn.syncope.admin.password.id" txt="Admin Password:"/>
<str id="mvn.proxy.id" txt="Usa un Server Proxy:"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/installer/src/main/resources/izpack/userInputSpec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputSpec.xml b/installer/src/main/resources/izpack/userInputSpec.xml
index b55cb5b..18844fc 100644
--- a/installer/src/main/resources/izpack/userInputSpec.xml
+++ b/installer/src/main/resources/izpack/userInputSpec.xml
@@ -122,9 +122,6 @@ under the License.
<spec id="options.flowable.workflow.adapter.id" true="true" false="false" set="true"/>
</field>
<field type="space"/>
- <field type="dir" variable="mvn.modeler.directory" conditionid="options.choice.flowable">
- <spec id="archetype.mvn.modeler.directory" size="20" set="/var/tmp/syncope/modeler" mustExist="false" create="true"/>
- </field>
</panel>
<panel id="persistence">
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 918ff87..e640a15 100644
--- a/pom.xml
+++ b/pom.xml
@@ -439,7 +439,6 @@ under the License.
<bundles.directory>${project.build.directory}/bundles</bundles.directory>
<connid.location>file:${bundles.directory}/</connid.location>
<log.directory>${project.build.directory}/log</log.directory>
- <flowable-modeler.directory>${project.build.directory}/flowable-modeler</flowable-modeler.directory>
<swagger-core.version>2.0.5</swagger-core.version>
<swagger-ui.version>3.18.2</swagger-ui.version>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 6755afe..15f6a77 100644
--- a/src/main/asciidoc/reference-guide/concepts/workflow.adoc
+++ b/src/main/asciidoc/reference-guide/concepts/workflow.adoc
@@ -196,58 +196,3 @@ 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
-retention 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 were 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"
- flowable:formKey="recertify"
- flowable:candidateGroups="managingDirector">
-----
-====
-
-.Certifier is the manager defined in the user's `lastRecertificator` attribute
-====
-[source,xml]
-----
-<userTask id="recertificationRequest" name="Recertification Request"
- flowable:formKey="recertify"
- flowable:candidateUser="${user.lastRecertificator}">
-----
-====
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
index bd78a72..504590c 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
@@ -278,14 +278,25 @@ Add the following dependency to `core/pom.xml`:
[source,xml,subs="verbatim,attributes"]
----
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${syncope.version}</version>
</dependency>
----
Copy `core/src/main/resources/all/workflow.properties` to `core/src/main/resources/workflow.properties`.
+Add the following dependency to `console/pom.xml`:
+
+[source,xml,subs="verbatim,attributes"]
+----
+<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${syncope.version}</version>
+</dependency>
+----
+
[discrete]
===== Enable the <<apache-camel-provisioning-manager>>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 6a8a468..7ba4a4d 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
@@ -50,8 +50,6 @@ mechanism to work properly;
Suspended Users are anyway not allowed to authenticate.
* `log.lastlogindate` - whether the system updates the `lastLoginDate` field of users upon authentication;
* `return.password.value` - whether the hashed password value shall be returned when reading users;
-* `identity.recertification.day.interval` - number of days between
-<<identity-recertification,identity recertifications>>;
* `connector.conf.history.size` - how many previous configurations shall be kept for each Connector Instance,
for usage with <<connectors-resources-history, connectors and resources configuration history management>>;
* `resource.conf.history.size` - how many previous configurations shall be kept for each External Resource,
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc
deleted file mode 100644
index 6cf0e68..0000000
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc
+++ /dev/null
@@ -1,46 +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.
-//
-==== Enable the Flowable Modeler
-
-Due to licensing issues - see
-https://issues.apache.org/jira/browse/SYNCOPE-439?focusedCommentId=13829896&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13829896[this comment^]
-for more information - it is not possible to embed the
-http://www.flowable.org/docs/userguide/index.html#flowableModelerApp[Flowable Modeler^], which provides a powerful
-graphical web editing interface for Flowable, into any Apache Syncope artifact; thus, some manual steps are required to enable it on a
-working Apache Syncope deployment, for use with the Admin Console.
-
-[WARNING]
-This procedure requires Apache Maven since it is using a fake project to perform all of the required setup tasks.
-
-First of all, generate a new Maven project as described in the
-ifeval::["{backend}" == "html5"]
-http://syncope.apache.org/docs/getting-started.html[Apache Syncope Getting Started Guide,]
-endif::[]
-ifeval::["{backend}" == "pdf"]
-http://syncope.apache.org/docs/getting-started.pdf[Apache Syncope Getting Started Guide,]
-endif::[]
-then build via
-
-....
-$ mvn -P all clean install
-....
-
-At this point, copy the `console/target/flowable-modeler/` directory in the desired location of the host where the
-admin console is deployed, then set the value of `flowableModelerDirectory` with this path in the `console.properties`
-file.
[16/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
deleted file mode 100644
index 24f0e59..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
+++ /dev/null
@@ -1,358 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.commons.DirectoryDataProvider;
-import org.apache.syncope.client.console.panels.DirectoryPanel;
-import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
-import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel.ApprovalProvider;
-import org.apache.syncope.client.console.layout.FormLayoutInfoUtils;
-import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.rest.AnyTypeRestClient;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
-import org.apache.syncope.client.console.wizards.AjaxWizard;
-import org.apache.syncope.client.console.wizards.any.AnyWrapper;
-import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
-import org.apache.syncope.common.lib.AnyOperations;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.ProvisioningResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.event.Broadcast;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-
-public class ApprovalDirectoryPanel
- extends DirectoryPanel<WorkflowFormTO, WorkflowFormTO, ApprovalProvider, UserWorkflowRestClient> {
-
- private static final long serialVersionUID = -7122136682275797903L;
-
- protected final BaseModal<WorkflowFormTO> manageApprovalModal = new BaseModal<WorkflowFormTO>("outer") {
-
- private static final long serialVersionUID = 389935548143327858L;
-
- @Override
- protected void onConfigure() {
- super.onConfigure();
- addSubmitButton();
- size(Modal.Size.Large);
- }
-
- };
-
- public ApprovalDirectoryPanel(final String id, final PageReference pageReference) {
- super(id, pageReference, true);
- disableCheckBoxes();
- setFooterVisibility(false);
- modal.size(Modal.Size.Large);
-
- addOuterObject(manageApprovalModal);
-
- manageApprovalModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
- private static final long serialVersionUID = 8804221891699487139L;
-
- @Override
- public void onClose(final AjaxRequestTarget target) {
- updateResultTable(target);
- ((BasePage) pageReference.getPage()).getApprovalsWidget().refreshLatestAlerts(target);
- manageApprovalModal.show(false);
- }
- });
-
- restClient = new UserWorkflowRestClient();
-
- initResultTable();
-
- MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.WORKFLOW_FORM_SUBMIT);
- }
-
- @Override
- protected List<IColumn<WorkflowFormTO, String>> getColumns() {
- List<IColumn<WorkflowFormTO, String>> columns = new ArrayList<>();
-
- columns.add(new PropertyColumn<>(
- new ResourceModel("taskId"), "taskId", "taskId"));
- columns.add(new PropertyColumn<>(
- new ResourceModel("key"), "key"));
- columns.add(new PropertyColumn<>(
- new ResourceModel("username"), "username"));
- columns.add(new DatePropertyColumn<>(
- new ResourceModel("createTime"), "createTime", "createTime"));
- columns.add(new DatePropertyColumn<>(
- new ResourceModel("dueDate"), "dueDate", "dueDate"));
- columns.add(new PropertyColumn<>(
- new ResourceModel("owner"), "owner", "owner"));
-
- return columns;
- }
-
- @Override
- public ActionsPanel<WorkflowFormTO> getActions(final IModel<WorkflowFormTO> model) {
- final ActionsPanel<WorkflowFormTO> panel = super.getActions(model);
-
- panel.add(new ActionLink<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -3722207913631435501L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowFormTO ignore) {
- claimForm(model.getObject().getTaskId());
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- target.add(container);
- }
- }, ActionLink.ActionType.CLAIM, StandardEntitlement.WORKFLOW_FORM_CLAIM);
-
- panel.add(new ActionLink<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -3722207913631435501L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowFormTO ignore) {
- manageApprovalModal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
-
- target.add(manageApprovalModal.setContent(
- new ApprovalModal(manageApprovalModal, pageRef, model.getObject()) {
-
- private static final long serialVersionUID = 5546519445061007248L;
-
- @Override
- public void onSubmit(final AjaxRequestTarget target) {
- try {
- super.onSubmit(target);
-
- ApprovalDirectoryPanel.this.getTogglePanel().close(target);
- } catch (SyncopeClientException e) {
- SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-
- }));
-
- manageApprovalModal.header(new Model<>(getString("approval.manage", new Model<>(model.getObject()))));
- manageApprovalModal.show(true);
- }
-
- @Override
- protected boolean statusCondition(final WorkflowFormTO modelObject) {
- return SyncopeConsoleSession.get().getSelfTO().getUsername().
- equals(model.getObject().getOwner());
- }
-
- }, ActionLink.ActionType.MANAGE_APPROVAL, StandardEntitlement.WORKFLOW_FORM_READ);
-
- // SYNCOPE-1200 edit user while in approval state
- panel.add(new ActionLink<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -3722207913631435501L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowFormTO ignore) {
- modal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
-
- WorkflowFormTO formTO = model.getObject();
- UserTO newUserTO;
- UserTO previousUserTO;
- if (formTO.getUserPatch() == null) {
- newUserTO = formTO.getUserTO();
- previousUserTO = null;
- } else if (formTO.getUserTO() == null) {
- // make it stronger by handling possible NPE
- previousUserTO = new UserTO();
- previousUserTO.setKey(formTO.getUserPatch().getKey());
- newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
- } else {
- previousUserTO = formTO.getUserTO();
- formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
- formTO.getUserTO().setPassword(null);
- newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
- }
-
- AjaxWizard.EditItemActionEvent<UserTO> editItemActionEvent =
- new AjaxWizard.EditItemActionEvent<>(newUserTO, target);
- editItemActionEvent.forceModalPanel(new ApprovalUserWizardBuilder(
- model.getObject(),
- previousUserTO,
- newUserTO,
- new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
- FormLayoutInfoUtils.fetch(Collections.singletonList(AnyTypeKind.USER.name())).getLeft(),
- pageRef
- ).build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT));
-
- send(ApprovalDirectoryPanel.this, Broadcast.EXACT, editItemActionEvent);
- }
-
- @Override
- protected boolean statusCondition(final WorkflowFormTO modelObject) {
- return SyncopeConsoleSession.get().getSelfTO().getUsername().
- equals(model.getObject().getOwner());
- }
-
- }, ActionLink.ActionType.EDIT_APPROVAL, StandardEntitlement.WORKFLOW_FORM_SUBMIT);
-
- return panel;
- }
-
- @Override
- protected ApprovalProvider dataProvider() {
- return new ApprovalProvider(rows);
- }
-
- @Override
- protected String paginatorRowsKey() {
- return Constants.PREF_WORKFLOW_FORM_PAGINATOR_ROWS;
- }
-
- public static class ApprovalProvider extends DirectoryDataProvider<WorkflowFormTO> {
-
- private static final long serialVersionUID = -2311716167583335852L;
-
- private final UserWorkflowRestClient restClient = new UserWorkflowRestClient();
-
- public ApprovalProvider(final int paginatorRows) {
- super(paginatorRows);
-
- setSort("createTime", SortOrder.ASCENDING);
- }
-
- @Override
- public Iterator<WorkflowFormTO> iterator(final long first, final long count) {
- int page = ((int) first / paginatorRows);
- return restClient.getForms((page < 0 ? 0 : page) + 1, paginatorRows, getSort()).iterator();
- }
-
- @Override
- public long size() {
- return restClient.countForms();
- }
-
- @Override
- public IModel<WorkflowFormTO> model(final WorkflowFormTO form) {
- return new IModel<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -2566070996511906708L;
-
- @Override
- public WorkflowFormTO getObject() {
- return form;
- }
- };
- }
- }
-
- @Override
- protected Collection<ActionLink.ActionType> getBatches() {
- return Collections.<ActionLink.ActionType>emptyList();
- }
-
- private void claimForm(final String taskId) {
- try {
- restClient.claimForm(taskId);
- } catch (SyncopeClientException scee) {
- SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + scee.getMessage());
- }
- }
-
- private class ApprovalUserWizardBuilder extends UserWizardBuilder {
-
- private static final long serialVersionUID = 1854981134836384069L;
-
- private final WorkflowFormTO formTO;
-
- ApprovalUserWizardBuilder(
- final WorkflowFormTO formTO,
- final UserTO previousUserTO,
- final UserTO userTO,
- final List<String> anyTypeClasses,
- final UserFormLayoutInfo formLayoutInfo,
- final PageReference pageRef) {
-
- super(previousUserTO, userTO, anyTypeClasses, formLayoutInfo, pageRef);
- this.formTO = formTO;
- }
-
- @Override
- protected Serializable onApplyInternal(final AnyWrapper<UserTO> modelObject) {
- UserTO inner = modelObject.getInnerObject();
-
- ProvisioningResult<UserTO> result;
-
- if (formTO.getUserPatch() == null) {
- result = new ProvisioningResult<>();
- UserTO user = new UserWorkflowRestClient().executeTask("default", inner);
- result.setEntity(user);
- claimForm(restClient.getFormForUser(result.getEntity().getKey()).getTaskId());
- } else {
- UserPatch patch = AnyOperations.diff(inner, formTO.getUserTO(), false);
-
- if (StringUtils.isNotBlank(inner.getPassword())) {
- PasswordPatch passwordPatch = new PasswordPatch.Builder().
- value(inner.getPassword()).onSyncope(true).resources(inner.
- getResources()).
- build();
- patch.setPassword(passwordPatch);
- }
- // update just if it is changed
- if (patch.isEmpty()) {
- result = new ProvisioningResult<>();
- result.setEntity(inner);
- } else {
- result = userRestClient.update(getOriginalItem().getInnerObject().getETagValue(), patch);
- WorkflowFormTO workFlowTO = restClient.getFormForUser(result.getEntity().getKey());
- if (workFlowTO != null) {
- claimForm(workFlowTO.getTaskId());
- }
- }
-
- }
-
- return result;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
deleted file mode 100644
index 1b1ce48..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
+++ /dev/null
@@ -1,82 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.panels.MultilevelPanel;
-import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.syncope.client.console.panels.SubmitableModalPanel;
-import org.apache.syncope.client.console.panels.WizardModalPanel;
-
-public class ApprovalModal extends Panel implements SubmitableModalPanel, WizardModalPanel<WorkflowFormTO> {
-
- private static final long serialVersionUID = -8847854414429745216L;
-
- private final UserWorkflowRestClient restClient = new UserWorkflowRestClient();
-
- private final BaseModal<?> modal;
-
- private final WorkflowFormTO formTO;
-
- private final PageReference pageRef;
-
- public ApprovalModal(final BaseModal<?> modal, final PageReference pageRef, final WorkflowFormTO formTO) {
- super(BaseModal.CONTENT_ID);
- this.modal = modal;
- this.formTO = formTO;
- this.pageRef = pageRef;
-
- MultilevelPanel mlp = new MultilevelPanel("approval");
- mlp.setFirstLevel(new Approval(pageRef, formTO) {
-
- private static final long serialVersionUID = -2195387360323687302L;
-
- @Override
- protected void viewDetails(final AjaxRequestTarget target) {
- mlp.next(getString("approval.details"), new ApprovalDetails(pageRef, formTO), target);
- }
- });
- add(mlp);
- }
-
- @Override
- public void onSubmit(final AjaxRequestTarget target) {
- this.restClient.submitForm(formTO);
- this.modal.show(false);
- this.modal.close(target);
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- }
-
- @Override
- public void onError(final AjaxRequestTarget target) {
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-
- @Override
- public WorkflowFormTO getItem() {
- return this.formTO;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
index 2bfd9ed..48b58137 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
@@ -37,8 +37,6 @@ public final class Constants {
public static final String VEIL_INDICATOR_MARKUP_ID = "veil";
- public static final String FLOWABLE_MODELER_CONTEXT = "flowable-modeler";
-
public static final String MODELER_CONTEXT = "modelerContext";
public static final String MODEL_ID_PARAM = "modelId";
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
index 876d299..edb7b61 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
@@ -34,10 +34,12 @@ import org.apache.syncope.client.console.pages.BaseExtPage;
import org.apache.syncope.client.console.annotations.BinaryPreview;
import org.apache.syncope.client.console.annotations.ExtPage;
import org.apache.syncope.client.console.annotations.ExtWidget;
+import org.apache.syncope.client.console.annotations.Resource;
import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.panels.SSOLoginFormPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
import org.apache.syncope.client.console.widgets.BaseExtWidget;
+import org.apache.syncope.client.console.widgets.ExtAlertWidget;
import org.apache.syncope.common.lib.policy.AccountRuleConf;
import org.apache.syncope.common.lib.policy.PasswordRuleConf;
import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
@@ -46,6 +48,7 @@ import org.apache.syncope.common.lib.report.ReportletConf;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.request.resource.AbstractResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
@@ -93,6 +96,8 @@ public class ClassPathScanImplementationLookup {
private List<Class<? extends BaseExtWidget>> extWidgets;
+ private List<Class<? extends ExtAlertWidget<?>>> extAlertWidgets;
+
private List<Class<? extends SSOLoginFormPanel>> ssoLoginFormPanels;
private Map<String, Class<? extends ReportletConf>> reportletConfs;
@@ -105,6 +110,8 @@ public class ClassPathScanImplementationLookup {
private Map<String, Class<? extends PushCorrelationRuleConf>> pushCorrelationRuleConfs;
+ private List<Class<? extends AbstractResource>> resources;
+
/**
* This method can be overridden by subclasses to customize classpath scan.
*
@@ -120,24 +127,28 @@ public class ClassPathScanImplementationLookup {
previewers = new ArrayList<>();
extPages = new ArrayList<>();
extWidgets = new ArrayList<>();
+ extAlertWidgets = new ArrayList<>();
ssoLoginFormPanels = new ArrayList<>();
reportletConfs = new HashMap<>();
accountRuleConfs = new HashMap<>();
passwordRuleConfs = new HashMap<>();
pullCorrelationRuleConfs = new HashMap<>();
pushCorrelationRuleConfs = new HashMap<>();
+ resources = new ArrayList<>();
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.addIncludeFilter(new AssignableTypeFilter(BasePage.class));
scanner.addIncludeFilter(new AssignableTypeFilter(AbstractBinaryPreviewer.class));
scanner.addIncludeFilter(new AssignableTypeFilter(BaseExtPage.class));
scanner.addIncludeFilter(new AssignableTypeFilter(BaseExtWidget.class));
+ scanner.addIncludeFilter(new AssignableTypeFilter(ExtAlertWidget.class));
scanner.addIncludeFilter(new AssignableTypeFilter(SSOLoginFormPanel.class));
scanner.addIncludeFilter(new AssignableTypeFilter(ReportletConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(AccountRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PasswordRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PullCorrelationRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PushCorrelationRuleConf.class));
+ scanner.addIncludeFilter(new AssignableTypeFilter(AbstractResource.class));
scanner.findCandidateComponents(getBasePackage()).forEach(bd -> {
try {
@@ -160,6 +171,13 @@ public class ClassPathScanImplementationLookup {
LOG.error("Could not find annotation {} in {}, ignoring",
ExtWidget.class.getName(), clazz.getName());
}
+ } else if (ExtAlertWidget.class.isAssignableFrom(clazz)) {
+ if (clazz.isAnnotationPresent(ExtWidget.class)) {
+ extAlertWidgets.add((Class<? extends ExtAlertWidget<?>>) clazz);
+ } else {
+ LOG.error("Could not find annotation {} in {}, ignoring",
+ ExtWidget.class.getName(), clazz.getName());
+ }
} else if (BasePage.class.isAssignableFrom(clazz)) {
pages.add((Class<? extends BasePage>) clazz);
} else if (AbstractBinaryPreviewer.class.isAssignableFrom(clazz)) {
@@ -176,6 +194,13 @@ public class ClassPathScanImplementationLookup {
pullCorrelationRuleConfs.put(clazz.getName(), (Class<? extends PullCorrelationRuleConf>) clazz);
} else if (PushCorrelationRuleConf.class.isAssignableFrom(clazz)) {
pushCorrelationRuleConfs.put(clazz.getName(), (Class<? extends PushCorrelationRuleConf>) clazz);
+ } else if (AbstractResource.class.isAssignableFrom(clazz)) {
+ if (clazz.isAnnotationPresent(Resource.class)) {
+ resources.add((Class<? extends AbstractResource>) clazz);
+ } else {
+ LOG.error("Could not find annotation {} in {}, ignoring",
+ Resource.class.getName(), clazz.getName());
+ }
}
}
} catch (Throwable t) {
@@ -185,18 +210,21 @@ public class ClassPathScanImplementationLookup {
pages = Collections.unmodifiableList(pages);
previewers = Collections.unmodifiableList(previewers);
- Collections.sort(extPages, (o1, o2)
- -> ObjectUtils.compare(
- o1.getAnnotation(ExtPage.class).priority(),
- o2.getAnnotation(ExtPage.class).priority()));
+ extPages.sort((o1, o2) -> ObjectUtils.compare(
+ o1.getAnnotation(ExtPage.class).priority(),
+ o2.getAnnotation(ExtPage.class).priority()));
extPages = Collections.unmodifiableList(extPages);
- Collections.sort(extWidgets, (o1, o2)
- -> ObjectUtils.compare(
- o1.getAnnotation(ExtWidget.class).priority(),
- o2.getAnnotation(ExtWidget.class).priority()));
+ extWidgets.sort((o1, o2) -> ObjectUtils.compare(
+ o1.getAnnotation(ExtWidget.class).priority(),
+ o2.getAnnotation(ExtWidget.class).priority()));
extWidgets = Collections.unmodifiableList(extWidgets);
+ extAlertWidgets.sort((o1, o2) -> ObjectUtils.compare(
+ o1.getAnnotation(ExtWidget.class).priority(),
+ o2.getAnnotation(ExtWidget.class).priority()));
+ extAlertWidgets = Collections.unmodifiableList(extAlertWidgets);
+
ssoLoginFormPanels = Collections.unmodifiableList(ssoLoginFormPanels);
reportletConfs = Collections.unmodifiableMap(reportletConfs);
@@ -205,15 +233,19 @@ public class ClassPathScanImplementationLookup {
pullCorrelationRuleConfs = Collections.unmodifiableMap(pullCorrelationRuleConfs);
pushCorrelationRuleConfs = Collections.unmodifiableMap(pushCorrelationRuleConfs);
+ resources = Collections.unmodifiableList(resources);
+
LOG.debug("Binary previewers found: {}", previewers);
LOG.debug("Extension pages found: {}", extPages);
LOG.debug("Extension widgets found: {}", extWidgets);
+ LOG.debug("Extension alert widgets found: {}", extAlertWidgets);
LOG.debug("SSO Login pages found: {}", ssoLoginFormPanels);
LOG.debug("Reportlet configurations found: {}", reportletConfs);
LOG.debug("Account Rule configurations found: {}", accountRuleConfs);
LOG.debug("Password Rule configurations found: {}", passwordRuleConfs);
LOG.debug("Pull Correlation Rule configurations found: {}", pullCorrelationRuleConfs);
LOG.debug("Push Correlation Rule configurations found: {}", pushCorrelationRuleConfs);
+ LOG.debug("Resources found: {}", resources);
}
public Class<? extends AbstractBinaryPreviewer> getPreviewerClass(final String mimeType) {
@@ -242,6 +274,10 @@ public class ClassPathScanImplementationLookup {
return extWidgets;
}
+ public List<Class<? extends ExtAlertWidget<?>>> getExtAlertWidgetClasses() {
+ return extAlertWidgets;
+ }
+
public List<Class<? extends SSOLoginFormPanel>> getSSOLoginFormPanels() {
return ssoLoginFormPanels;
}
@@ -265,4 +301,8 @@ public class ClassPathScanImplementationLookup {
public Map<String, Class<? extends PushCorrelationRuleConf>> getPushCorrelationRuleConfs() {
return pushCorrelationRuleConfs;
}
+
+ public List<Class<? extends AbstractResource>> getResources() {
+ return resources;
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
deleted file mode 100644
index 0dbc4db..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.syncope.client.console.pages;
-
-import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
-import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-
-public class Approvals extends BasePage {
-
- private static final long serialVersionUID = -1100228004207271271L;
-
- public Approvals(final PageParameters parameters) {
- super(parameters);
-
- body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
-
- WebMarkupContainer content = new WebMarkupContainer("content");
- content.setOutputMarkupId(true);
- body.add(content);
-
- content.add(new ApprovalDirectoryPanel("wfPanel", getPageReference()));
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index d79cec7..a4ef3f0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -19,6 +19,7 @@
package org.apache.syncope.client.console.pages;
import java.io.Serializable;
+import java.lang.reflect.Constructor;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
@@ -34,7 +35,7 @@ import org.apache.syncope.client.console.rest.ConfRestClient;
import org.apache.syncope.client.console.topology.Topology;
import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.widgets.ApprovalsWidget;
+import org.apache.syncope.client.console.widgets.ExtAlertWidget;
import org.apache.syncope.client.console.widgets.RemediationsWidget;
import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.lib.info.SystemInfo;
@@ -42,6 +43,7 @@ import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.IAjaxIndicatorAware;
import org.apache.wicket.ajax.attributes.AjaxCallListener;
@@ -81,8 +83,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
protected NotificationPanel notificationPanel;
- protected ApprovalsWidget approvalsWidget;
-
protected RemediationsWidget remediationWidget;
public BasePage() {
@@ -108,9 +108,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
remediationWidget = new RemediationsWidget("remediationWidget", getPageReference());
body.add(remediationWidget.setRenderBodyOnly(true));
- approvalsWidget = new ApprovalsWidget("approvalsWidget", getPageReference());
- body.add(approvalsWidget.setRenderBodyOnly(true));
-
// right sidebar
PlatformInfo platformInfo = SyncopeConsoleSession.get().getPlatformInfo();
Label version = new Label("version", platformInfo.getVersion());
@@ -187,14 +184,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
WebMarkupContainer confULContainer = new WebMarkupContainer(getULContainerId("configuration"));
confLIContainer.add(confULContainer);
- liContainer = new WebMarkupContainer(getLIContainerId("workflow"));
- liContainer.setOutputMarkupPlaceholderTag(true);
- liContainer.setVisible(platformInfo.getUserWorkflowAdapter().contains("Flowable"));
- confULContainer.add(liContainer);
- link = BookmarkablePageLinkBuilder.build("workflow", Workflow.class);
- MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, StandardEntitlement.WORKFLOW_DEF_GET);
- liContainer.add(link);
-
liContainer = new WebMarkupContainer(getLIContainerId("audit"));
confULContainer.add(liContainer);
link = BookmarkablePageLinkBuilder.build("audit", Audit.class);
@@ -331,10 +320,33 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
}
// Extensions
- ClassPathScanImplementationLookup classPathScanImplementationLookup =
- (ClassPathScanImplementationLookup) SyncopeConsoleApplication.get().
- getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
- List<Class<? extends BaseExtPage>> extPageClasses = classPathScanImplementationLookup.getExtPageClasses();
+ ClassPathScanImplementationLookup lookup = (ClassPathScanImplementationLookup) SyncopeConsoleApplication.get().
+ getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
+
+ List<Class<? extends ExtAlertWidget<?>>> extAlertWidgetClasses = lookup.getExtAlertWidgetClasses();
+ ListView<Class<? extends ExtAlertWidget<?>>> extAlertWidgets = new ListView<Class<? extends ExtAlertWidget<?>>>(
+ "extAlertWidgets", extAlertWidgetClasses) {
+
+ private static final long serialVersionUID = -9112553137618363167L;
+
+ @Override
+ protected void populateItem(final ListItem<Class<? extends ExtAlertWidget<?>>> item) {
+ try {
+ Constructor<? extends ExtAlertWidget<?>> constructor =
+ item.getModelObject().getDeclaredConstructor(String.class, PageReference.class);
+ ExtAlertWidget<?> widget = constructor.newInstance("extAlertWidget", getPageReference());
+
+ SyncopeConsoleSession.get().setAttribute(widget.getClass().getName(), widget);
+
+ item.add(widget.setRenderBodyOnly(true));
+ } catch (Exception e) {
+ LOG.error("Could not instantiate {}", item.getModelObject().getName(), e);
+ }
+ }
+ };
+ body.add(extAlertWidgets);
+
+ List<Class<? extends BaseExtPage>> extPageClasses = lookup.getExtPageClasses();
WebMarkupContainer extensionsLI = new WebMarkupContainer(getLIContainerId("extensions"));
extensionsLI.setOutputMarkupPlaceholderTag(true);
@@ -431,10 +443,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
return remediationWidget;
}
- public ApprovalsWidget getApprovalsWidget() {
- return approvalsWidget;
- }
-
/**
* Set a WindowClosedCallback for a Modal instance.
*
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
deleted file mode 100644
index b55d2b5..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
+++ /dev/null
@@ -1,27 +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.
- */
-package org.apache.syncope.client.console.pages;
-
-import org.apache.wicket.markup.html.WebPage;
-
-public class FlowableModelerPopupPage extends WebPage {
-
- private static final long serialVersionUID = -7031206743629422898L;
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
deleted file mode 100644
index 5ab09c3..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
+++ /dev/null
@@ -1,64 +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.
- */
-package org.apache.syncope.client.console.pages;
-
-import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.panels.WorkflowDirectoryPanel;
-import org.apache.syncope.client.console.wizards.WizardMgtPanel;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-
-public class Workflow extends BasePage {
-
- private static final long serialVersionUID = -8781434495150074529L;
-
- public Workflow(final PageParameters parameters) {
- super(parameters);
-
- body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
-
- WebMarkupContainer content = new WebMarkupContainer("content");
- content.setOutputMarkupId(true);
- body.add(content);
-
- WebMarkupContainer disabled = new WebMarkupContainer("disabled");
- disabled.setOutputMarkupPlaceholderTag(true);
- content.add(disabled);
-
- WizardMgtPanel<WorkflowDefinitionTO> workflowsPanel = new WorkflowDirectoryPanel.Builder(getPageReference()) {
-
- private static final long serialVersionUID = -5960765294082359003L;
-
- }.disableCheckBoxes().build("workflowsPanel");
- workflowsPanel.setOutputMarkupPlaceholderTag(true);
- MetaDataRoleAuthorizationStrategy.authorize(workflowsPanel, ENABLE, StandardEntitlement.WORKFLOW_DEF_LIST);
-
- content.add(workflowsPanel);
-
- if (SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Flowable")) {
- disabled.setVisible(false);
- } else {
- workflowsPanel.setVisible(false);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
deleted file mode 100644
index f0971c6..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
+++ /dev/null
@@ -1,87 +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.
- */
-package org.apache.syncope.client.console.panels;
-
-import java.io.Serializable;
-import javax.ws.rs.core.MediaType;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.pdfbox.util.Charsets;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.Model;
-
-public class NewWorkflowProcess extends TogglePanel<Serializable> {
-
- private static final long serialVersionUID = -4886361549305302161L;
-
- private final WorkflowRestClient restClient = new WorkflowRestClient();
-
- private final Form<?> form;
-
- public NewWorkflowProcess(final String id, final WebMarkupContainer container, final PageReference pageRef) {
- super(id, pageRef);
-
- form = new Form<>("form");
- addInnerObject(form);
-
- final TextField<String> key = new TextField<>("key", new Model<>());
- key.setRequired(true);
- form.add(key);
-
- form.add(new AjaxSubmitLink("submit", form) {
-
- private static final long serialVersionUID = 4947613489823025052L;
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target) {
- try {
- restClient.setDefinition(MediaType.APPLICATION_XML_TYPE, key.getModelObject(),
- IOUtils.toString(
- getClass().getResourceAsStream("empty.bpmn20.xml"),
- Charsets.UTF_8.name()).replaceAll("%KEY%", key.getModelObject()));
-
- key.getModel().setObject(null);
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- toggle(target, false);
- target.add(container);
- } catch (Exception e) {
- LOG.error("While creating new workflow process", e);
- SyncopeConsoleSession.get().error(
- StringUtils.isBlank(e.getMessage())
- ? e.getClass().getName() : e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target) {
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
- });
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
index 9bce309..8cd3fb8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
@@ -166,7 +166,6 @@ public class ParametersDirectoryPanel
super.populateItem(item, componentId, rowModel);
}
}
-
});
return columns;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
index e9f8029..fb8047c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
@@ -42,8 +42,6 @@ import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.SecurityQuestionTO;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.PageReference;
@@ -202,12 +200,8 @@ public abstract class TogglePanel<T extends Serializable> extends WizardMgtPanel
key = ((AccessTokenTO) modelObject).getKey();
} else if (modelObject instanceof ExecTO) {
key = ((ExecTO) modelObject).getKey();
- } else if (modelObject instanceof WorkflowDefinitionTO) {
- key = ((WorkflowDefinitionTO) modelObject).getKey();
} else if (modelObject instanceof ProvisioningTaskTO) {
key = ((ProvisioningTaskTO) modelObject).getKey();
- } else if (modelObject instanceof WorkflowFormTO) {
- key = ((WorkflowFormTO) modelObject).getKey();
} else if (modelObject instanceof EntityTO) {
key = ((EntityTO) modelObject).getKey();
} else if (modelObject instanceof StatusBean) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
deleted file mode 100644
index a640367..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
+++ /dev/null
@@ -1,333 +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.
- */
-package org.apache.syncope.client.console.panels;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleApplication;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.commons.DirectoryDataProvider;
-import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.pages.ModelerPopupPage;
-import org.apache.syncope.client.console.panels.WorkflowDirectoryPanel.WorkflowDefinitionDataProvider;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.ImageModalPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.XMLEditorPanel;
-import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
-import org.apache.syncope.client.console.wizards.WizardMgtPanel;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.Page;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
-import org.apache.wicket.extensions.wizard.WizardModel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.util.io.IOUtils;
-
-public class WorkflowDirectoryPanel extends DirectoryPanel<
- WorkflowDefinitionTO, WorkflowDefinitionTO, WorkflowDefinitionDataProvider, WorkflowRestClient> {
-
- private static final long serialVersionUID = 2705668831139984998L;
-
- private final BaseModal<String> utility;
-
- private String modelerCtx;
-
- protected WorkflowDirectoryPanel(final String id, final Builder builder) {
- super(id, builder);
-
- this.addNewItemPanelBuilder(new AjaxWizardBuilder<WorkflowDefinitionTO>(new WorkflowDefinitionTO(), pageRef) {
-
- private static final long serialVersionUID = 1633859795677053912L;
-
- @Override
- protected WizardModel buildModelSteps(
- final WorkflowDefinitionTO modelObject, final WizardModel wizardModel) {
-
- return wizardModel;
- }
- }, false);
- final NewWorkflowProcess newWorkflowProcess = new NewWorkflowProcess("newWorkflowProcess", container, pageRef);
- addInnerObject(newWorkflowProcess);
- AjaxLink<Void> newWorkflowProcessLink = new AjaxLink<Void>("add") {
-
- private static final long serialVersionUID = -7978723352517770644L;
-
- @Override
- public void onClick(final AjaxRequestTarget target) {
- newWorkflowProcess.toggle(target, true);
- }
- };
- ((WebMarkupContainer) get("container:content")).addOrReplace(newWorkflowProcessLink);
-
- setShowResultPage(true);
-
- modal.size(Modal.Size.Large);
-
- utility = new BaseModal<>("outer");
- addOuterObject(utility);
- utility.size(Modal.Size.Large);
- AjaxSubmitLink xmlEditorSubmit = utility.addSubmitButton();
- MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, RENDER, StandardEntitlement.WORKFLOW_DEF_SET);
- utility.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
- private static final long serialVersionUID = 8804221891699487139L;
-
- @Override
- public void onClose(final AjaxRequestTarget target) {
- utility.show(false);
- utility.close(target);
- }
- });
- initResultTable();
-
- // Check if Flowable Modeler directory is found
- modelerCtx = null;
- try {
- if (SyncopeConsoleApplication.get().getFlowableModelerDirectory() != null) {
- File baseDir = new File(SyncopeConsoleApplication.get().getFlowableModelerDirectory());
- if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
- modelerCtx = Constants.FLOWABLE_MODELER_CONTEXT;
- }
- }
- } catch (Exception e) {
- LOG.error("Could not check for Modeler directory", e);
- }
- }
-
- @Override
- protected WorkflowDefinitionDataProvider dataProvider() {
- return new WorkflowDefinitionDataProvider(rows);
- }
-
- @Override
- protected String paginatorRowsKey() {
- return Constants.PREF_WORKFLOW_PAGINATOR_ROWS;
- }
-
- @Override
- protected List<IColumn<WorkflowDefinitionTO, String>> getColumns() {
- List<IColumn<WorkflowDefinitionTO, String>> columns = new ArrayList<>();
-
- columns.add(new KeyPropertyColumn<>(new ResourceModel("key"), "key"));
- columns.add(new PropertyColumn<>(new ResourceModel("name"), "name", "name"));
- columns.add(new BooleanPropertyColumn<>(new ResourceModel("main"), null, "main"));
-
- return columns;
- }
-
- @Override
- public ActionsPanel<WorkflowDefinitionTO> getActions(final IModel<WorkflowDefinitionTO> model) {
- final ActionsPanel<WorkflowDefinitionTO> panel = super.getActions(model);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = -184018732772021627L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- final IModel<String> wfDefinition = new Model<>();
- try {
- wfDefinition.setObject(IOUtils.toString(restClient.getDefinition(
- MediaType.APPLICATION_XML_TYPE, model.getObject().getKey())));
- } catch (IOException e) {
- LOG.error("Could not get workflow definition", e);
- }
-
- utility.header(Model.of(model.getObject().getKey()));
- utility.setContent(new XMLEditorPanel(utility, wfDefinition, false, pageRef) {
-
- private static final long serialVersionUID = -7688359318035249200L;
-
- @Override
- public void onSubmit(final AjaxRequestTarget target) {
- if (StringUtils.isNotBlank(wfDefinition.getObject())) {
- try {
- restClient.setDefinition(MediaType.APPLICATION_XML_TYPE,
- model.getObject().getKey(), wfDefinition.getObject());
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
-
- target.add(container);
- utility.show(false);
- utility.close(target);
- } catch (SyncopeClientException e) {
- SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
- ? e.getClass().getName() : e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
- }
- });
- utility.show(target);
- target.add(utility);
- }
- }, ActionLink.ActionType.EDIT, StandardEntitlement.WORKFLOW_DEF_SET);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = 3109256773218160485L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- modal.header(Model.of(model.getObject().getKey()));
- modal.setContent(new ImageModalPanel<>(
- modal, restClient.getDiagram(model.getObject().getKey()), pageRef));
- modal.show(target);
- target.add(modal);
- }
- }, ActionLink.ActionType.VIEW, StandardEntitlement.WORKFLOW_DEF_GET);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = -184018732772021627L;
-
- @Override
- public Class<? extends Page> getPageClass() {
- return ModelerPopupPage.class;
- }
-
- @Override
- public PageParameters getPageParameters() {
- PageParameters parameters = new PageParameters();
- if (modelerCtx != null) {
- parameters.add(Constants.MODELER_CONTEXT, modelerCtx);
- }
- parameters.add(Constants.MODEL_ID_PARAM, model.getObject().getModelId());
-
- return parameters;
- }
-
- @Override
- protected boolean statusCondition(final WorkflowDefinitionTO modelObject) {
- return modelerCtx != null;
- }
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- // do nothing
- }
- }, ActionLink.ActionType.WORKFLOW_MODELER, StandardEntitlement.WORKFLOW_DEF_SET);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = -7978723352517770644L;
-
- @Override
- protected boolean statusCondition(final WorkflowDefinitionTO modelObject) {
- return !modelObject.isMain();
- }
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- try {
- restClient.deleteDefinition(model.getObject().getKey());
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- target.add(container);
- } catch (SyncopeClientException e) {
- LOG.error("While deleting workflow definition {}", model.getObject().getName(), e);
- SyncopeConsoleSession.get().error(
- StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
- }, ActionLink.ActionType.DELETE, StandardEntitlement.WORKFLOW_DEF_DELETE, true);
-
- return panel;
- }
-
- @Override
- protected Collection<ActionLink.ActionType> getBatches() {
- return Collections.emptyList();
- }
-
- public abstract static class Builder
- extends DirectoryPanel.Builder<WorkflowDefinitionTO, WorkflowDefinitionTO, WorkflowRestClient> {
-
- private static final long serialVersionUID = 5088962796986706805L;
-
- public Builder(final PageReference pageRef) {
- super(new WorkflowRestClient(), pageRef);
- }
-
- @Override
- protected WizardMgtPanel<WorkflowDefinitionTO> newInstance(final String id, final boolean wizardInModal) {
- return new WorkflowDirectoryPanel(id, this);
- }
- }
-
- protected class WorkflowDefinitionDataProvider extends DirectoryDataProvider<WorkflowDefinitionTO> {
-
- private static final long serialVersionUID = 1764153405387687592L;
-
- private final SortableDataProviderComparator<WorkflowDefinitionTO> comparator;
-
- private final WorkflowRestClient restClient = new WorkflowRestClient();
-
- public WorkflowDefinitionDataProvider(final int paginatorRows) {
- super(paginatorRows);
- this.comparator = new SortableDataProviderComparator<>(this);
- setSort("main", SortOrder.DESCENDING);
- }
-
- @Override
- public Iterator<WorkflowDefinitionTO> iterator(final long first, final long count) {
- List<WorkflowDefinitionTO> result = restClient.getDefinitions();
- Collections.sort(result, comparator);
- return result.subList((int) first, (int) first + (int) count).iterator();
- }
-
- @Override
- public long size() {
- return restClient.getDefinitions().size();
- }
-
- @Override
- public IModel<WorkflowDefinitionTO> model(final WorkflowDefinitionTO object) {
- return new CompoundPropertyModel<>(object);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
deleted file mode 100644
index b76bd9e..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
+++ /dev/null
@@ -1,51 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import javax.ws.rs.NotFoundException;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.wicket.request.resource.AbstractResource;
-import org.apache.wicket.util.string.StringValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-abstract class AbstractWorkflowResource extends AbstractResource {
-
- private static final long serialVersionUID = 5163553843196539019L;
-
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractWorkflowResource.class);
-
- protected final WorkflowRestClient restClient = new WorkflowRestClient();
-
- protected WorkflowDefinitionTO getWorkflowDefinition(final Attributes attributes) {
- final StringValue modelId =
- attributes.getRequest().getQueryParameters().getParameterValue(Constants.MODEL_ID_PARAM);
-
- WorkflowDefinitionTO workflowDefinition = modelId == null || modelId.isNull() ? null
- : restClient.getDefinitions().stream().
- filter(object -> modelId.toString().equals(object.getModelId())).findAny().orElse(null);
- if (workflowDefinition == null) {
- throw new NotFoundException("Workflow definition with modelId " + modelId);
- }
-
- return workflowDefinition;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
deleted file mode 100644
index f8dc13d..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
+++ /dev/null
@@ -1,79 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import org.apache.wicket.request.resource.AbstractResource;
-import org.apache.wicket.util.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Mounts directory on local filesystem as subcontext.
- */
-public class FilesystemResource extends AbstractResource {
-
- private static final long serialVersionUID = -4791087117785935198L;
-
- private static final Logger LOG = LoggerFactory.getLogger(FilesystemResource.class);
-
- private final String baseCtx;
-
- private final String basePath;
-
- public FilesystemResource(final String baseCtx, final String basePath) {
- this.baseCtx = baseCtx;
- this.basePath = basePath;
- }
-
- @Override
- protected ResourceResponse newResourceResponse(final Attributes attributes) {
- ResourceResponse response = new ResourceResponse();
-
- final File baseDir = new File(basePath);
- if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
- String reqPath = attributes.getRequest().getUrl().getPath();
- final String subPath = reqPath.substring(reqPath.indexOf(baseCtx) + baseCtx.length()).
- replace('/', File.separatorChar);
- LOG.debug("Request for {}", subPath);
-
- response.setTextEncoding(StandardCharsets.UTF_8.name());
- response.setWriteCallback(new WriteCallback() {
-
- @Override
- public void writeData(final Attributes attributes) throws IOException {
- try (InputStream resourceIS = Files.newInputStream(new File(baseDir, subPath).toPath())) {
- IOUtils.copy(resourceIS, attributes.getResponse().getOutputStream());
- } catch (IOException e) {
- LOG.error("Could not read from {}", baseDir.getAbsolutePath() + subPath, e);
- }
- }
- });
- } else {
- LOG.error("{} not found, not readable or not a directory", basePath);
- }
-
- return response;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
deleted file mode 100644
index 46fb22a..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import javax.ws.rs.core.MediaType;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.wicket.util.io.IOUtils;
-
-/**
- * Mirror REST resource for obtaining user workflow definition in JSON (used by Flowable Modeler).
- *
- * @see org.apache.syncope.common.rest.api.service.WorkflowService#get
- */
-public class WorkflowDefGETResource extends AbstractWorkflowResource {
-
- private static final long serialVersionUID = 4637304868056148970L;
-
- @Override
- protected ResourceResponse newResourceResponse(final Attributes attributes) {
- final WorkflowDefinitionTO toGet = getWorkflowDefinition(attributes);
-
- ResourceResponse response = new ResourceResponse();
- response.disableCaching();
- response.setContentType(MediaType.APPLICATION_JSON);
- response.setTextEncoding(StandardCharsets.UTF_8.name());
- response.setWriteCallback(new WriteCallback() {
-
- @Override
- public void writeData(final Attributes attributes) throws IOException {
- IOUtils.copy(
- new WorkflowRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE, toGet.getKey()),
- attributes.getResponse().getOutputStream());
- }
- });
-
- return response;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
deleted file mode 100644
index 84ec3e5..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
+++ /dev/null
@@ -1,74 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.cxf.common.util.UrlUtils;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.wicket.util.io.IOUtils;
-
-/**
- * Mirror REST resource for putting user workflow definition in JSON (used by Flowable Modeler).
- *
- * @see org.apache.syncope.common.rest.api.service.WorkflowService#set
- */
-public class WorkflowDefPUTResource extends AbstractWorkflowResource {
-
- private static final long serialVersionUID = 2964542005207297944L;
-
- @Override
- protected ResourceResponse newResourceResponse(final Attributes attributes) {
- String definition = null;
- try {
- HttpServletRequest request = (HttpServletRequest) attributes.getRequest().getContainerRequest();
- String requestBody = IOUtils.toString(request.getInputStream());
- String[] split = requestBody.split("&");
- for (int i = 0; i < split.length && definition == null; i++) {
- String keyValue = split[i];
- if (keyValue.startsWith("json_xml=")) {
- definition = UrlUtils.urlDecode(keyValue.split("=")[1]);
- }
- }
- } catch (IOException e) {
- LOG.error("Could not extract workflow definition", e);
- }
-
- WorkflowDefinitionTO toSet = getWorkflowDefinition(attributes);
-
- if (definition == null || toSet == null) {
- return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
- setError(Response.Status.BAD_REQUEST.getStatusCode(),
- "Could not extract workflow model id and / or definition");
- }
-
- try {
- restClient.setDefinition(MediaType.APPLICATION_JSON_TYPE, toSet.getKey(), definition);
- return new ResourceResponse().setStatusCode(Response.Status.NO_CONTENT.getStatusCode());
- } catch (Exception e) {
- LOG.error("While updating workflow definition", e);
- return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
- setError(Response.Status.BAD_REQUEST.getStatusCode(),
- "While updating workflow definition: " + e.getMessage());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java
deleted file mode 100644
index 8ccf057..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java
+++ /dev/null
@@ -1,59 +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.
- */
-package org.apache.syncope.client.console.rest;
-
-import java.util.List;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
-
-public class UserWorkflowRestClient extends BaseRestClient {
-
- private static final long serialVersionUID = -4785231164900813921L;
-
- public int countForms() {
- return getService(UserWorkflowService.class).
- getForms(new WorkflowFormQuery.Builder().page(1).size(1).build()).
- getTotalCount();
- }
-
- public List<WorkflowFormTO> getForms(final int page, final int size, final SortParam<String> sort) {
- return getService(UserWorkflowService.class).
- getForms(new WorkflowFormQuery.Builder().page(page).size(size).orderBy(toOrderBy(sort)).build()).
- getResult();
- }
-
- public WorkflowFormTO getFormForUser(final String userKey) {
- return getService(UserWorkflowService.class).getFormForUser(userKey);
- }
-
- public WorkflowFormTO claimForm(final String taskKey) {
- return getService(UserWorkflowService.class).claimForm(taskKey);
- }
-
- public void submitForm(final WorkflowFormTO form) {
- getService(UserWorkflowService.class).submitForm(form);
- }
-
- public UserTO executeTask(final String taskId, final UserTO form) {
- return getService(UserWorkflowService.class).executeTask(taskId, form);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
deleted file mode 100644
index 14711a4..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
+++ /dev/null
@@ -1,73 +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.
- */
-package org.apache.syncope.client.console.rest;
-
-import java.io.InputStream;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
-
-public class WorkflowRestClient extends BaseRestClient {
-
- private static final long serialVersionUID = 5049285686167071017L;
-
- private WorkflowService getService(final MediaType mediaType) {
- return SyncopeConsoleSession.get().getService(mediaType, WorkflowService.class);
- }
-
- public List<WorkflowDefinitionTO> getDefinitions() {
- return getService(WorkflowService.class).list(AnyTypeKind.USER.name());
- }
-
- public InputStream getDefinition(final MediaType mediaType, final String key) {
- Response response = getService(mediaType).get(AnyTypeKind.USER.name(), key);
-
- return (InputStream) response.getEntity();
- }
-
- public byte[] getDiagram(final String key) {
- WorkflowService service = getService(WorkflowService.class);
- WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
- Response response = service.exportDiagram(AnyTypeKind.USER.name(), key);
-
- byte[] diagram;
- try {
- diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
- } catch (Exception e) {
- LOG.error("Could not get workflow diagram", e);
- diagram = new byte[0];
- }
- return diagram;
- }
-
- public void setDefinition(final MediaType mediaType, final String key, final String definition) {
- getService(mediaType).set(AnyTypeKind.USER.name(), key, definition);
- }
-
- public void deleteDefinition(final String key) {
- getService(WorkflowService.class).delete(AnyTypeKind.USER.name(), key);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
index d8e8f77..7f8ade0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
@@ -98,11 +98,11 @@ public abstract class ActionLink<T extends Serializable> implements Serializable
NOTIFICATION_TASKS("read"),
ZOOM_IN("zoomin"),
ZOOM_OUT("zoomout"),
- WORKFLOW_MODELER("workflowModeler"),
VIEW_EXECUTIONS("read"),
VIEW_DETAILS("read"),
MANAGE_APPROVAL("edit"),
- EDIT_APPROVAL("edit");
+ EDIT_APPROVAL("edit"),
+ EXTERNAL_EDITOR("externalEditor");
private final String actionId;
[08/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
new file mode 100644
index 0000000..9565f99
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
@@ -0,0 +1,32 @@
+/*
+ * 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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum UserRequestFormPropertyType {
+
+ String,
+ Long,
+ Enum,
+ Date,
+ Boolean
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
new file mode 100644
index 0000000..d23b1bc
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
@@ -0,0 +1,47 @@
+/*
+ * 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.common.lib.types;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class WorkflowTasks {
+
+ private List<String> tasks;
+
+ public WorkflowTasks() {
+ this.tasks = new ArrayList<>();
+ }
+
+ public WorkflowTasks(final Collection<String> tasks) {
+ this();
+ this.tasks.addAll(tasks);
+ }
+
+ public List<String> getTasks() {
+ return tasks;
+ }
+
+ public void setTasks(final List<String> tasks) {
+ this.tasks = tasks;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/pom.xml b/ext/flowable/flowable-bpmn/pom.xml
new file mode 100644
index 0000000..9d13066
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/pom.xml
@@ -0,0 +1,87 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable BPMN</name>
+ <description>Apache Syncope Ext: Flowable BPMN</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-bpmn</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-email</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.javamail</groupId>
+ <artifactId>geronimo-javamail_1.4_mail</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-json-converter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.core</groupId>
+ <artifactId>syncope-core-workflow-java</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java
new file mode 100644
index 0000000..9247fd4
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java
@@ -0,0 +1,65 @@
+/*
+ * 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.flowable.api;
+
+import java.io.OutputStream;
+import java.util.List;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+
+public interface BpmnProcessManager {
+
+ /**
+ * @return all available workflow processes.
+ */
+ List<BpmnProcessTO> getProcesses();
+
+ /**
+ * Export the process for the given key, in the requested format.
+ *
+ * @param key process key
+ * @param format export format
+ * @param os export stream
+ */
+ void exportProcess(String key, BpmnProcessFormat format, OutputStream os);
+
+ /**
+ * Export the process graphical representation for the given key (if available).
+ *
+ * @param key process key
+ * @param os export stream
+ */
+ void exportDiagram(String key, OutputStream os);
+
+ /**
+ * Import the process for the given key.
+ *
+ * @param key process key
+ * @param format import format
+ * @param process process
+ */
+ void importProcess(String key, BpmnProcessFormat format, String process);
+
+ /**
+ * Remove the process for the given key.
+ *
+ * @param key process key
+ */
+ void deleteProcess(String key);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java
new file mode 100644
index 0000000..b11b97c
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java
@@ -0,0 +1,108 @@
+/*
+ * 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.flowable.api;
+
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.event.AnyDeletedEvent;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.springframework.transaction.event.TransactionalEventListener;
+
+public interface UserRequestHandler {
+
+ /**
+ * Starts a new user request, for the given BPMN process and user.
+ *
+ * @param bpmnProcess BPMN process
+ * @param user user
+ * @return data about the started request service, including execution id
+ */
+ UserRequestTO start(String bpmnProcess, User user);
+
+ /**
+ * Parses the given execution id to find matching user request and owner.
+ *
+ * @param executionId execution id
+ * @return matching user request and owner
+ */
+ Pair<ProcessInstance, String> parse(String executionId);
+
+ /**
+ * Cancel a running user request.
+ *
+ * @param procInst process instance for user request
+ * @param reason reason to cancel the user request
+ */
+ void cancel(ProcessInstance procInst, String reason);
+
+ /**
+ * Cancel all running user requests for the given process definition id.
+ *
+ * @param processDefinitionId process definition id
+ */
+ void cancelByProcessDefinition(String processDefinitionId);
+
+ /**
+ * Cancel all running user requests for the user in the given delete event.
+ *
+ * @param event delete event
+ */
+ @TransactionalEventListener
+ void cancelByUser(AnyDeletedEvent event);
+
+ /**
+ * Get the forms for current workflow process instances matching the provided parameters.
+ *
+ * @param page result page
+ * @param size items per page
+ * @param orderByClauses sort conditions
+ * @return total number of forms, list of forms matching the provided parameters
+ */
+ Pair<Integer, List<UserRequestForm>> getForms(int page, int size, List<OrderByClause> orderByClauses);
+
+ /**
+ * Get forms for given user (if present).
+ *
+ * @param userKey user key
+ * @return form (if present), otherwise null
+ */
+ List<UserRequestForm> getForms(String userKey);
+
+ /**
+ * Claim a form for a given object.
+ *
+ * @param taskId Workflow task to which the form is associated
+ * @return updated form
+ */
+ UserRequestForm claimForm(String taskId);
+
+ /**
+ * Submit a form.
+ *
+ * @param form to be submitted
+ * @return user updated by this form submit
+ */
+ WorkflowResult<UserPatch> submitForm(UserRequestForm form);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java
new file mode 100644
index 0000000..6c9ef50
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java
@@ -0,0 +1,70 @@
+/*
+ * 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.flowable.api;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+
+public interface WorkflowTaskManager {
+
+ /**
+ * Gets variable value.
+ * Returns null when no variable value is found with the given name or when the value is set to null.
+ *
+ * @param <T> variable type
+ * @param executionId id of execution, cannot be null.
+ * @param variableName name of variable, cannot be null.
+ * @param variableClass class of variable, cannot be null.
+ * @return the variable value or null if the variable is undefined or the value of the variable is null.
+ * @throws org.flowable.common.engine.api.FlowableObjectNotFoundException
+ * when no execution is found for the given executionId.
+ * @throws ClassCastException
+ * when cannot cast variable to given class
+ */
+ <T> T getVariable(String executionId, String variableName, Class<T> variableClass);
+
+ /**
+ * Updates or create sa variable for an execution.
+ *
+ * @param executionId id of execution to set variable in, cannot be null.
+ * @param variableName name of variable to set, cannot be null.
+ * @param value value to set; when null is passed, the variable is not removed, only it's value will be set to null
+ * @throws org.flowable.common.engine.api.FlowableObjectNotFoundException
+ * when no execution is found for the given executionId.
+ */
+ void setVariable(String executionId, String variableName, Object value);
+
+ /**
+ * Get tasks available for execution, for given user.
+ *
+ * @param userKey user key
+ * @return available tasks
+ */
+ List<WorkflowTask> getAvailableTasks(String userKey);
+
+ /**
+ * Execute a task on an user.
+ *
+ * @param workflowTaskExecInput input for task execution
+ * @return user after task execution
+ */
+ WorkflowResult<String> executeNextTask(WorkflowTaskExecInput workflowTaskExecInput);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java
new file mode 100644
index 0000000..bca8b25
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java
@@ -0,0 +1,212 @@
+/*
+ * 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.flowable.impl;
+
+import org.apache.syncope.core.flowable.api.BpmnProcessManager;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.dao.NotFoundException;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.bpmn.converter.BpmnXMLConverter;
+import org.flowable.bpmn.model.BpmnModel;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.editor.constants.ModelDataJsonConstants;
+import org.flowable.editor.language.json.converter.BpmnJsonConverter;
+import org.flowable.engine.repository.Deployment;
+import org.flowable.engine.repository.Model;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
+public class FlowableBpmnProcessManager implements BpmnProcessManager {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(BpmnProcessManager.class);
+
+ protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+ protected static final String MODEL_DATA_JSON_MODEL = "model";
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ protected Model getModel(final ProcessDefinition procDef) {
+ try {
+ Model model = engine.getRepositoryService().createModelQuery().
+ deploymentId(procDef.getDeploymentId()).singleResult();
+ if (model == null) {
+ throw new NotFoundException("Could not find Model for deployment " + procDef.getDeploymentId());
+ }
+ return model;
+ } catch (Exception e) {
+ throw new WorkflowException("While accessing process " + procDef.getKey(), e);
+ }
+ }
+
+ @Override
+ public List<BpmnProcessTO> getProcesses() {
+ try {
+ return engine.getRepositoryService().createProcessDefinitionQuery().latestVersion().list().stream().
+ map(procDef -> {
+ BpmnProcessTO defTO = new BpmnProcessTO();
+ defTO.setKey(procDef.getKey());
+ defTO.setName(procDef.getName());
+
+ try {
+ defTO.setModelId(getModel(procDef).getId());
+ } catch (NotFoundException e) {
+ LOG.warn("No model found for definition {}, ignoring", procDef.getDeploymentId(), e);
+ }
+
+ defTO.setUserWorkflow(FlowableRuntimeUtils.WF_PROCESS_ID.equals(procDef.getKey()));
+
+ return defTO;
+ }).collect(Collectors.toList());
+ } catch (FlowableException e) {
+ throw new WorkflowException("While listing available process definitions", e);
+ }
+ }
+
+ protected void exportProcessModel(final String key, final OutputStream os) {
+ Model model = getModel(FlowableRuntimeUtils.getLatestProcDefByKey(engine, key));
+
+ try {
+ ObjectNode modelNode = (ObjectNode) OBJECT_MAPPER.readTree(model.getMetaInfo());
+ modelNode.put(ModelDataJsonConstants.MODEL_ID, model.getId());
+ modelNode.replace(MODEL_DATA_JSON_MODEL,
+ OBJECT_MAPPER.readTree(engine.getRepositoryService().getModelEditorSource(model.getId())));
+
+ os.write(modelNode.toString().getBytes());
+ } catch (IOException e) {
+ LOG.error("While exporting workflow definition {}", model.getId(), e);
+ }
+ }
+
+ protected void exportProcessResource(final String deploymentId, final String resourceName, final OutputStream os) {
+ try (InputStream procDefIS = engine.getRepositoryService().getResourceAsStream(deploymentId, resourceName)) {
+ IOUtils.copy(procDefIS, os);
+ } catch (IOException e) {
+ LOG.error("While exporting {}", resourceName, e);
+ }
+ }
+
+ @Override
+ public void exportProcess(final String key, final BpmnProcessFormat format, final OutputStream os) {
+ switch (format) {
+ case JSON:
+ exportProcessModel(key, os);
+ break;
+
+ case XML:
+ default:
+ ProcessDefinition procDef = FlowableRuntimeUtils.getLatestProcDefByKey(engine, key);
+ if (procDef == null) {
+ throw new NotFoundException("Process Definition " + key);
+ }
+ exportProcessResource(procDef.getDeploymentId(), procDef.getResourceName(), os);
+ }
+ }
+
+ @Override
+ public void exportDiagram(final String key, final OutputStream os) {
+ ProcessDefinition procDef = FlowableRuntimeUtils.getLatestProcDefByKey(engine, key);
+ if (procDef == null) {
+ throw new NotFoundException("Workflow process definition for " + key);
+ }
+ exportProcessResource(procDef.getDeploymentId(), procDef.getDiagramResourceName(), os);
+ }
+
+ @Override
+ public void importProcess(final String key, final BpmnProcessFormat format, final String definition) {
+ ProcessDefinition procDef = FlowableRuntimeUtils.getLatestProcDefByKey(engine, key);
+ String resourceName = procDef == null ? key + ".bpmn20.xml" : procDef.getResourceName();
+ Deployment deployment;
+ switch (format) {
+ case JSON:
+ JsonNode definitionNode;
+ try {
+ definitionNode = OBJECT_MAPPER.readTree(definition);
+ if (definitionNode.has(MODEL_DATA_JSON_MODEL)) {
+ definitionNode = definitionNode.get(MODEL_DATA_JSON_MODEL);
+ }
+ if (!definitionNode.has(BpmnJsonConverter.EDITOR_CHILD_SHAPES)) {
+ throw new IllegalArgumentException(
+ "Could not find JSON node " + BpmnJsonConverter.EDITOR_CHILD_SHAPES);
+ }
+
+ BpmnModel bpmnModel = new BpmnJsonConverter().convertToBpmnModel(definitionNode);
+ deployment = FlowableDeployUtils.deployDefinition(
+ engine,
+ resourceName,
+ new BpmnXMLConverter().convertToXML(bpmnModel));
+ } catch (Exception e) {
+ throw new WorkflowException("While creating or updating process " + key, e);
+ }
+ break;
+
+ case XML:
+ default:
+ deployment = FlowableDeployUtils.deployDefinition(
+ engine,
+ resourceName,
+ definition.getBytes());
+ }
+
+ try {
+ procDef = engine.getRepositoryService().createProcessDefinitionQuery().
+ deploymentId(deployment.getId()).latestVersion().singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While accessing deployment " + deployment.getId(), e);
+ }
+ if (!key.equals(procDef.getKey())) {
+ throw new WorkflowException("Mismatching key: expected " + key + ", found " + procDef.getKey());
+ }
+ FlowableDeployUtils.deployModel(engine, procDef);
+ }
+
+ @Override
+ public void deleteProcess(final String key) {
+ if (FlowableRuntimeUtils.WF_PROCESS_ID.equals(key)) {
+ throw new WorkflowException("Cannot delete the main process " + FlowableRuntimeUtils.WF_PROCESS_ID);
+ }
+
+ try {
+ engine.getRepositoryService().createProcessDefinitionQuery().processDefinitionKey(key).list().
+ forEach(procDef -> {
+ engine.getRepositoryService().deleteModel(getModel(procDef).getId());
+ engine.getRepositoryService().deleteDeployment(procDef.getDeploymentId(), true);
+ });
+ } catch (Exception e) {
+ throw new WorkflowException("While deleting process " + key, e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
new file mode 100644
index 0000000..5af0188
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
@@ -0,0 +1,92 @@
+/*
+ * 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.flowable.impl;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.bpmn.converter.BpmnXMLConverter;
+import org.flowable.bpmn.model.BpmnModel;
+import org.flowable.editor.constants.ModelDataJsonConstants;
+import org.flowable.editor.language.json.converter.BpmnJsonConverter;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.repository.Deployment;
+import org.flowable.engine.repository.Model;
+import org.flowable.engine.repository.ProcessDefinition;
+
+public final class FlowableDeployUtils {
+
+ private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+ public static Deployment deployDefinition(
+ final ProcessEngine engine, final String resourceName, final byte[] definition) {
+
+ try {
+ return engine.getRepositoryService().createDeployment().
+ addInputStream(resourceName, new ByteArrayInputStream(definition)).deploy();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While importing " + resourceName, e);
+ }
+ }
+
+ public static void deployModel(final ProcessEngine engine, final ProcessDefinition procDef) {
+ XMLStreamReader xtr = null;
+ try (InputStream bpmnStream = engine.getRepositoryService().
+ getResourceAsStream(procDef.getDeploymentId(), procDef.getResourceName());
+ InputStreamReader isr = new InputStreamReader(bpmnStream)) {
+
+ xtr = XMLInputFactory.newInstance().createXMLStreamReader(isr);
+ BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
+
+ Model model = engine.getRepositoryService().newModel();
+ ObjectNode modelObjectNode = OBJECT_MAPPER.createObjectNode();
+ modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, procDef.getName());
+ model.setMetaInfo(modelObjectNode.toString());
+ model.setName(procDef.getName());
+ model.setDeploymentId(procDef.getDeploymentId());
+ model.setVersion(procDef.getVersion());
+
+ engine.getRepositoryService().saveModel(model);
+ engine.getRepositoryService().addModelEditorSource(
+ model.getId(),
+ new BpmnJsonConverter().convertToJson(bpmnModel).toString().getBytes());
+ } catch (Exception e) {
+ throw new WorkflowException("While importing " + procDef.getResourceName(), e);
+ } finally {
+ if (xtr != null) {
+ try {
+ xtr.close();
+ } catch (XMLStreamException e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ private FlowableDeployUtils() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java
new file mode 100644
index 0000000..12d8faa
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java
@@ -0,0 +1,225 @@
+/*
+ * 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.flowable.impl;
+
+import java.util.Base64;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
+import org.apache.syncope.core.persistence.api.attrvalue.validation.ParsingValidationException;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.history.HistoricActivityInstance;
+import org.flowable.engine.impl.RuntimeServiceImpl;
+import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.flowable.task.api.TaskQuery;
+import org.identityconnectors.common.security.EncryptorFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class FlowableRuntimeUtils {
+
+ private static final Logger LOG = LoggerFactory.getLogger(FlowableRuntimeUtils.class);
+
+ public static final String WF_PROCESS_ID = "userWorkflow";
+
+ public static final String USER = "user";
+
+ public static final String WF_EXECUTOR = "wfExecutor";
+
+ public static final String FORM_SUBMITTER = "formSubmitter";
+
+ public static final String USER_TO = "userTO";
+
+ public static final String ENABLED = "enabled";
+
+ public static final String USER_PATCH = "userPatch";
+
+ public static final String TASK = "task";
+
+ public static final String TOKEN = "token";
+
+ public static final String PASSWORD = "password";
+
+ public static final String PROP_BY_RESOURCE = "propByResource";
+
+ public static final String PROPAGATE_ENABLE = "propagateEnable";
+
+ public static final String ENCRYPTED_PWD = "encryptedPwd";
+
+ public static final String STORE_PASSWORD = "storePassword";
+
+ public static final String EVENT = "event";
+
+ public static String encrypt(final String clear) {
+ byte[] encrypted = EncryptorFactory.getInstance().getDefaultEncryptor().encrypt(clear.getBytes());
+ return Base64.getEncoder().encodeToString(encrypted);
+ }
+
+ public static String decrypt(final String crypted) {
+ byte[] decrypted = EncryptorFactory.getInstance().getDefaultEncryptor().
+ decrypt(Base64.getDecoder().decode(crypted));
+ return new String(decrypted);
+ }
+
+ public static String getWFProcBusinessKey(final String userKey) {
+ return FlowableRuntimeUtils.getProcBusinessKey(WF_PROCESS_ID, userKey);
+ }
+
+ public static String getWFProcInstID(final DomainProcessEngine engine, final String userKey) {
+ ProcessInstance procInst = engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceBusinessKey(getWFProcBusinessKey(userKey)).singleResult();
+ return procInst == null ? null : procInst.getId();
+ }
+
+ public static String getProcBusinessKey(final String processDefinitionId, final String userKey) {
+ return processDefinitionId + ":" + userKey;
+ }
+
+ public static ProcessDefinition getLatestProcDefByKey(final DomainProcessEngine engine, final String key) {
+ try {
+ return engine.getRepositoryService().createProcessDefinitionQuery().
+ processDefinitionKey(key).latestVersion().singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While accessing process " + key, e);
+ }
+ }
+
+ public static Set<String> getPerformedTasks(
+ final DomainProcessEngine engine, final String procInstID, final User user) {
+
+ return engine.getHistoryService().createHistoricActivityInstanceQuery().
+ executionId(procInstID).
+ list().stream().
+ map(HistoricActivityInstance::getActivityId).
+ collect(Collectors.toSet());
+ }
+
+ public static void updateStatus(final DomainProcessEngine engine, final String procInstID, final User user) {
+ List<Task> tasks = createTaskQuery(engine, false).processInstanceId(procInstID).list();
+ if (tasks.isEmpty() || tasks.size() > 1) {
+ LOG.warn("While setting user status: unexpected task number ({})", tasks.size());
+ } else {
+ user.setStatus(tasks.get(0).getTaskDefinitionKey());
+ }
+ }
+
+ public static List<ProcessInstance> getProcessInstances(final DomainProcessEngine engine, final String userKey) {
+ return engine.getRuntimeService().createNativeProcessInstanceQuery().
+ sql("SELECT ID_,PROC_INST_ID_ FROM " + engine.getManagementService().getTableName(ExecutionEntity.class)
+ + " WHERE BUSINESS_KEY_ LIKE '" + getProcBusinessKey("%", userKey) + "'"
+ + " AND PARENT_ID_ IS NULL").list();
+ }
+
+ public static TaskQuery createTaskQuery(final DomainProcessEngine engine, final boolean onlyFormTasks) {
+ SyncopeTaskQueryImpl taskQuery = new SyncopeTaskQueryImpl(
+ ((RuntimeServiceImpl) engine.getRuntimeService()).getCommandExecutor());
+ if (onlyFormTasks) {
+ taskQuery.taskWithFormKey();
+ }
+ return taskQuery;
+ }
+
+ public static String getFormTask(final DomainProcessEngine engine, final String procInstID) {
+ String result = null;
+
+ List<Task> tasks = createTaskQuery(engine, true).processInstanceId(procInstID).list();
+ if (tasks.isEmpty() || tasks.size() > 1) {
+ LOG.debug("While checking if form task: unexpected task number ({})", tasks.size());
+ } else {
+ result = tasks.get(0).getFormKey();
+ }
+
+ return result;
+ }
+
+ /**
+ * Saves resources to be propagated and password for later - after form submission - propagation.
+ *
+ * @param engine Flowable engine
+ * @param procInstID process instance id
+ * @param user user JPA entity
+ * @param userTO user transfer object
+ * @param password password
+ * @param enabled is user to be enabled or not?
+ * @param propByRes current propagation actions against resources
+ */
+ public static void saveForFormSubmit(
+ final DomainProcessEngine engine,
+ final String procInstID,
+ final User user,
+ final UserTO userTO,
+ final String password,
+ final Boolean enabled,
+ final PropagationByResource propByRes) {
+
+ String formTaskId = getFormTask(engine, procInstID);
+ if (formTaskId == null) {
+ return;
+ }
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.USER_TO, userTO);
+
+ if (password == null) {
+ String encryptedPwd = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD, String.class);
+ if (encryptedPwd != null) {
+ userTO.setPassword(decrypt(encryptedPwd));
+ }
+ } else {
+ userTO.setPassword(password);
+ engine.getRuntimeService().
+ setVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD, encrypt(password));
+ }
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.ENABLED, enabled);
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ if (propByRes != null) {
+ propByRes.clear();
+ }
+ }
+
+ public static void throwException(final FlowableException e, final String defaultMessage) {
+ if (e.getCause() != null) {
+ if (e.getCause().getCause() instanceof SyncopeClientException) {
+ throw (SyncopeClientException) e.getCause().getCause();
+ } else if (e.getCause().getCause() instanceof ParsingValidationException) {
+ throw (ParsingValidationException) e.getCause().getCause();
+ } else if (e.getCause().getCause() instanceof InvalidEntityException) {
+ throw (InvalidEntityException) e.getCause().getCause();
+ }
+ }
+
+ throw new WorkflowException(defaultMessage, e);
+ }
+
+ private FlowableRuntimeUtils() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java
new file mode 100644
index 0000000..1c198a8
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java
@@ -0,0 +1,574 @@
+/*
+ * 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.flowable.impl;
+
+import org.apache.syncope.core.flowable.api.UserRequestHandler;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import javax.annotation.Resource;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.PasswordPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestFormProperty;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.common.lib.types.UserRequestFormPropertyType;
+import org.apache.syncope.core.flowable.api.WorkflowTaskManager;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.dao.NotFoundException;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.core.persistence.api.entity.EntityFactory;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.provisioning.api.event.AnyDeletedEvent;
+import org.apache.syncope.core.spring.BeanUtils;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.form.FormProperty;
+import org.flowable.engine.form.FormType;
+import org.flowable.engine.form.TaskFormData;
+import org.flowable.engine.history.HistoricActivityInstance;
+import org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.flowable.task.api.TaskQuery;
+import org.flowable.task.api.history.HistoricTaskInstance;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
+public class FlowableUserRequestHandler implements UserRequestHandler {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(UserRequestHandler.class);
+
+ protected static final String[] PROPERTY_IGNORE_PROPS = { "type" };
+
+ @Autowired
+ protected WorkflowTaskManager wfTaskManager;
+
+ @Autowired
+ protected UserDataBinder dataBinder;
+
+ @Resource(name = "adminUser")
+ protected String adminUser;
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ @Autowired
+ protected UserDAO userDAO;
+
+ @Autowired
+ protected EntityFactory entityFactory;
+
+ protected User lazyLoad(final User user) {
+ // using BeanUtils to access all user's properties and trigger lazy loading - we are about to
+ // serialize a User instance for availability within workflow tasks, and this breaks transactions
+ BeanUtils.copyProperties(user, entityFactory.newEntity(User.class));
+ return user;
+ }
+
+ @Override
+ public UserRequestTO start(final String bpmnProcess, final User user) {
+ Map<String, Object> variables = new HashMap<>(2);
+ variables.put(FlowableRuntimeUtils.WF_EXECUTOR, AuthContextUtils.getUsername());
+ variables.put(FlowableRuntimeUtils.USER, lazyLoad(user));
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+
+ ProcessInstance procInst = null;
+ try {
+ procInst = engine.getRuntimeService().startProcessInstanceByKey(bpmnProcess, variables);
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(e, "While starting " + bpmnProcess + " instance");
+ }
+
+ engine.getRuntimeService().updateBusinessKey(
+ procInst.getProcessInstanceId(),
+ FlowableRuntimeUtils.getProcBusinessKey(bpmnProcess, user.getKey()));
+
+ UserRequestTO userRequestTO = new UserRequestTO();
+ userRequestTO.setProcessInstanceId(procInst.getProcessInstanceId());
+ userRequestTO.setExecutionId(procInst.getId());
+ userRequestTO.setBpmnProcess(bpmnProcess);
+ userRequestTO.setUser(user.getKey());
+ return userRequestTO;
+ }
+
+ @Override
+ public Pair<ProcessInstance, String> parse(final String executionId) {
+ ProcessInstance procInst = null;
+ try {
+ procInst = engine.getRuntimeService().
+ createProcessInstanceQuery().processInstanceId(executionId).singleResult();
+ } catch (FlowableException e) {
+ throw new NotFoundException("User request execution with id " + executionId);
+ }
+
+ return Pair.of(procInst, getUserKey(procInst.getProcessInstanceId()));
+ }
+
+ @Override
+ public void cancel(final ProcessInstance procInst, final String reason) {
+ if (FlowableRuntimeUtils.WF_PROCESS_ID.equals(procInst.getProcessDefinitionKey())) {
+ throw new WorkflowException(new IllegalArgumentException(
+ "Cannot cancel a " + FlowableRuntimeUtils.WF_PROCESS_ID + " execution"));
+ }
+
+ engine.getRuntimeService().deleteProcessInstance(procInst.getId(), reason);
+ }
+
+ @Override
+ public void cancelByProcessDefinition(final String processDefinitionId) {
+ engine.getRuntimeService().
+ createProcessInstanceQuery().processDefinitionId(processDefinitionId).list().
+ forEach(procInst -> {
+ engine.getRuntimeService().deleteProcessInstance(
+ procInst.getId(), "Cascade Delete process definition " + processDefinitionId);
+ });
+ }
+
+ @Override
+ public void cancelByUser(final AnyDeletedEvent event) {
+ if (AuthContextUtils.getDomain().equals(event.getDomain()) && event.getAnyTypeKind() == AnyTypeKind.USER) {
+ String username = event.getAnyName();
+ FlowableRuntimeUtils.getProcessInstances(engine, event.getAnyKey()).
+ forEach(procInst -> {
+ engine.getRuntimeService().deleteProcessInstance(
+ procInst.getId(), "Cascade Delete user " + username);
+ });
+ }
+ }
+
+ protected UserRequestFormPropertyType fromFlowableFormType(final FormType flowableFormType) {
+ UserRequestFormPropertyType result = UserRequestFormPropertyType.String;
+
+ if (null != flowableFormType.getName()) {
+ switch (flowableFormType.getName()) {
+ case "long":
+ result = UserRequestFormPropertyType.Long;
+ break;
+
+ case "enum":
+ result = UserRequestFormPropertyType.Enum;
+ break;
+
+ case "date":
+ result = UserRequestFormPropertyType.Date;
+ break;
+
+ case "boolean":
+ result = UserRequestFormPropertyType.Boolean;
+ break;
+
+ case "string":
+ default:
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ protected UserRequestForm getFormTO(final Task task) {
+ return getFormTO(task, engine.getFormService().getTaskFormData(task.getId()));
+ }
+
+ protected UserRequestForm getFormTO(final Task task, final TaskFormData fd) {
+ UserRequestForm formTO =
+ getFormTO(task.getProcessInstanceId(), task.getId(), fd.getFormKey(), fd.getFormProperties());
+ BeanUtils.copyProperties(task, formTO);
+
+ return formTO;
+ }
+
+ protected UserRequestForm getFormTO(final HistoricTaskInstance task) {
+ List<HistoricFormPropertyEntity> props = engine.getHistoryService().
+ createHistoricDetailQuery().taskId(task.getId()).list().stream().
+ filter(HistoricFormPropertyEntity.class::isInstance).
+ map(HistoricFormPropertyEntity.class::cast).
+ collect(Collectors.toList());
+
+ UserRequestForm formTO = getHistoricFormTO(
+ task.getProcessInstanceId(), task.getId(), task.getFormKey(), props);
+ BeanUtils.copyProperties(task, formTO);
+
+ HistoricActivityInstance historicActivityInstance = engine.getHistoryService().
+ createHistoricActivityInstanceQuery().
+ executionId(task.getExecutionId()).activityType("userTask").activityName(task.getName()).singleResult();
+
+ if (historicActivityInstance != null) {
+ formTO.setCreateTime(historicActivityInstance.getStartTime());
+ formTO.setDueDate(historicActivityInstance.getEndTime());
+ }
+
+ return formTO;
+ }
+
+ protected String getUserKey(final String procInstId) {
+ String procBusinessKey = engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceId(procInstId).singleResult().getBusinessKey();
+
+ return StringUtils.substringAfter(procBusinessKey, ":");
+ }
+
+ protected UserRequestForm getHistoricFormTO(
+ final String procInstID,
+ final String taskId,
+ final String formKey,
+ final List<HistoricFormPropertyEntity> props) {
+
+ UserRequestForm formTO = new UserRequestForm();
+
+ User user = userDAO.find(getUserKey(procInstID));
+ if (user == null) {
+ throw new NotFoundException("User for process instance id " + procInstID);
+ }
+ formTO.setUsername(user.getUsername());
+
+ formTO.setTaskId(taskId);
+ formTO.setFormKey(formKey);
+
+ formTO.setUserTO(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_TO, UserTO.class));
+ formTO.setUserPatch(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class));
+
+ formTO.getProperties().addAll(props.stream().map(prop -> {
+ UserRequestFormProperty propertyTO = new UserRequestFormProperty();
+ propertyTO.setId(prop.getPropertyId());
+ propertyTO.setName(prop.getPropertyId());
+ propertyTO.setValue(prop.getPropertyValue());
+ return propertyTO;
+ }).collect(Collectors.toList()));
+
+ return formTO;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected UserRequestForm getFormTO(
+ final String procInstID,
+ final String taskId,
+ final String formKey,
+ final List<FormProperty> props) {
+
+ UserRequestForm formTO = new UserRequestForm();
+
+ User user = userDAO.find(getUserKey(procInstID));
+ if (user == null) {
+ throw new NotFoundException("User for process instance id " + procInstID);
+ }
+ formTO.setUsername(user.getUsername());
+
+ formTO.setTaskId(taskId);
+ formTO.setFormKey(formKey);
+
+ formTO.setUserTO(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_TO, UserTO.class));
+ formTO.setUserPatch(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class));
+
+ formTO.getProperties().addAll(props.stream().map(fProp -> {
+ UserRequestFormProperty propertyTO = new UserRequestFormProperty();
+ BeanUtils.copyProperties(fProp, propertyTO, PROPERTY_IGNORE_PROPS);
+ propertyTO.setType(fromFlowableFormType(fProp.getType()));
+ if (propertyTO.getType() == UserRequestFormPropertyType.Date) {
+ propertyTO.setDatePattern((String) fProp.getType().getInformation("datePattern"));
+ }
+ if (propertyTO.getType() == UserRequestFormPropertyType.Enum) {
+ propertyTO.getEnumValues().putAll((Map<String, String>) fProp.getType().getInformation("values"));
+ }
+ return propertyTO;
+ }).collect(Collectors.toList()));
+
+ return formTO;
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public Pair<Integer, List<UserRequestForm>> getForms(
+ final int page, final int size, final List<OrderByClause> orderByClauses) {
+
+ Pair<Integer, List<UserRequestForm>> forms = null;
+
+ TaskQuery formTaskQuery = FlowableRuntimeUtils.createTaskQuery(engine, true);
+
+ String authUser = AuthContextUtils.getUsername();
+ if (adminUser.equals(authUser)) {
+ forms = getForms(formTaskQuery, page, size, orderByClauses);
+ } else {
+ User user = userDAO.findByUsername(authUser);
+ if (user == null) {
+ throw new NotFoundException("Syncope User " + authUser);
+ }
+
+ forms = getForms(formTaskQuery.taskCandidateOrAssigned(user.getUsername()), page, size, orderByClauses);
+
+ List<String> candidateGroups = new ArrayList<>(userDAO.findAllGroupNames(user));
+ if (!candidateGroups.isEmpty()) {
+ forms = getForms(formTaskQuery.taskCandidateGroupIn(candidateGroups), page, size, orderByClauses);
+ }
+ }
+
+ return forms == null
+ ? Pair.of(0, Collections.<UserRequestForm>emptyList())
+ : forms;
+ }
+
+ protected Pair<Integer, List<UserRequestForm>> getForms(
+ final TaskQuery query, final int page, final int size, final List<OrderByClause> orderByClauses) {
+
+ TaskQuery sortedQuery = query;
+ for (OrderByClause clause : orderByClauses) {
+ boolean ack = true;
+ switch (clause.getField().trim()) {
+ case "taskId":
+ sortedQuery = sortedQuery.orderByTaskId();
+ break;
+
+ case "createTime":
+ sortedQuery = sortedQuery.orderByTaskCreateTime();
+ break;
+
+ case "dueDate":
+ sortedQuery = sortedQuery.orderByTaskDueDate();
+ break;
+
+ case "owner":
+ sortedQuery = sortedQuery.orderByTaskOwner();
+ break;
+
+ default:
+ LOG.warn("Form sort request by {}: unsupported, ignoring", clause.getField().trim());
+ ack = false;
+ }
+ if (ack) {
+ sortedQuery = clause.getDirection() == OrderByClause.Direction.ASC
+ ? sortedQuery.asc()
+ : sortedQuery.desc();
+ }
+ }
+
+ List<UserRequestForm> result = sortedQuery.listPage(size * (page <= 0 ? 0 : page - 1), size).stream().
+ map(task -> task instanceof HistoricTaskInstance
+ ? getFormTO((HistoricTaskInstance) task) : getFormTO(task)).
+ collect(Collectors.toList());
+
+ return Pair.of((int) query.count(), result);
+ }
+
+ @Override
+ public List<UserRequestForm> getForms(final String userKey) {
+ List<UserRequestForm> result = new ArrayList<>();
+ FlowableRuntimeUtils.getProcessInstances(engine, userKey).forEach(procInst -> {
+ Task task;
+ try {
+ task = FlowableRuntimeUtils.createTaskQuery(engine, true).
+ processInstanceId(procInst.getProcessInstanceId()).singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While reading form for process instance "
+ + procInst.getProcessInstanceId(), e);
+ }
+
+ if (task != null) {
+ TaskFormData formData;
+ try {
+ formData = engine.getFormService().getTaskFormData(task.getId());
+ } catch (FlowableException e) {
+ throw new WorkflowException("Error while getting form data for task " + task.getId(), e);
+ }
+ if (formData != null && !formData.getFormProperties().isEmpty()) {
+ result.add(getFormTO(task, formData));
+ }
+ }
+ });
+
+ return result;
+ }
+
+ protected Pair<Task, TaskFormData> checkTask(final String taskId, final String authUser) {
+ Task task;
+ try {
+ task = FlowableRuntimeUtils.createTaskQuery(engine, true).taskId(taskId).singleResult();
+ if (task == null) {
+ throw new FlowableException("NULL result");
+ }
+ } catch (FlowableException e) {
+ throw new NotFoundException("Flowable Task " + taskId, e);
+ }
+
+ TaskFormData formData;
+ try {
+ formData = engine.getFormService().getTaskFormData(task.getId());
+ } catch (FlowableException e) {
+ throw new NotFoundException("Form for Flowable Task " + taskId, e);
+ }
+
+ if (!adminUser.equals(authUser)) {
+ User user = userDAO.findByUsername(authUser);
+ if (user == null) {
+ throw new NotFoundException("Syncope User " + authUser);
+ }
+ }
+
+ return Pair.of(task, formData);
+ }
+
+ @Override
+ public UserRequestForm claimForm(final String taskId) {
+ String authUser = AuthContextUtils.getUsername();
+ Pair<Task, TaskFormData> checked = checkTask(taskId, authUser);
+
+ if (!adminUser.equals(authUser)) {
+ List<Task> tasksForUser = FlowableRuntimeUtils.createTaskQuery(engine, true).
+ taskId(taskId).taskCandidateUser(authUser).list();
+ if (tasksForUser.isEmpty()) {
+ throw new WorkflowException(
+ new IllegalArgumentException(authUser + " is not candidate for task " + taskId));
+ }
+ }
+
+ Task task;
+ try {
+ engine.getTaskService().setOwner(taskId, authUser);
+ task = FlowableRuntimeUtils.createTaskQuery(engine, true).taskId(taskId).singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While reading task " + taskId, e);
+ }
+
+ return getFormTO(task, checked.getRight());
+ }
+
+ private Map<String, String> getPropertiesForSubmit(final UserRequestForm form) {
+ Map<String, String> props = new HashMap<>();
+ form.getProperties().stream().
+ filter(UserRequestFormProperty::isWritable).
+ forEach(prop -> {
+ props.put(prop.getId(), prop.getValue());
+ });
+ return Collections.unmodifiableMap(props);
+ }
+
+ @Override
+ public WorkflowResult<UserPatch> submitForm(final UserRequestForm form) {
+ String authUser = AuthContextUtils.getUsername();
+ Pair<Task, TaskFormData> checked = checkTask(form.getTaskId(), authUser);
+
+ if (!checked.getLeft().getOwner().equals(authUser)) {
+ throw new WorkflowException(new IllegalArgumentException("Task " + form.getTaskId() + " assigned to "
+ + checked.getLeft().getOwner() + " but submitted by " + authUser));
+ }
+
+ String procInstID = checked.getLeft().getProcessInstanceId();
+
+ User user = userDAO.find(getUserKey(procInstID));
+ if (user == null) {
+ throw new NotFoundException("User with key " + getUserKey(procInstID));
+ }
+
+ Set<String> preTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.TASK, "submit");
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.FORM_SUBMITTER, authUser);
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.USER, lazyLoad(user));
+ try {
+ engine.getFormService().submitTaskFormData(form.getTaskId(), getPropertiesForSubmit(form));
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(e, "While submitting form for task " + form.getTaskId());
+ }
+ Set<String> postTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+ postTasks.removeAll(preTasks);
+ postTasks.add(form.getTaskId());
+ if (procInstID.equals(FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey()))) {
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ }
+
+ user = userDAO.save(user);
+
+ UserPatch userPatch = null;
+ String clearPassword = null;
+ PropagationByResource propByRes = null;
+
+ ProcessInstance afterSubmitPI = engine.getRuntimeService().
+ createProcessInstanceQuery().processInstanceId(procInstID).singleResult();
+ if (afterSubmitPI != null) {
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.FORM_SUBMITTER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_TO);
+
+ // see if there is any propagation to be done
+ propByRes = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE);
+
+ // fetch - if available - the encrypted password
+ String encryptedPwd = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD, String.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD);
+ if (StringUtils.isNotBlank(encryptedPwd)) {
+ clearPassword = FlowableRuntimeUtils.decrypt(encryptedPwd);
+ }
+
+ Boolean enabled = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.ENABLED, Boolean.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.ENABLED);
+
+ // supports approval chains
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ user,
+ dataBinder.getUserTO(user, true),
+ clearPassword,
+ enabled,
+ propByRes);
+
+ userPatch = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ }
+ if (userPatch == null) {
+ userPatch = new UserPatch();
+ userPatch.setKey(user.getKey());
+ userPatch.setPassword(new PasswordPatch.Builder().onSyncope(true).value(clearPassword).build());
+
+ if (propByRes != null) {
+ userPatch.getPassword().getResources().addAll(propByRes.get(ResourceOperation.CREATE));
+ }
+ }
+
+ return new WorkflowResult<>(userPatch, propByRes, postTasks);
+ }
+}
[18/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 fa9353d..6f2d6a0 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/systemadministration.adoc
@@ -66,8 +66,6 @@ include::configureconnidlocations.adoc[]
include::importexport.adoc[]
-include::flowablemodeler.adoc[]
-
include::connectorbundles.adoc[]
include::emailconfiguration.adoc[]
[14/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java
deleted file mode 100644
index 804d75c..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowDefinitionTO.java
+++ /dev/null
@@ -1,71 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-@XmlRootElement(name = "workflowDefinition")
-@XmlType
-public class WorkflowDefinitionTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -7044543391316529128L;
-
- private String key;
-
- private String modelId;
-
- private String name;
-
- private boolean main;
-
- public String getKey() {
- return key;
- }
-
- public void setKey(final String key) {
- this.key = key;
- }
-
- public String getModelId() {
- return modelId;
- }
-
- public void setModelId(final String modelId) {
- this.modelId = modelId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public boolean isMain() {
- return main;
- }
-
- public void setMain(final boolean main) {
- this.main = main;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java
deleted file mode 100644
index 59bfc1e..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormPropertyTO.java
+++ /dev/null
@@ -1,124 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
-import org.apache.syncope.common.lib.types.WorkflowFormPropertyType;
-
-@XmlRootElement(name = "workflowFormProperty")
-@XmlType
-public class WorkflowFormPropertyTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = 9139969592634304261L;
-
- private String id;
-
- private String name;
-
- private WorkflowFormPropertyType type;
-
- private String value;
-
- private boolean readable;
-
- private boolean writable;
-
- private boolean required;
-
- private String datePattern;
-
- @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
- private final Map<String, String> enumValues = new HashMap<>();
-
- public String getId() {
- return id;
- }
-
- public void setId(final String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public boolean isReadable() {
- return readable;
- }
-
- public void setReadable(final boolean readable) {
- this.readable = readable;
- }
-
- public boolean isRequired() {
- return required;
- }
-
- public void setRequired(final boolean required) {
- this.required = required;
- }
-
- public WorkflowFormPropertyType getType() {
- return type;
- }
-
- public void setType(final WorkflowFormPropertyType type) {
- this.type = type;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(final String value) {
- this.value = value;
- }
-
- public boolean isWritable() {
- return writable;
- }
-
- public void setWritable(final boolean writable) {
- this.writable = writable;
- }
-
- public String getDatePattern() {
- return datePattern;
- }
-
- public void setDatePattern(final String datePattern) {
- this.datePattern = datePattern;
- }
-
- @JsonProperty
- public Map<String, String> getEnumValues() {
- return enumValues;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java
deleted file mode 100644
index 2f99b65..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowFormTO.java
+++ /dev/null
@@ -1,147 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-import org.apache.syncope.common.lib.patch.UserPatch;
-
-@XmlRootElement(name = "workflowForm")
-@XmlType
-public class WorkflowFormTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -7044543391316529128L;
-
- private String username;
-
- private String taskId;
-
- private String key;
-
- private Date createTime;
-
- private Date dueDate;
-
- private String owner;
-
- private UserTO userTO;
-
- private UserPatch userPatch;
-
- private final List<WorkflowFormPropertyTO> properties = new ArrayList<>();
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(final String username) {
- this.username = username;
- }
-
- public String getTaskId() {
- return taskId;
- }
-
- public void setTaskId(final String taskId) {
- this.taskId = taskId;
- }
-
- public String getKey() {
- return key;
- }
-
- public void setKey(final String key) {
- this.key = key;
- }
-
- public Date getCreateTime() {
- if (createTime != null) {
- return new Date(createTime.getTime());
- }
- return null;
- }
-
- public void setCreateTime(final Date createTime) {
- if (createTime != null) {
- this.createTime = new Date(createTime.getTime());
- } else {
- this.createTime = null;
- }
- }
-
- public Date getDueDate() {
- if (dueDate != null) {
- return new Date(dueDate.getTime());
- }
- return null;
- }
-
- public void setDueDate(final Date dueDate) {
- if (dueDate != null) {
- this.dueDate = new Date(dueDate.getTime());
- } else {
- this.dueDate = null;
- }
- }
-
- public String getOwner() {
- return owner;
- }
-
- public void setOwner(final String owner) {
- this.owner = owner;
- }
-
- public UserTO getUserTO() {
- return userTO;
- }
-
- public void setUserTO(final UserTO userTO) {
- this.userTO = userTO;
- }
-
- public UserPatch getUserPatch() {
- return userPatch;
- }
-
- public void setUserPatch(final UserPatch userPatch) {
- this.userPatch = userPatch;
- }
-
- @JsonIgnore
- public Optional<WorkflowFormPropertyTO> getProperty(final String id) {
- return properties.stream().filter(property -> id.equals(property.getId())).findFirst();
- }
-
- @XmlElementWrapper(name = "workflowFormProperties")
- @XmlElement(name = "workflowFormProperty")
- @JsonProperty("workflowFormProperties")
- public List<WorkflowFormPropertyTO> getProperties() {
- return properties;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java
deleted file mode 100644
index d2834c8..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/WorkflowTaskTO.java
+++ /dev/null
@@ -1,40 +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.
- */
-package org.apache.syncope.common.lib.to;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-@XmlRootElement(name = "workflowTask")
-@XmlType
-public class WorkflowTaskTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -3095016727396210808L;
-
- private String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
index 0968f34..69f417a 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/StandardEntitlement.java
@@ -202,24 +202,6 @@ public final class StandardEntitlement {
public static final String POLICY_DELETE = "POLICY_DELETE";
- public static final String WORKFLOW_DEF_LIST = "WORKFLOW_DEF_LIST";
-
- public static final String WORKFLOW_DEF_GET = "WORKFLOW_DEF_GET";
-
- public static final String WORKFLOW_DEF_SET = "WORKFLOW_DEF_SET";
-
- public static final String WORKFLOW_DEF_DELETE = "WORKFLOW_DEF_DELETE";
-
- public static final String WORKFLOW_TASK_LIST = "WORKFLOW_TASK_LIST";
-
- public static final String WORKFLOW_FORM_LIST = "WORKFLOW_FORM_LIST";
-
- public static final String WORKFLOW_FORM_READ = "WORKFLOW_FORM_READ";
-
- public static final String WORKFLOW_FORM_CLAIM = "WORKFLOW_FORM_CLAIM";
-
- public static final String WORKFLOW_FORM_SUBMIT = "WORKFLOW_FORM_SUBMIT";
-
public static final String MAIL_TEMPLATE_LIST = "MAIL_TEMPLATE_LIST";
public static final String MAIL_TEMPLATE_CREATE = "MAIL_TEMPLATE_CREATE";
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java
deleted file mode 100644
index ec2db4a..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowFormPropertyType.java
+++ /dev/null
@@ -1,32 +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.
- */
-package org.apache.syncope.common.lib.types;
-
-import javax.xml.bind.annotation.XmlEnum;
-
-@XmlEnum
-public enum WorkflowFormPropertyType {
-
- String,
- Long,
- Enum,
- Date,
- Boolean
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
deleted file mode 100644
index d23b1bc..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
+++ /dev/null
@@ -1,47 +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.
- */
-package org.apache.syncope.common.lib.types;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class WorkflowTasks {
-
- private List<String> tasks;
-
- public WorkflowTasks() {
- this.tasks = new ArrayList<>();
- }
-
- public WorkflowTasks(final Collection<String> tasks) {
- this();
- this.tasks.addAll(tasks);
- }
-
- public List<String> getTasks() {
- return tasks;
- }
-
- public void setTasks(final List<String> tasks) {
- this.tasks = tasks;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
----------------------------------------------------------------------
diff --git a/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java b/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
index bf2ab85..375faf7 100644
--- a/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
+++ b/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
@@ -26,6 +26,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.StringWriter;
import java.util.UUID;
+import org.apache.syncope.common.lib.patch.GroupPatch;
import org.apache.syncope.common.lib.patch.PasswordPatch;
import org.apache.syncope.common.lib.patch.StringPatchItem;
import org.apache.syncope.common.lib.patch.StringReplacePatchItem;
@@ -35,7 +36,6 @@ import org.apache.syncope.common.lib.to.ConnObjectTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.PropagationStatus;
import org.apache.syncope.common.lib.to.ProvisioningResult;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
import org.apache.syncope.common.lib.types.PatchOperation;
import org.junit.jupiter.api.Test;
@@ -43,16 +43,16 @@ public class JSONTest {
@Test
public void map() throws IOException {
- WorkflowFormPropertyTO prop = new WorkflowFormPropertyTO();
- prop.getEnumValues().put("key1", "value1");
- prop.getEnumValues().put("key2", "value2");
+ GroupPatch prop = new GroupPatch();
+ prop.getADynMembershipConds().put("key1", "value1");
+ prop.getADynMembershipConds().put("key2", "value2");
ObjectMapper mapper = new ObjectMapper();
StringWriter writer = new StringWriter();
mapper.writeValue(writer, prop);
- WorkflowFormPropertyTO unserializedProp = mapper.readValue(writer.toString(), WorkflowFormPropertyTO.class);
+ GroupPatch unserializedProp = mapper.readValue(writer.toString(), GroupPatch.class);
assertEquals(prop, unserializedProp);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java
deleted file mode 100644
index c3454bf..0000000
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/WorkflowFormQuery.java
+++ /dev/null
@@ -1,32 +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.
- */
-package org.apache.syncope.common.rest.api.beans;
-
-public class WorkflowFormQuery extends AbstractQuery {
-
- private static final long serialVersionUID = -4762457303770028554L;
-
- public static class Builder extends AbstractQuery.Builder<WorkflowFormQuery, Builder> {
-
- @Override
- protected WorkflowFormQuery newInstance() {
- return new WorkflowFormQuery();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
index eb3f9aa..a7300d7 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.rest.api.service;
+import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.headers.Header;
@@ -134,6 +135,7 @@ public interface AnyService<TO extends AnyTO> extends JAXRSService {
* @param schemaType schema type
* @param schema schema
*/
+ @Operation(operationId = "deleteAttr")
@ApiResponses(
@ApiResponse(responseCode = "204", description = "Operation was successful"))
@DELETE
@@ -150,6 +152,7 @@ public interface AnyService<TO extends AnyTO> extends JAXRSService {
* @param key any object key or name
* @return Response object featuring the deleted any object enriched with propagation status information
*/
+ @Operation(operationId = "deleteAny")
@Parameter(name = RESTHeaders.PREFER, in = ParameterIn.HEADER,
description = "Allows client to specify a preference for the result to be returned from the server",
allowEmptyValue = true, schema =
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
index 3eb45a4..fc0829a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
@@ -44,7 +44,7 @@ import org.apache.syncope.common.lib.to.SecurityQuestionTO;
import org.apache.syncope.common.rest.api.RESTHeaders;
/**
- * REST operations for configuration.
+ * REST operations for security questions.
*/
@Tag(name = "SecurityQuestions")
@SecurityRequirements({
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
deleted file mode 100644
index c38746f..0000000
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
+++ /dev/null
@@ -1,118 +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.
- */
-package org.apache.syncope.common.rest.api.service;
-
-import io.swagger.v3.oas.annotations.security.SecurityRequirement;
-import io.swagger.v3.oas.annotations.security.SecurityRequirements;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import java.util.List;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.BeanParam;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-
-/**
- * REST operations related to user workflow.
- */
-@Tag(name = "UserWorkflow")
-@SecurityRequirements({
- @SecurityRequirement(name = "BasicAuthentication"),
- @SecurityRequirement(name = "Bearer") })
-@Path("userworkflow")
-public interface UserWorkflowService extends JAXRSService {
-
- /**
- * Returns a list of all available workflow forms.
- *
- * @param query query conditions
- * @return list of all available workflow forms
- */
- @GET
- @Path("forms")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- PagedResult<WorkflowFormTO> getForms(@BeanParam WorkflowFormQuery query);
-
- /**
- * Returns a list of available forms for the given user key.
- *
- * @param userKey user key
- * @return list of available forms for the given user key
- */
- @GET
- @Path("forms/{userKey}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- WorkflowFormTO getFormForUser(@NotNull @PathParam("userKey") String userKey);
-
- /**
- * Claims the form for the given task id.
- *
- * @param taskId workflow task id
- * @return the workflow form for the given task id
- */
- @POST
- @Path("forms/{taskId}/claim")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- WorkflowFormTO claimForm(@NotNull @PathParam("taskId") String taskId);
-
- /**
- * Submits a workflow form.
- *
- * @param form workflow form.
- * @return updated user
- */
- @POST
- @Path("forms")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- UserTO submitForm(@NotNull WorkflowFormTO form);
-
- /**
- * Returns a list of available tasks for the given user key.
- *
- * @param userKey user key
- * @return list of available tasks for the given user key
- */
- @GET
- @Path("tasks/{userKey}")
- List<WorkflowTaskTO> getAvailableTasks(@NotNull @PathParam("userKey") String userKey);
-
- /**
- * Executes workflow task for matching id.
- *
- * @param taskId workflow task id
- * @param userTO argument to be passed to workflow task
- * @return updated user
- */
- @POST
- @Path("tasks/{taskId}/execute")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- UserTO executeTask(@NotNull @PathParam("taskId") String taskId, @NotNull UserTO userTO);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
deleted file mode 100644
index 25e3f7a..0000000
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
+++ /dev/null
@@ -1,121 +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.
- */
-package org.apache.syncope.common.rest.api.service;
-
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.security.SecurityRequirement;
-import io.swagger.v3.oas.annotations.security.SecurityRequirements;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import java.util.List;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-
-/**
- * REST operations for workflow definition.
- */
-@Tag(name = "Workflow")
-@SecurityRequirements({
- @SecurityRequirement(name = "BasicAuthentication"),
- @SecurityRequirement(name = "Bearer") })
-@Path("workflows")
-public interface WorkflowService extends JAXRSService {
-
- /**
- * Lists the available workflow definitions, for the given any object type.
- *
- * @param anyType any object type
- * @return available workflow definitions, for the given any object type
- */
- @GET
- @Path("{anyType}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- List<WorkflowDefinitionTO> list(@NotNull @PathParam("anyType") String anyType);
-
- /**
- * Exports the workflow definition for matching any object type and key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- * @return workflow definition for matching any object type and key
- */
- @GET
- @Path("{anyType}/{key}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- Response get(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key);
-
- /**
- * Exports the workflow diagram representation (if available), for matching any object type and key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- * @return workflow diagram representation
- */
- @GET
- @Path("{anyType}/{key}/diagram.png")
- @Produces({ RESTHeaders.MEDIATYPE_IMAGE_PNG })
- Response exportDiagram(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key);
-
- /**
- * Imports the workflow definition for matching any object type, under the provided key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- * @param definition workflow definition for matching kind
- */
- @ApiResponses(
- @ApiResponse(responseCode = "204", description = "Operation was successful"))
- @PUT
- @Path("{anyType}/{key}")
- @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- void set(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key,
- @NotNull String definition);
-
- /**
- * Removes the workflow definition for matching any object type, under the provided key.
- *
- * @param anyType any object type
- * @param key workflow definition key
- */
- @ApiResponses(
- @ApiResponse(responseCode = "204", description = "Operation was successful"))
- @DELETE
- @Path("{anyType}/{key}")
- @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
- void delete(
- @NotNull @PathParam("anyType") String anyType,
- @NotNull @PathParam("key") String key);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
index 46285f2..9377628 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/SecurityQuestionLogic.java
@@ -60,7 +60,7 @@ public class SecurityQuestionLogic extends AbstractTransactionalLogic<SecurityQu
if (securityQuestion == null) {
LOG.error("Could not find security question '" + key + "'");
- throw new NotFoundException(String.valueOf(key));
+ throw new NotFoundException(key);
}
return binder.getSecurityQuestionTO(securityQuestion);
@@ -77,7 +77,7 @@ public class SecurityQuestionLogic extends AbstractTransactionalLogic<SecurityQu
if (securityQuestion == null) {
LOG.error("Could not find security question '" + securityQuestionTO.getKey() + "'");
- throw new NotFoundException(String.valueOf(securityQuestionTO.getKey()));
+ throw new NotFoundException(securityQuestionTO.getKey());
}
binder.update(securityQuestion, securityQuestionTO);
@@ -92,7 +92,7 @@ public class SecurityQuestionLogic extends AbstractTransactionalLogic<SecurityQu
if (securityQuestion == null) {
LOG.error("Could not find security question '" + key + "'");
- throw new NotFoundException(String.valueOf(key));
+ throw new NotFoundException(key);
}
SecurityQuestionTO deleted = binder.getSecurityQuestionTO(securityQuestion);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java
deleted file mode 100644
index 8023c25..0000000
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowLogic.java
+++ /dev/null
@@ -1,137 +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.
- */
-package org.apache.syncope.core.logic;
-
-import java.lang.reflect.Method;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.patch.AnyPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.PropagationTaskTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.propagation.PropagationManager;
-import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
-import org.apache.syncope.core.workflow.api.UserWorkflowAdapter;
-import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-@Component
-public class UserWorkflowLogic extends AbstractTransactionalLogic<WorkflowFormTO> {
-
- @Autowired
- private UserWorkflowAdapter uwfAdapter;
-
- @Autowired
- private PropagationManager propagationManager;
-
- @Autowired
- private PropagationTaskExecutor taskExecutor;
-
- @Autowired
- private UserDataBinder binder;
-
- @Autowired
- private UserDAO userDAO;
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_CLAIM + "')")
- public WorkflowFormTO claimForm(final String taskId) {
- return uwfAdapter.claimForm(taskId);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.USER_UPDATE + "')")
- public UserTO executeWorkflowTask(final UserTO userTO, final String taskId) {
- WorkflowResult<String> updated = uwfAdapter.execute(userTO, taskId);
-
- UserPatch userPatch = new UserPatch();
- userPatch.setKey(userTO.getKey());
-
- List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
- new WorkflowResult<>(
- Pair.<UserPatch, Boolean>of(userPatch, null),
- updated.getPropByRes(), updated.getPerformedTasks()));
-
- taskExecutor.execute(tasks, false);
-
- return binder.getUserTO(updated.getResult());
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_READ + "') "
- + "and hasRole('" + StandardEntitlement.USER_READ + "')")
- @Transactional(readOnly = true)
- public WorkflowFormTO getFormForUser(final String key) {
- User user = userDAO.authFind(key);
- return uwfAdapter.getForm(user.getWorkflowId());
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_LIST + "')")
- @Transactional(readOnly = true)
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page,
- final int size,
- final List<OrderByClause> orderByClauses) {
-
- return uwfAdapter.getForms(page, size, orderByClauses);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_TASK_LIST + "') "
- + "and hasRole('" + StandardEntitlement.USER_READ + "')")
- public List<WorkflowTaskTO> getAvailableTasks(final String key) {
- User user = userDAO.authFind(key);
- return uwfAdapter.getAvailableTasks(user.getWorkflowId());
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_FORM_SUBMIT + "')")
- public UserTO submitForm(final WorkflowFormTO form) {
- WorkflowResult<? extends AnyPatch> updated = uwfAdapter.submitForm(form);
-
- // propByRes can be made empty by the workflow definition if no propagation should occur
- // (for example, with rejected users)
- if (updated.getResult() instanceof UserPatch
- && updated.getPropByRes() != null && !updated.getPropByRes().isEmpty()) {
-
- List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
- new WorkflowResult<>(
- Pair.of((UserPatch) updated.getResult(), Boolean.TRUE),
- updated.getPropByRes(),
- updated.getPerformedTasks()));
-
- taskExecutor.execute(tasks, false);
- }
-
- return binder.getUserTO(updated.getResult().getKey());
- }
-
- @Override
- protected WorkflowFormTO resolveReference(final Method method, final Object... args)
- throws UnresolvedReferenceException {
-
- throw new UnresolvedReferenceException();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java
deleted file mode 100644
index 4f3e512..0000000
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/WorkflowLogic.java
+++ /dev/null
@@ -1,113 +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.
- */
-package org.apache.syncope.core.logic;
-
-import java.io.OutputStream;
-import java.lang.reflect.Method;
-import java.util.List;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
-import org.apache.syncope.core.persistence.api.dao.NotFoundException;
-import org.apache.syncope.core.persistence.api.entity.AnyType;
-import org.apache.syncope.core.workflow.api.AnyObjectWorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.GroupWorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.UserWorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionAdapter;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-@Component
-public class WorkflowLogic extends AbstractTransactionalLogic<WorkflowDefinitionTO> {
-
- @Autowired
- private AnyTypeDAO anyTypeDAO;
-
- @Autowired
- private AnyObjectWorkflowDefinitionAdapter awfAdapter;
-
- @Autowired
- private UserWorkflowDefinitionAdapter uwfAdapter;
-
- @Autowired
- private GroupWorkflowDefinitionAdapter gwfAdapter;
-
- private WorkflowDefinitionAdapter getAdapter(final String anyTypeKey) {
- AnyType anyType = anyTypeDAO.find(anyTypeKey);
- if (anyType == null) {
- LOG.error("Could not find anyType '" + anyTypeKey + "'");
- throw new NotFoundException(anyTypeKey);
- }
-
- switch (anyType.getKind()) {
- case ANY_OBJECT:
- return awfAdapter;
-
- case GROUP:
- return gwfAdapter;
-
- case USER:
- default:
- return uwfAdapter;
- }
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_LIST + "')")
- @Transactional(readOnly = true)
- public List<WorkflowDefinitionTO> list(final String anyType) {
- return getAdapter(anyType).getDefinitions();
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_GET + "')")
- @Transactional(readOnly = true)
- public void exportDefinition(
- final String anyType, final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
-
- getAdapter(anyType).exportDefinition(key, format, os);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_GET + "')")
- @Transactional(readOnly = true)
- public void exportDiagram(final String anyType, final String key, final OutputStream os) {
- getAdapter(anyType).exportDiagram(key, os);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_GET + "')")
- public void importDefinition(
- final String anyType, final String key, final WorkflowDefinitionFormat format, final String definition) {
-
- getAdapter(anyType).importDefinition(key, format, definition);
- }
-
- @PreAuthorize("hasRole('" + StandardEntitlement.WORKFLOW_DEF_DELETE + "')")
- public void delete(final String anyType, final String key) {
- getAdapter(anyType).deleteDefinition(key);
- }
-
- @Override
- protected WorkflowDefinitionTO resolveReference(final Method method, final Object... args)
- throws UnresolvedReferenceException {
-
- throw new UnresolvedReferenceException();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
index 042a799..1408585 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
@@ -39,8 +39,6 @@ public interface AnyDAO<A extends Any<?>> extends DAO<A> {
A find(String key);
- A findByWorkflowId(String workflowId);
-
List<A> findByPlainAttrValue(String schemaName, PlainAttrValue attrValue, boolean ignoreCaseMatch);
A findByPlainAttrUniqueValue(String schemaName, PlainAttrValue attrUniqueValue, boolean ignoreCaseMatch);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
index 0ec609e..a9ec46a 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
@@ -36,10 +36,6 @@ public interface Any<P extends PlainAttr<?>> extends AnnotatedEntity {
void setStatus(String status);
- String getWorkflowId();
-
- void setWorkflowId(String workflowId);
-
boolean add(P attr);
boolean remove(P attr);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 90805da..30601d9 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
@@ -91,13 +91,4 @@ public interface User extends
boolean add(Role role);
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/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
index 180c395..567a6fc 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
@@ -29,7 +29,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
-import javax.persistence.NoResultException;
import javax.persistence.Query;
import javax.persistence.TemporalType;
import org.apache.commons.jexl3.parser.Parser;
@@ -177,23 +176,6 @@ public abstract class AbstractAnyDAO<A extends Any<?>> extends AbstractDAO<A> im
return (A) entityManager().find(anyUtils().anyClass(), key);
}
- @SuppressWarnings("unchecked")
- @Override
- public A findByWorkflowId(final String workflowId) {
- Query query = entityManager().createQuery("SELECT e FROM " + anyUtils().anyClass().getSimpleName()
- + " e WHERE e.workflowId = :workflowId", User.class);
- query.setParameter("workflowId", workflowId);
-
- A result = null;
- try {
- result = (A) query.getSingleResult();
- } catch (NoResultException e) {
- LOG.debug("No user found with workflow id {}", workflowId, e);
- }
-
- return result;
- }
-
private Query findByPlainAttrValueQuery(final String entityName, final boolean ignoreCaseMatch) {
String query = "SELECT e FROM " + entityName + " e"
+ " WHERE e.attribute.schema.id = :schemaKey AND (e.stringValue IS NOT NULL"
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
index 64550a7..4d8aaea 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
@@ -264,8 +264,8 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
});
entityManager().remove(anyObject);
- publisher.publishEvent(
- new AnyDeletedEvent(this, AnyTypeKind.ANY_OBJECT, anyObject.getKey(), AuthContextUtils.getDomain()));
+ publisher.publishEvent(new AnyDeletedEvent(
+ this, AnyTypeKind.ANY_OBJECT, anyObject.getKey(), anyObject.getName(), AuthContextUtils.getDomain()));
}
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
index f565358..cdb25918 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
@@ -380,8 +380,8 @@ public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {
clearADynMembers(group);
entityManager().remove(group);
- publisher.publishEvent(
- new AnyDeletedEvent(this, AnyTypeKind.GROUP, group.getKey(), AuthContextUtils.getDomain()));
+ publisher.publishEvent(new AnyDeletedEvent(
+ this, AnyTypeKind.GROUP, group.getKey(), group.getName(), AuthContextUtils.getDomain()));
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
index c9b18ec..f105da5 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPASecurityQuestionDAO.java
@@ -23,8 +23,7 @@ import javax.persistence.TypedQuery;
import org.apache.syncope.core.persistence.api.dao.SecurityQuestionDAO;
import org.apache.syncope.core.persistence.api.dao.UserDAO;
import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.persistence.jpa.entity.JPASecurityQuestion;
+import org.apache.syncope.core.persistence.jpa.entity.user.JPASecurityQuestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@@ -41,7 +40,7 @@ public class JPASecurityQuestionDAO extends AbstractDAO<SecurityQuestion> implem
@Override
public List<SecurityQuestion> findAll() {
- final TypedQuery<SecurityQuestion> query = entityManager().createQuery(
+ TypedQuery<SecurityQuestion> query = entityManager().createQuery(
"SELECT e FROM " + JPASecurityQuestion.class.getSimpleName() + " e ", SecurityQuestion.class);
return query.getResultList();
}
@@ -58,13 +57,12 @@ public class JPASecurityQuestionDAO extends AbstractDAO<SecurityQuestion> implem
return;
}
- for (User user : userDAO.findBySecurityQuestion(securityQuestion)) {
+ userDAO.findBySecurityQuestion(securityQuestion).forEach(user -> {
user.setSecurityQuestion(null);
user.setSecurityAnswer(null);
userDAO.save(user);
- }
+ });
entityManager().remove(securityQuestion);
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
index b85147f..adc36f5 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
@@ -429,8 +429,8 @@ public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO {
}
entityManager().remove(user);
- publisher.publishEvent(
- new AnyDeletedEvent(this, AnyTypeKind.USER, user.getKey(), AuthContextUtils.getDomain()));
+ publisher.publishEvent(new AnyDeletedEvent(
+ this, AnyTypeKind.USER, user.getKey(), user.getUsername(), AuthContextUtils.getDomain()));
}
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
index e77fb7d..86e2dd5 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
@@ -36,8 +36,6 @@ public abstract class AbstractAny<P extends PlainAttr<?>> extends AbstractAnnota
@ManyToOne(fetch = FetchType.EAGER, optional = false)
private JPARealm realm;
- private String workflowId;
-
@Column(nullable = true)
private String status;
@@ -53,16 +51,6 @@ public abstract class AbstractAny<P extends PlainAttr<?>> extends AbstractAnnota
}
@Override
- public String getWorkflowId() {
- return workflowId;
- }
-
- @Override
- public void setWorkflowId(final String workflowId) {
- this.workflowId = workflowId;
- }
-
- @Override
public String getStatus() {
return status;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
index 1fa7787..96a333a 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.core.persistence.jpa.entity;
+import org.apache.syncope.core.persistence.jpa.entity.user.JPASecurityQuestion;
import org.apache.syncope.core.persistence.api.entity.AccessToken;
import org.apache.syncope.core.persistence.jpa.entity.policy.JPAPasswordPolicy;
import org.apache.syncope.core.persistence.jpa.entity.policy.JPAPullPolicy;
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java
deleted file mode 100644
index ab6e9d5..0000000
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASecurityQuestion.java
+++ /dev/null
@@ -1,47 +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.
- */
-package org.apache.syncope.core.persistence.jpa.entity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
-
-@Entity
-@Table(name = JPASecurityQuestion.TABLE)
-public class JPASecurityQuestion extends AbstractGeneratedKeyEntity implements SecurityQuestion {
-
- private static final long serialVersionUID = 7675321820453579744L;
-
- public static final String TABLE = "SecurityQuestion";
-
- @Column(unique = true)
- private String content;
-
- @Override
- public String getContent() {
- return content;
- }
-
- @Override
- public void setContent(final String content) {
- this.content = content;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
index b84330b..b4be360 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
@@ -95,16 +95,6 @@ public class JPAConf extends AbstractProvidedKeyEntity implements Conf {
}
@Override
- public String getWorkflowId() {
- return null;
- }
-
- @Override
- public void setWorkflowId(final String workflowId) {
- // nothing to do
- }
-
- @Override
public String getStatus() {
return null;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java
new file mode 100644
index 0000000..d82f7ed
--- /dev/null
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPASecurityQuestion.java
@@ -0,0 +1,48 @@
+/*
+ * 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.persistence.jpa.entity.user;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
+import org.apache.syncope.core.persistence.jpa.entity.AbstractGeneratedKeyEntity;
+
+@Entity
+@Table(name = JPASecurityQuestion.TABLE)
+public class JPASecurityQuestion extends AbstractGeneratedKeyEntity implements SecurityQuestion {
+
+ private static final long serialVersionUID = 7675321820453579744L;
+
+ public static final String TABLE = "SecurityQuestion";
+
+ @Column(unique = true)
+ private String content;
+
+ @Override
+ public String getContent() {
+ return content;
+ }
+
+ @Override
+ public void setContent(final String content) {
+ this.content = content;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 4686aa6..4ede8b7 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
@@ -49,7 +49,6 @@ import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
import org.apache.syncope.core.persistence.api.entity.user.UPlainAttr;
import org.apache.syncope.core.persistence.api.entity.user.User;
import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
-import org.apache.syncope.core.persistence.jpa.entity.JPASecurityQuestion;
import org.apache.syncope.core.spring.security.Encryptor;
import org.apache.syncope.core.spring.security.SecureRandomUtils;
import org.apache.syncope.core.spring.ApplicationContextProvider;
@@ -96,8 +95,6 @@ public class JPAUser
@Valid
private List<JPAUPlainAttr> plainAttrs = new ArrayList<>();
- private String workflowId;
-
@Column(nullable = true)
private String status;
@@ -144,13 +141,6 @@ public class JPAUser
@Temporal(TemporalType.TIMESTAMP)
private Date changePwdDate;
- @Column(nullable = true)
- private String lastRecertificator;
-
- @Column(nullable = true)
- @Temporal(TemporalType.TIMESTAMP)
- private Date lastRecertification;
-
private Boolean suspended = false;
private Boolean mustChangePassword = false;
@@ -282,16 +272,6 @@ public class JPAUser
}
@Override
- public String getWorkflowId() {
- return workflowId;
- }
-
- @Override
- public void setWorkflowId(final String workflowId) {
- this.workflowId = workflowId;
- }
-
- @Override
public String getStatus() {
return status;
}
@@ -386,31 +366,6 @@ public class JPAUser
}
@Override
- public String getLastRecertificator() {
- return lastRecertificator;
- }
-
- @Override
- public void setLastRecertificator(final String lastRecertificator) {
- this.lastRecertificator = lastRecertificator;
- }
-
- @Override
- public Date getLastRecertification() {
- if (lastRecertification != null) {
- return new Date(lastRecertification.getTime());
- }
- return null;
- }
-
- @Override
- public void setLastRecertification(final Date lastRecertification) {
- this.lastRecertification = lastRecertification == null
- ? null
- : new Date(lastRecertification.getTime());
- }
-
- @Override
public String getUsername() {
return username;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
index b4a598f..a40aa8a 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/spring/MultiJarAwarePersistenceUnitPostProcessor.java
@@ -22,7 +22,6 @@ import javax.persistence.Entity;
import org.apache.syncope.core.persistence.jpa.entity.AbstractEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo;
@@ -40,10 +39,9 @@ public class MultiJarAwarePersistenceUnitPostProcessor implements PersistenceUni
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.addIncludeFilter(new AnnotationTypeFilter(Entity.class));
- for (BeanDefinition bd : scanner.findCandidateComponents(AbstractEntity.class.getPackage().getName())) {
+ scanner.findCandidateComponents(AbstractEntity.class.getPackage().getName()).forEach(bd -> {
LOG.debug("Adding JPA entity {}", bd.getBeanClassName());
pui.addManagedClassName(bd.getBeanClassName());
- }
+ });
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 123e500..fd66eb6 100644
--- a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
@@ -126,15 +126,6 @@ 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"/>
-
<!-- JWT lifetime in minutes -->
<SyncopeSchema id="jwt.lifetime.minutes"/>
<PlainSchema id="jwt.lifetime.minutes" type="Long"
@@ -185,10 +176,6 @@ under the License.
<Implementation id="PushJobDelegate" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.pushpull.PushJobDelegate"/>
- <Implementation id="IdentityRecertification" type="TASKJOB_DELEGATE" engine="JAVA"
- body="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
- <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task" active="1"
- jobDelegate_id="IdentityRecertification"/>
<Implementation id="ExpiredAccessTokenCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup"/>
@@ -196,7 +183,7 @@ under the License.
jobDelegate_id="ExpiredAccessTokenCleanup" cronExpression="0 0/5 * * * ?"/>
<Implementation id="ExpiredBatchCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredBatchCleanup"/>
- <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Access Token Cleanup Task" active="1"
+ <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Expired Batch Operations Cleanup Task" active="1"
jobDelegate_id="ExpiredBatchCleanup" cronExpression="0 0/5 * * * ?"/>
<!-- Password reset notifications -->
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
index f505fbe..2f29e17 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ImplementationTest.java
@@ -43,7 +43,7 @@ public class ImplementationTest extends AbstractTest {
List<Implementation> implementations = implementationDAO.findAll();
assertFalse(implementations.isEmpty());
- assertEquals(19, implementations.size());
+ assertEquals(18, implementations.size());
implementations = implementationDAO.find(ImplementationType.PULL_ACTIONS);
assertEquals(1, implementations.size());
@@ -52,7 +52,7 @@ public class ImplementationTest extends AbstractTest {
assertEquals(1, implementations.size());
implementations = implementationDAO.find(ImplementationType.TASKJOB_DELEGATE);
- assertEquals(6, implementations.size());
+ assertEquals(5, implementations.size());
implementations = implementationDAO.find(ImplementationType.REPORTLET);
assertEquals(2, implementations.size());
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
index caabb79..8197a55 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/MultitenancyTest.java
@@ -76,7 +76,7 @@ public class MultitenancyTest extends AbstractTest {
@Test
public void readPlainSchemas() {
- assertEquals(13, plainSchemaDAO.findAll().size());
+ assertEquals(12, plainSchemaDAO.findAll().size());
}
@Test
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 94fbf40..ff46d62 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
@@ -53,7 +53,7 @@ public class PlainSchemaTest extends AbstractTest {
@Test
public void findAll() {
List<PlainSchema> schemas = plainSchemaDAO.findAll();
- assertEquals(42, schemas.size());
+ assertEquals(41, schemas.size());
}
@Test
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 a912d42..803984e 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(4, taskDAO.findAll(TaskType.SCHEDULED).size());
+ assertEquals(3, 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/3cabe08a/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 1f0fd44..fb05d94 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -126,15 +126,6 @@ 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"/>
-
<!-- JWT lifetime in minutes -->
<SyncopeSchema id="jwt.lifetime.minutes"/>
<PlainSchema id="jwt.lifetime.minutes" type="Long"
@@ -290,30 +281,30 @@ under the License.
<SyncopeRole_Realm role_id="Connector and Resource for realm evenTwo"
realm_id="0679e069-7355-4b20-bd11-a5a0a5453c7c"/>
- <SyncopeUser mustChangePassword="0" id="1417acbe-cbf6-4277-9372-e75e04f97000" workflowId="4" status="active"
+ <SyncopeUser mustChangePassword="0" id="1417acbe-cbf6-4277-9372-e75e04f97000" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="c5b75db1-fce7-470f-b780-3b9934d82a9d"
username="rossini" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
<SyncopeUser_SyncopeRole user_id="1417acbe-cbf6-4277-9372-e75e04f97000" role_id="Other"/>
- <SyncopeUser mustChangePassword="0" id="74cd8ece-715a-44a4-a736-e17b46c4e7e6" workflowId="6" status="active"
+ <SyncopeUser mustChangePassword="0" id="74cd8ece-715a-44a4-a736-e17b46c4e7e6" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="verdi" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
- <SyncopeUser mustChangePassword="0" id="b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" workflowId="8" status="active"
+ <SyncopeUser mustChangePassword="0" id="b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="vivaldi" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
- <SyncopeUser mustChangePassword="0" id="c9b2dec2-00a7-4855-97c0-d854842b4b24" workflowId="10" status="active"
+ <SyncopeUser mustChangePassword="0" id="c9b2dec2-00a7-4855-97c0-d854842b4b24" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="bellini" creator="admin" lastModifier="admin"
creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
<SyncopeUser_SyncopeRole user_id="c9b2dec2-00a7-4855-97c0-d854842b4b24" role_id="User reviewer"/>
<SyncopeUser_SyncopeRole user_id="c9b2dec2-00a7-4855-97c0-d854842b4b24" role_id="User manager"/>
- <SyncopeUser mustChangePassword="0" id="823074dc-d280-436d-a7dd-07399fae48ec" workflowId="12" status="active"
+ <SyncopeUser mustChangePassword="0" id="823074dc-d280-436d-a7dd-07399fae48ec" status="active"
password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
username="puccini" creator="admin" lastModifier="admin"
@@ -1210,10 +1201,6 @@ under the License.
body="org.apache.syncope.fit.core.reference.TestSampleJobDelegate"/>
<Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec597979" name="SampleJob Task" active="1"
jobDelegate_id="TestSampleJobDelegate" cronExpression="0 0 0 1 * ?"/>
- <Implementation id="IdentityRecertification" type="TASKJOB_DELEGATE" engine="JAVA"
- body="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
- <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task" active="1"
- jobDelegate_id="IdentityRecertification"/>
<Implementation id="ExpiredAccessTokenCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup"/>
<Task DTYPE="SchedTask" id="89de5014-e3f5-4462-84d8-d97575740baf" name="Access Token Cleanup Task" active="1"
@@ -1335,7 +1322,7 @@ under the License.
unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
<Implementation id="ExpiredBatchCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredBatchCleanup"/>
- <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Access Token Cleanup Task" active="1"
+ <Task DTYPE="SchedTask" id="8ea0ea51-ce08-4fe3-a0c8-c281b31b5893" name="Expired Batch Operations Cleanup Task" active="1"
jobDelegate_id="ExpiredBatchCleanup" cronExpression="0 0/5 * * * ?"/>
<MailTemplate id="requestPasswordReset"
@@ -2557,7 +2544,7 @@ $$ }
<Report id="0062ea9c-924d-4ecf-9961-4492a8cc6d1b" name="test" active="1" template_id="sample"/>
<Implementation id="UserReportletConf" type="REPORTLET" engine="JAVA"
- body='{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","workflowId","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}'/>
+ body='{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}'/>
<ReportReportlet report_id="0062ea9c-924d-4ecf-9961-4492a8cc6d1b" implementation_id="UserReportletConf"/>
<ReportExec report_id="0062ea9c-924d-4ecf-9961-4492a8cc6d1b" id="c13f39c5-0d35-4bff-ba79-3cd5de940369"
status="SUCCESS" startDate="2012-02-26 15:40:04" endDate="2012-02-26 15:41:04"/>
[20/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 0e68735..295dacf 100644
--- a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
+++ b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
@@ -32,26 +32,14 @@ under the License.
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
<serviceTask id="create" name="Create" flowable: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' || flowableUtils.isUserIngroup(user, 'groupForWorkflowApproval')}]]>
- </conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW">
- <conditionExpression xsi:type="tFormalExpression">
- <![CDATA[${!flowableUtils.isUserIngroup(user, 'groupForWorkflowApproval')}]]>
- </conditionExpression>
- </sequenceFlow>
- <userTask id="createApproval" name="Create approval"
- flowable:candidateGroups="managingDirector" flowable:formKey="createApproval">
+ <exclusiveGateway id="createGW" default="create2Activate"/>
+ <userTask id="createApproval" name="Create approval" flowable:candidateGroups="managingDirector" flowable:formKey="createApproval">
<extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
<flowable:formProperty id="approveCreate" name="Approve?" type="boolean" variable="approveCreate" required="true"/>
<flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
</extensionElements>
</userTask>
- <sequenceFlow id="flow3" sourceRef="createApproval" targetRef="CreateApprovalEvaluation"/>
<scriptTask id="CreateApprovalEvaluation" name="Create approval evaluation" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
try {
@@ -68,33 +56,23 @@ try {
} catch(Exception te) {
execution.setVariable("task", null);
}
+} finally {
+ execution.removeVariable("approveCreate");
+ execution.removeVariable("rejectReason");
}]]></script>
</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"/>
- <sequenceFlow id="createApprovalGW2EnableGW" sourceRef="createApprovalGW" targetRef="enableGW">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'approve'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="createApproval2Reject" sourceRef="createApprovalGW" targetRef="reject">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'reject'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" sourceRef="createApprovalGW" targetRef="rejectedGw">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
- </sequenceFlow>
<exclusiveGateway id="enableGW"/>
- <sequenceFlow id="createApprovalGW2OptIn" sourceRef="enableGW" targetRef="generateToken">
- <conditionExpression xsi:type="tFormalExpression">
- <![CDATA[${flowableUtils.isUserIngroup(user, 'groupForWorkflowOptIn')}]]>
- </conditionExpression>
+ <sequenceFlow id="enableGW2GenerateToken" sourceRef="enableGW" targetRef="generateToken">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${flowableUtils.isUserIngroup(userTO, 'groupForWorkflowOptIn')}]]></conditionExpression>
</sequenceFlow>
- <sequenceFlow id="createApprovalGW2Activate" sourceRef="enableGW" targetRef="activate">
+ <sequenceFlow id="enableGW2Activate" sourceRef="enableGW" targetRef="activate">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled == null}]]></conditionExpression>
</sequenceFlow>
- <sequenceFlow id="createApprovalGW2Active" sourceRef="enableGW" targetRef="active">
+ <sequenceFlow id="enableGW2Active" sourceRef="enableGW" targetRef="active">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled}]]></conditionExpression>
</sequenceFlow>
- <sequenceFlow id="createApprovalGW2Suspended" sourceRef="enableGW" targetRef="suspend">
+ <sequenceFlow id="enableGW2Suspended" sourceRef="enableGW" targetRef="suspend">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!enabled}]]></conditionExpression>
</sequenceFlow>
<serviceTask id="activate" name="Activate" flowable:expression="#{autoActivate.execute(execution.processInstanceId)}"/>
@@ -112,7 +90,7 @@ try {
</sequenceFlow>
<scriptTask id="removeToken" name="Remove Token and Activate" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
- user.removeToken()
+ user.removeToken()
]]></script>
</scriptTask>
<sequenceFlow id="flow7" sourceRef="removeToken" targetRef="active"/>
@@ -141,15 +119,13 @@ try {
<sequenceFlow id="active2ConfirmPasswordReset" sourceRef="activeGw" targetRef="checkToken4ConfirmPasswordReset">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'confirmPasswordReset'}]]></conditionExpression>
</sequenceFlow>
- <userTask id="updateApproval" name="Update approval"
- flowable:candidateGroups="managingDirector" flowable:formKey="updateApproval">
+ <userTask id="updateApproval" name="Update approval" flowable:candidateGroups="managingDirector" flowable:formKey="updateApproval">
<extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
<flowable:formProperty id="approveUpdate" name="Approve?" type="boolean" variable="approveUpdate" required="true"/>
<flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
</extensionElements>
</userTask>
- <sequenceFlow id="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" sourceRef="updateApproval" targetRef="UpdateApprovalEvaluation"/>
<scriptTask id="UpdateApprovalEvaluation" name="Update approval evaluation" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
try {
@@ -166,9 +142,11 @@ try {
} catch(Exception te) {
execution.setVariable("task", null);
}
+} finally {
+ execution.removeVariable("approveUpdate");
+ execution.removeVariable("rejectReason");
}]]></script>
</scriptTask>
- <sequenceFlow id="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" sourceRef="UpdateApprovalEvaluation" targetRef="updateApprovalGW"/>
<exclusiveGateway id="updateApprovalGW" default="sid-E58BBC2D-8831-4CF2-A798-14B258FE569B"/>
<sequenceFlow id="sid-E58BBC2D-8831-4CF2-A798-14B258FE569B" sourceRef="updateApprovalGW" targetRef="updateApproval"/>
<sequenceFlow id="updateApprovalGW2Update" sourceRef="updateApprovalGW" targetRef="update">
@@ -188,28 +166,6 @@ try {
<sequenceFlow id="flow8ter" sourceRef="rejectUpdate" targetRef="active"/>
<serviceTask id="update" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
<sequenceFlow id="flow9" sourceRef="update" targetRef="active"/>
- <userTask id="recertificationRequest" name="Recertification Request"
- flowable:candidateGroups="managingDirector" flowable:formKey="recertify">
- <extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
- <flowable:formProperty id="approve" name="Recertify?" type="boolean" required="true"/>
- <flowable: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" flowable: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-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" flowable:expression="#{suspend.execute(execution.processInstanceId)}"/>
<sequenceFlow id="flow10" sourceRef="suspend" targetRef="suspended"/>
<userTask id="suspended" name="Suspended"/>
@@ -225,11 +181,11 @@ try {
<sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
<scriptTask id="reject" name="Reject" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
- def scriptVar = rejectReason
- execution.setVariable("propByResource", null);
+ execution.removeVariable("userTO");
+ execution.removeVariable("encryptedPwd");
+ execution.removeVariable("propByResource");
]]></script>
</scriptTask>
- <sequenceFlow id="flow13" sourceRef="reject" targetRef="rejected"/>
<userTask id="rejected" name="Rejected"/>
<sequenceFlow id="flow14" sourceRef="rejected" targetRef="rejectedGw"/>
<exclusiveGateway id="rejectedGw"/>
@@ -239,10 +195,9 @@ try {
<sequenceFlow id="rejected2Rejected" sourceRef="rejectedGw" targetRef="rejected">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${empty task}]]></conditionExpression>
</sequenceFlow>
- <userTask id="deleteApproval" name="Delete approval"
- flowable:candidateGroups="managingDirector" flowable:formKey="deleteApproval">
+ <userTask id="deleteApproval" name="Delete approval" flowable:candidateGroups="managingDirector" flowable:formKey="deleteApproval">
<extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
<flowable:formProperty id="approveDelete" name="Approve?" type="boolean" variable="approveDelete" required="true"/>
<flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
</extensionElements>
@@ -272,434 +227,475 @@ try {
<serviceTask id="delete" name="Delete" flowable:expression="#{delete.execute(execution.processInstanceId)}"/>
<sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
<endEvent id="theEnd"/>
+ <serviceTask id="updateWhilePendingCreateApproval" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-76B82B68-099D-4729-B8CF-D028386FE900" sourceRef="createApprovalGW" targetRef="createApproval"/>
+ <sequenceFlow id="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" sourceRef="createApprovalGW" targetRef="rejectedGw">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+ </sequenceFlow>
+ <exclusiveGateway id="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" default="flow3"/>
+ <sequenceFlow id="flow13" sourceRef="reject" targetRef="rejected"/>
+ <sequenceFlow id="createApprovalGW2EnableGW" sourceRef="createApprovalGW" targetRef="enableGW">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'approve'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="createApproval2Reject" sourceRef="createApprovalGW" targetRef="reject">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'reject'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW"/>
+ <sequenceFlow id="flow3" sourceRef="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" targetRef="CreateApprovalEvaluation"/>
+ <sequenceFlow id="sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991" sourceRef="CreateApprovalEvaluation" targetRef="createApprovalGW"/>
+ <sequenceFlow id="createAsAnonymous2Approval" sourceRef="createGW" targetRef="createApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == 'anonymous' || flowableUtils.isUserIngroup(userTO, 'groupForWorkflowApproval')}]]></conditionExpression>
+ </sequenceFlow>
+ <serviceTask id="updateWhilePendingUpdateApproval" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
+ <exclusiveGateway id="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" default="sid-12E29B94-C369-45C1-BCEF-C165AFDA525A"/>
+ <sequenceFlow id="sid-930DADF1-C361-43DD-A240-582F21DEB9B6" sourceRef="createApproval" targetRef="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7"/>
+ <sequenceFlow id="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" sourceRef="updateApproval" targetRef="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07"/>
+ <sequenceFlow id="sid-66CDB1C4-7C2F-4BAE-9834-84CF0CF52BF3" sourceRef="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" targetRef="updateWhilePendingUpdateApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'update'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="sid-C9FA59AF-4F39-489E-B424-5C06B15AE317" sourceRef="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" targetRef="updateWhilePendingCreateApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'update'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="sid-F746E78F-F59B-4842-9D88-C9C79474FC06" sourceRef="updateWhilePendingCreateApproval" targetRef="createApproval"/>
+ <sequenceFlow id="sid-1D0DA593-85D7-412B-8DA3-79DC0CE00E1D" sourceRef="updateWhilePendingUpdateApproval" targetRef="updateApproval"/>
+ <sequenceFlow id="sid-12E29B94-C369-45C1-BCEF-C165AFDA525A" sourceRef="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" targetRef="UpdateApprovalEvaluation"/>
+ <sequenceFlow id="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" sourceRef="UpdateApprovalEvaluation" targetRef="updateApprovalGW"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
<bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
<bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
- <omgdc:Bounds height="35.0" width="35.0" x="333.0" y="252.0"></omgdc:Bounds>
+ <omgdc:Bounds height="30.0" width="30.0" x="333.0" y="252.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
- <omgdc:Bounds height="60.0" width="100.0" x="300.0" y="323.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="300.0" y="323.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="createGW" id="BPMNShape_createGW">
- <omgdc:Bounds height="40.0" width="40.0" x="330.0" y="507.0"></omgdc:Bounds>
+ <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="420.0" y="560.0"></omgdc:Bounds>
+ <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"></omgdc:Bounds>
+ <omgdc:Bounds height="80.0" width="100.0" x="477.5" y="765.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="createApprovalGW" id="BPMNShape_createApprovalGW">
- <omgdc:Bounds height="40.0" width="40.0" x="570.0" y="570.0"></omgdc:Bounds>
+ <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="690.0" y="429.0"></omgdc:Bounds>
+ <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="810.0" y="610.0"></omgdc:Bounds>
+ <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="810.0" y="213.0"></omgdc:Bounds>
+ <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="952.0" y="213.0"></omgdc:Bounds>
+ <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="1102.0" y="223.0"></omgdc:Bounds>
+ <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="1180.0" y="213.0"></omgdc:Bounds>
+ <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="1130.0" y="511.0"></omgdc:Bounds>
+ <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="1500.0" y="520.0"></omgdc:Bounds>
+ <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="1590.0" y="740.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1605.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.0"></omgdc:Bounds>
+ <omgdc:Bounds height="80.0" width="100.0" x="1740.0" y="855.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="updateApprovalGW" id="BPMNShape_updateApprovalGW">
- <omgdc:Bounds height="40.0" width="40.0" x="1770.0" y="750.0"></omgdc:Bounds>
+ <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="1890.0" y="840.0"></omgdc:Bounds>
+ <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="1890.0" y="700.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recertificationRequest" id="BPMNShape_recertificationRequest">
- <omgdc:Bounds height="80.0" width="100.0" x="1964.0" y="499.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recertify-task" id="BPMNShape_recertify-task">
- <omgdc:Bounds height="80.0" width="100.0" x="2106.0" y="500.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
- <omgdc:Bounds height="40.0" width="40.0" x="2136.0" y="410.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1890.0" y="700.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
- <omgdc:Bounds height="60.0" width="100.0" x="1590.0" y="100.0"></omgdc:Bounds>
+ <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="1740.0" y="120.0"></omgdc:Bounds>
+ <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="1920.0" y="180.0"></omgdc:Bounds>
+ <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="2040.0" y="110.0"></omgdc:Bounds>
+ <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="660.0" y="659.0"></omgdc:Bounds>
+ <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="810.0" y="770.0"></omgdc:Bounds>
+ <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="990.0" y="780.0"></omgdc:Bounds>
+ <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="1590.0" y="280.0"></omgdc:Bounds>
+ <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="1770.0" y="300.0"></omgdc:Bounds>
+ <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="1890.0" y="240.0"></omgdc:Bounds>
+ <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.0" width="100.0" x="1643.0" y="452.0"></omgdc:Bounds>
+ <omgdc:Bounds height="59.0" width="100.0" x="1643.0" y="452.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="452.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="452.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1643.0" y="561.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1643.0" y="561.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="561.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="561.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
- <omgdc:Bounds height="60.0" width="100.0" x="2220.0" y="358.0"></omgdc:Bounds>
+ <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="35.0" width="35.0" x="2358.0" y="374.0"></omgdc:Bounds>
+ <omgdc:Bounds height="28.0" width="28.0" x="2358.0" y="374.0"/>
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="350.0" y="287.0"></omgdi:waypoint>
- <omgdi:waypoint x="350.0" y="323.0"></omgdi:waypoint>
+ <bpmndi:BPMNShape bpmnElement="updateWhilePendingCreateApproval" id="BPMNShape_updateWhilePendingCreateApproval">
+ <omgdc:Bounds height="60.0" width="100.0" x="362.5" y="770.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" id="BPMNShape_sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7">
+ <omgdc:Bounds height="40.0" width="40.0" x="450.0" y="660.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="updateWhilePendingUpdateApproval" id="BPMNShape_updateWhilePendingUpdateApproval">
+ <omgdc:Bounds height="60.0" width="100.0" x="1455.0" y="865.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" id="BPMNShape_sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07">
+ <omgdc:Bounds height="40.0" width="40.0" x="1635.0" y="875.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
+ <omgdi:waypoint x="1539.9223684210267" y="540.0"/>
+ <omgdi:waypoint x="1556.0" y="540.0"/>
+ <omgdi:waypoint x="1556.0" y="730.0"/>
+ <omgdi:waypoint x="1889.999999999701" y="730.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
- <omgdi:waypoint x="350.0" y="383.0"></omgdi:waypoint>
- <omgdi:waypoint x="350.0" y="507.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-1D0DA593-85D7-412B-8DA3-79DC0CE00E1D" id="BPMNEdge_sid-1D0DA593-85D7-412B-8DA3-79DC0CE00E1D">
+ <omgdi:waypoint x="1540.94" y="865.0"/>
+ <omgdi:waypoint x="1619.0" y="799.9499999999999"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
- <omgdi:waypoint x="370.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="420.0" y="590.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
+ <omgdi:waypoint x="1539.9442374350085" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="561.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
- <omgdi:waypoint x="370.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="690.0" y="449.0"></omgdi:waypoint>
+ <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="519.9499999997392" y="590.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
- <omgdi:waypoint x="470.0" y="620.0"></omgdi:waypoint>
- <omgdi:waypoint x="470.0" y="732.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-930DADF1-C361-43DD-A240-582F21DEB9B6" id="BPMNEdge_sid-930DADF1-C361-43DD-A240-582F21DEB9B6">
+ <omgdi:waypoint x="470.0" y="619.9499999999999"/>
+ <omgdi:waypoint x="470.0" y="660.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
+ <omgdi:waypoint x="990.0" y="800.0"/>
+ <omgdi:waypoint x="909.9499999999135" y="800.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991" id="BPMNEdge_sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991">
- <omgdi:waypoint x="470.0" y="732.0"></omgdi:waypoint>
- <omgdi:waypoint x="590.0" y="610.0"></omgdi:waypoint>
+ <omgdi:waypoint x="577.4499999999488" y="805.0"/>
+ <omgdi:waypoint x="590.0" y="805.0"/>
+ <omgdi:waypoint x="590.0" y="609.9046184271755"/>
</bpmndi:BPMNEdge>
- <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>
- <omgdi:waypoint x="520.0" y="590.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
+ <omgdi:waypoint x="1539.9189252336448" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="680.0"/>
+ <omgdi:waypoint x="2174.0" y="680.0"/>
+ <omgdi:waypoint x="2260.1369863013697" y="417.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
- <omgdi:waypoint x="610.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="690.0" y="449.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2GenerateToken" id="BPMNEdge_enableGW2GenerateToken">
+ <omgdi:waypoint x="729.9433544302707" y="449.0"/>
+ <omgdi:waypoint x="860.0" y="449.0"/>
+ <omgdi:waypoint x="860.0" y="272.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
- <omgdi:waypoint x="610.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="689.0"></omgdi:waypoint>
- <omgdi:waypoint x="660.0" y="689.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="348.3475822648328" y="281.94584310464063"/>
+ <omgdi:waypoint x="349.30232558139534" y="323.0"/>
</bpmndi:BPMNEdge>
- <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>
- <omgdi:waypoint x="590.0" y="859.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="859.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="820.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2OptIn" id="BPMNEdge_createApprovalGW2OptIn">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="860.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="860.0" y="273.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Activate" id="BPMNEdge_createApprovalGW2Activate">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="810.0" y="640.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Active" id="BPMNEdge_createApprovalGW2Active">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="861.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="861.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1130.0" y="541.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Suspended" id="BPMNEdge_createApprovalGW2Suspended">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="130.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+ <omgdi:waypoint x="350.0" y="382.95"/>
+ <omgdi:waypoint x="350.0" y="507.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+ <omgdi:waypoint x="489.93253064798597" y="680.0"/>
+ <omgdi:waypoint x="527.0" y="680.0"/>
+ <omgdi:waypoint x="527.34" y="765.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
- <omgdi:waypoint x="910.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="922.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="1059.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
+ <omgdi:waypoint x="909.9499999998994" 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="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
+ <omgdi:waypoint x="1809.9339371980675" 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="flow5" id="BPMNEdge_flow5">
- <omgdi:waypoint x="910.0" y="243.0"></omgdi:waypoint>
- <omgdi:waypoint x="952.0" y="243.0"></omgdi:waypoint>
+ <omgdi:waypoint x="909.9499999999393" y="243.0"/>
+ <omgdi:waypoint x="952.0" y="243.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
- <omgdi:waypoint x="1002.0" y="273.0"></omgdi:waypoint>
- <omgdi:waypoint x="1002.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1122.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1122.0" y="263.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
- <omgdi:waypoint x="1142.0" y="243.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="243.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
- <omgdi:waypoint x="1102.0" y="243.0"></omgdi:waypoint>
- <omgdi:waypoint x="1052.0" y="243.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1002.0" y="272.95"/>
+ <omgdi:waypoint x="1002.0" y="310.0"/>
+ <omgdi:waypoint x="1122.0" y="310.0"/>
+ <omgdi:waypoint x="1122.0" y="262.9148355754858"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
- <omgdi:waypoint x="1230.0" y="273.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1224.96644295302" y="272.95"/>
+ <omgdi:waypoint x="1185.025167785235" y="511.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
- <omgdi:waypoint x="1230.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1500.0" y="540.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-66CDB1C4-7C2F-4BAE-9834-84CF0CF52BF3" id="BPMNEdge_sid-66CDB1C4-7C2F-4BAE-9834-84CF0CF52BF3">
+ <omgdi:waypoint x="1635.4333333333334" y="895.4333333333334"/>
+ <omgdi:waypoint x="1554.9499999999264" y="895.1659468438539"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="770.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+ <omgdi:waypoint x="1229.9499999999914" y="540.8529411764707"/>
+ <omgdi:waypoint x="1500.0586510263724" y="540.058504398827"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="310.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
+ <omgdi:waypoint x="1539.9189252336448" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="130.0"/>
+ <omgdi:waypoint x="1589.9999999999768" y="130.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1556.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1556.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="730.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+ <omgdi:waypoint x="1989.95" y="730.0"/>
+ <omgdi:waypoint x="2037.0" y="730.0"/>
+ <omgdi:waypoint x="2037.0" y="971.0"/>
+ <omgdi:waypoint x="1334.0" y="971.0"/>
+ <omgdi:waypoint x="1180.0" y="844.0"/>
+ <omgdi:waypoint x="1180.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2Active" id="BPMNEdge_enableGW2Active">
+ <omgdi:waypoint x="729.9433984115534" 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="active2Suspend" id="BPMNEdge_active2Suspend">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="130.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
+ <omgdi:waypoint x="1539.9207478005092" y="540.0"/>
+ <omgdi:waypoint x="1554.0" y="540.0"/>
+ <omgdi:waypoint x="1554.0" y="770.0"/>
+ <omgdi:waypoint x="1605.0" y="770.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="680.0"></omgdi:waypoint>
- <omgdi:waypoint x="2174.0" y="680.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="418.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2" id="BPMNEdge_sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2">
+ <omgdi:waypoint x="1790.0" y="789.9304794520548"/>
+ <omgdi:waypoint x="1790.0" y="821.0"/>
+ <omgdi:waypoint x="2270.0" y="821.0"/>
+ <omgdi:waypoint x="2270.0" y="417.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
+ <omgdi:waypoint x="1809.9339371980677" 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="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="561.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
+ <omgdi:waypoint x="369.91892523364487" 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-A2BDF803-688C-4A4D-9D33-6D859C029245" id="BPMNEdge_sid-A2BDF803-688C-4A4D-9D33-6D859C029245">
- <omgdi:waypoint x="1640.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="824.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
+ <omgdi:waypoint x="609.9189252336447" 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="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" id="BPMNEdge_sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F">
- <omgdi:waypoint x="1640.0" y="824.0"></omgdi:waypoint>
- <omgdi:waypoint x="1790.0" y="790.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <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>
- <omgdi:waypoint x="1690.0" y="770.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1790.0" y="855.0"/>
+ <omgdi:waypoint x="1790.0" y="789.9079463570856"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
- <omgdi:waypoint x="1810.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="730.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="rejected2Delete" id="BPMNEdge_rejected2Delete">
+ <omgdi:waypoint x="1029.9339371980675" 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="417.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
- <omgdi:waypoint x="1810.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="870.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="870.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-F746E78F-F59B-4842-9D88-C9C79474FC06" id="BPMNEdge_sid-F746E78F-F59B-4842-9D88-C9C79474FC06">
+ <omgdi:waypoint x="400.83333333333337" y="770.0"/>
+ <omgdi:waypoint x="367.0" y="683.0"/>
+ <omgdi:waypoint x="436.7741935483871" y="619.9499999999999"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2" id="BPMNEdge_sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2">
- <omgdi:waypoint x="1790.0" y="790.0"></omgdi:waypoint>
- <omgdi:waypoint x="1790.0" y="821.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="821.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="418.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
+ <omgdi:waypoint x="1889.9999999999998" y="260.7451923076923"/>
+ <omgdi:waypoint x="1524.0" y="193.0"/>
+ <omgdi:waypoint x="1209.6057471264367" y="511.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
- <omgdi:waypoint x="1940.0" y="900.0"></omgdi:waypoint>
- <omgdi:waypoint x="1940.0" y="924.0"></omgdi:waypoint>
- <omgdi:waypoint x="1338.0" y="924.0"></omgdi:waypoint>
- <omgdi:waypoint x="1214.0" y="837.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
+ <omgdi:waypoint x="1959.9469781884277" y="200.0"/>
+ <omgdi:waypoint x="2270.0" y="200.0"/>
+ <omgdi:waypoint x="2270.0" y="358.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
- <omgdi:waypoint x="1990.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="2037.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="2037.0" y="946.0"></omgdi:waypoint>
- <omgdi:waypoint x="1336.0" y="946.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="844.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
- <omgdi:waypoint x="2064.0" y="539.0"></omgdi:waypoint>
- <omgdi:waypoint x="2106.0" y="540.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-request-start-flow" id="BPMNEdge_recert-request-start-flow">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1964.0" y="539.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
- <omgdi:waypoint x="2156.0" y="500.0"></omgdi:waypoint>
- <omgdi:waypoint x="2156.0" y="450.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
- <omgdi:waypoint x="2156.0" y="410.0"></omgdi:waypoint>
- <omgdi:waypoint x="1593.0" y="365.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
- <omgdi:waypoint x="2156.0" y="410.0"></omgdi:waypoint>
- <omgdi:waypoint x="2156.0" y="53.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="53.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="100.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
+ <omgdi:waypoint x="1809.9339371980677" y="320.0"/>
+ <omgdi:waypoint x="1852.0" y="320.0"/>
+ <omgdi:waypoint x="1852.0" y="270.0"/>
+ <omgdi:waypoint x="1889.9999999999768" y="270.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
- <omgdi:waypoint x="1690.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="150.0"></omgdi:waypoint>
- <omgdi:waypoint x="1740.0" y="150.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
+ <omgdi:waypoint x="609.9189252336447" 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="flow11" id="BPMNEdge_flow11">
- <omgdi:waypoint x="1840.0" y="150.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="150.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="1920.0" y="200.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
+ <omgdi:waypoint x="1102.0" y="243.0"/>
+ <omgdi:waypoint x="1051.95" y="243.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
- <omgdi:waypoint x="1960.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2002.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2002.0" y="140.0"></omgdi:waypoint>
- <omgdi:waypoint x="2040.0" y="140.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1959.9339371980413" y="200.0"/>
+ <omgdi:waypoint x="2002.0" y="200.0"/>
+ <omgdi:waypoint x="2002.0" y="140.0"/>
+ <omgdi:waypoint x="2039.999999999977" y="140.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
- <omgdi:waypoint x="1960.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="358.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
+ <omgdi:waypoint x="1539.9207478005092" 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="flow12" id="BPMNEdge_flow12">
- <omgdi:waypoint x="2040.0" y="140.0"></omgdi:waypoint>
- <omgdi:waypoint x="2028.0" y="127.0"></omgdi:waypoint>
- <omgdi:waypoint x="1478.0" y="40.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
+ <omgdi:waypoint x="1742.95" y="591.0"/>
+ <omgdi:waypoint x="1848.0" y="591.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
+ <omgdi:waypoint x="1847.9999999999998" y="619.3716000000001"/>
+ <omgdi:waypoint x="1773.0" y="662.0"/>
+ <omgdi:waypoint x="1229.9499999999998" y="551.1921585160202"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" id="BPMNEdge_sid-A2BDF803-688C-4A4D-9D33-6D859C029245">
+ <omgdi:waypoint x="1655.1193227091633" y="799.9499999999999"/>
+ <omgdi:waypoint x="1655.42" y="875.42"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
- <omgdi:waypoint x="760.0" y="689.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="689.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="810.0" y="800.0"></omgdi:waypoint>
+ <omgdi:waypoint x="759.9499999998994" 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="flow14" id="BPMNEdge_flow14">
- <omgdi:waypoint x="860.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="860.0" y="732.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="732.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="780.0"></omgdi:waypoint>
+ <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="rejected2Delete" id="BPMNEdge_rejected2Delete">
- <omgdi:waypoint x="1030.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="1072.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="1323.0" y="1000.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="1000.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="418.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
+ <omgdi:waypoint x="1742.95" y="481.62182926829274"/>
+ <omgdi:waypoint x="1847.9999999999989" y="481.8780487804878"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
- <omgdi:waypoint x="990.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="910.0" y="800.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" id="BPMNEdge_sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58">
+ <omgdi:waypoint x="590.0" y="609.9462931995539"/>
+ <omgdi:waypoint x="590.0" y="859.0"/>
+ <omgdi:waypoint x="1010.0" y="859.0"/>
+ <omgdi:waypoint x="1010.0" y="819.9168505942274"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
+ <omgdi:waypoint x="1809.9339371980675" 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="flow16" id="BPMNEdge_flow16">
+ <omgdi:waypoint x="1848.0" y="458.94174757281553"/>
+ <omgdi:waypoint x="1692.0" y="387.0"/>
+ <omgdi:waypoint x="1229.9499999999998" y="525.9609375"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-C9FA59AF-4F39-489E-B424-5C06B15AE317" id="BPMNEdge_sid-C9FA59AF-4F39-489E-B424-5C06B15AE317">
+ <omgdi:waypoint x="450.0" y="680.0"/>
+ <omgdi:waypoint x="412.0" y="680.0"/>
+ <omgdi:waypoint x="412.375" y="770.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2Suspended" id="BPMNEdge_enableGW2Suspended">
+ <omgdi:waypoint x="729.9339371980061" 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="flow14bis" id="BPMNEdge_flow14bis">
- <omgdi:waypoint x="1690.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1770.0" y="320.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1689.949999999984" 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="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
- <omgdi:waypoint x="1810.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="388.0"></omgdi:waypoint>
- <omgdi:waypoint x="2220.0" y="388.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2Activate" id="BPMNEdge_enableGW2Activate">
+ <omgdi:waypoint x="729.9339371980061" 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="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
- <omgdi:waypoint x="1810.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="270.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="270.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
+ <omgdi:waypoint x="1141.9407724328892" y="243.0"/>
+ <omgdi:waypoint x="1180.0" y="243.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
- <omgdi:waypoint x="1940.0" y="240.0"></omgdi:waypoint>
- <omgdi:waypoint x="1524.0" y="193.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-12E29B94-C369-45C1-BCEF-C165AFDA525A" id="BPMNEdge_sid-12E29B94-C369-45C1-BCEF-C165AFDA525A">
+ <omgdi:waypoint x="1674.5135906040268" y="895.429104477612"/>
+ <omgdi:waypoint x="1740.0" y="895.185687732342"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
- <omgdi:waypoint x="1743.0" y="481.0"></omgdi:waypoint>
- <omgdi:waypoint x="1848.0" y="482.0"></omgdi:waypoint>
+ <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="1704.95" y="770.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
- <omgdi:waypoint x="1898.0" y="452.0"></omgdi:waypoint>
- <omgdi:waypoint x="1692.0" y="387.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
+ <omgdi:waypoint x="369.91892523364487" 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="flow17" id="BPMNEdge_flow17">
- <omgdi:waypoint x="1743.0" y="591.0"></omgdi:waypoint>
- <omgdi:waypoint x="1848.0" y="591.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
+ <omgdi:waypoint x="1539.9442374350085" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="510.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
- <omgdi:waypoint x="1898.0" y="621.0"></omgdi:waypoint>
- <omgdi:waypoint x="1773.0" y="662.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+ <omgdi:waypoint x="1689.95" y="130.0"/>
+ <omgdi:waypoint x="1702.0" y="130.0"/>
+ <omgdi:waypoint x="1702.0" y="150.0"/>
+ <omgdi:waypoint x="1739.9999999999768" y="150.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+ <omgdi:waypoint x="1839.9499999999837" 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="2320.0" y="388.0"></omgdi:waypoint>
- <omgdi:waypoint x="2358.0" y="391.0"></omgdi:waypoint>
+ <omgdi:waypoint x="2319.9499999999875" y="388.0"/>
+ <omgdi:waypoint x="2358.0" y="388.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
+ <omgdi:waypoint x="2040.0" y="129.51612903225808"/>
+ <omgdi:waypoint x="2028.0" y="127.0"/>
+ <omgdi:waypoint x="1478.0" y="40.0"/>
+ <omgdi:waypoint x="1197.8145708582833" y="511.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
+ <omgdi:waypoint x="1940.0" y="899.9499999999999"/>
+ <omgdi:waypoint x="1940.0" y="948.0"/>
+ <omgdi:waypoint x="1339.0" y="948.0"/>
+ <omgdi:waypoint x="1214.0" y="837.0"/>
+ <omgdi:waypoint x="1183.4402027027027" y="570.95"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</definitions>
\ No newline at end of file
+</definitions>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
index 151f426..ee5d8e1 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
@@ -108,14 +108,15 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
import org.apache.syncope.common.rest.api.service.TaskService;
import org.apache.syncope.common.rest.api.service.UserSelfService;
import org.apache.syncope.common.rest.api.service.UserService;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
import org.apache.syncope.fit.core.UserITCase;
import org.identityconnectors.common.security.Encryptor;
import org.junit.jupiter.api.BeforeAll;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
+import org.apache.syncope.common.rest.api.service.BpmnProcessService;
+import org.apache.syncope.common.rest.api.service.UserWorkflowTaskService;
public abstract class AbstractITCase {
@@ -217,7 +218,9 @@ public abstract class AbstractITCase {
protected static UserSelfService userSelfService;
- protected static UserWorkflowService userWorkflowService;
+ protected static UserRequestService userRequestService;
+
+ protected static UserWorkflowTaskService userWorkflowTaskService;
protected static GroupService groupService;
@@ -241,7 +244,7 @@ public abstract class AbstractITCase {
protected static ReconciliationService reconciliationService;
- protected static WorkflowService workflowService;
+ protected static BpmnProcessService bpmnProcessService;
protected static MailTemplateService mailTemplateService;
@@ -314,7 +317,8 @@ public abstract class AbstractITCase {
dynRealmService = adminClient.getService(DynRealmService.class);
userService = adminClient.getService(UserService.class);
userSelfService = adminClient.getService(UserSelfService.class);
- userWorkflowService = adminClient.getService(UserWorkflowService.class);
+ userRequestService = adminClient.getService(UserRequestService.class);
+ userWorkflowTaskService = adminClient.getService(UserWorkflowTaskService.class);
groupService = adminClient.getService(GroupService.class);
resourceService = adminClient.getService(ResourceService.class);
resourceHistoryService = adminClient.getService(ResourceHistoryService.class);
@@ -327,7 +331,7 @@ public abstract class AbstractITCase {
taskService = adminClient.getService(TaskService.class);
reconciliationService = adminClient.getService(ReconciliationService.class);
policyService = adminClient.getService(PolicyService.class);
- workflowService = adminClient.getService(WorkflowService.class);
+ bpmnProcessService = adminClient.getService(BpmnProcessService.class);
mailTemplateService = adminClient.getService(MailTemplateService.class);
notificationService = adminClient.getService(NotificationService.class);
schemaService = adminClient.getService(SchemaService.class);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
index 0fbb094..08afd11 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
@@ -22,15 +22,7 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
public class FlowableDetector {
- public static boolean isFlowableEnabledForUsers(final SyncopeService syncopeService) {
+ public static boolean isFlowableEnabledForUserWorkflow(final SyncopeService syncopeService) {
return syncopeService.platform().getUserWorkflowAdapter().contains("Flowable");
}
-
- public static boolean isFlowableEnabledForGroups(final SyncopeService syncopeService) {
- return syncopeService.platform().getGroupWorkflowAdapter().contains("Flowable");
- }
-
- public static boolean isFlowableEnabledForAnyObjects(final SyncopeService syncopeService) {
- return syncopeService.platform().getAnyObjectWorkflowAdapter().contains("Flowable");
- }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
index bcc2c6d..0159d8f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
@@ -27,9 +27,7 @@ import org.apache.syncope.client.console.pages.Realms;
import org.apache.syncope.client.console.pages.Reports;
import org.apache.syncope.client.console.pages.Security;
import org.apache.syncope.client.console.pages.Types;
-import org.apache.syncope.client.console.pages.Workflow;
import org.apache.syncope.client.console.topology.Topology;
-import org.apache.syncope.fit.FlowableDetector;
import org.junit.jupiter.api.Test;
// Please, keep the class name as is in order to respect the execution order. It seems that from wicket 7.5.0 the
@@ -69,11 +67,6 @@ public class AjaxBrowseITCase extends AbstractConsoleITCase {
TESTER.clickLink("body:reportsLI:reports");
TESTER.assertRenderedPage(Reports.class);
- if (FlowableDetector.isFlowableEnabledForUsers(SYNCOPE_SERVICE)) {
- TESTER.clickLink("body:configurationLI:configurationUL:workflowLI:workflow");
- TESTER.assertRenderedPage(Workflow.class);
- }
-
TESTER.clickLink("body:configurationLI:configurationUL:logsLI:logs");
TESTER.assertRenderedPage(Logs.class);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
index 7ec16f1..e2f351b 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
@@ -54,7 +54,7 @@ import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.ProvisioningResult;
import org.apache.syncope.common.lib.to.RoleTO;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.AttrSchemaType;
import org.apache.syncope.common.lib.types.CipherAlgorithm;
@@ -474,7 +474,7 @@ public class AuthenticationITCase extends AbstractITCase {
@Test
public void issueSYNCOPE434() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// 1. create user with group 'groupForWorkflowApproval'
// (users with group groupForWorkflowApproval are defined in workflow as subject to approval)
@@ -495,10 +495,10 @@ public class AuthenticationITCase extends AbstractITCase {
}
// 3. approve user
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
- userTO = userWorkflowService.submitForm(form);
+ userTO = userRequestService.submitForm(form);
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java
new file mode 100644
index 0000000..443cd83
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java
@@ -0,0 +1,72 @@
+/*
+ * 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 static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.fit.AbstractITCase;
+import org.apache.syncope.fit.FlowableDetector;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+public class BpmnProcessITCase extends AbstractITCase {
+
+ private static String userWorkflowKey = null;
+
+ @BeforeAll
+ public static void findDefault() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+ bpmnProcessService.list().stream().
+ filter(BpmnProcessTO::isUserWorkflow).findAny().
+ ifPresent(process -> {
+ userWorkflowKey = process.getKey();
+ });
+ assertNotNull(userWorkflowKey);
+ }
+
+ @Test
+ public void exportUserWorkflowProcess() throws IOException {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+ Response response = bpmnProcessService.get(userWorkflowKey);
+ assertTrue(response.getMediaType().toString().
+ startsWith(clientFactory.getContentType().getMediaType().toString()));
+ assertTrue(response.getEntity() instanceof InputStream);
+ String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
+ assertNotNull(definition);
+ assertFalse(definition.isEmpty());
+ }
+
+ @Test
+ public void updateUserWorkflowProcess() throws IOException {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+ Response response = bpmnProcessService.get(userWorkflowKey);
+ String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
+
+ bpmnProcessService.set(userWorkflowKey, definition);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
index d257264..e07c30f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
@@ -105,8 +105,8 @@ public class MultitenancyITCase extends AbstractITCase {
@Test
public void readPlainSchemas() {
- assertEquals(13, adminClient.getService(SchemaService.class).search(new SchemaQuery.Builder().type(
- SchemaType.PLAIN).build()).size());
+ assertEquals(12, adminClient.getService(SchemaService.class).
+ search(new SchemaQuery.Builder().type(SchemaType.PLAIN).build()).size());
}
@Test
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index 2dc671b..b1ba164 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -253,7 +253,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
UserTO userTO = userService.read(inUserTO.getKey());
assertNotNull(userTO);
assertEquals(userName, userTO.getUsername());
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active" : "created", userTO.getStatus());
assertEquals("test9@syncope.apache.org", userTO.getPlainAttr("email").get().getValues().get(0));
assertEquals("test9@syncope.apache.org", userTO.getPlainAttr("userId").get().getValues().get(0));
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
index b349d60..44a3d5c 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
@@ -31,6 +31,7 @@ import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.to.RoleTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.common.rest.api.service.RoleService;
import org.apache.syncope.fit.AbstractITCase;
@@ -90,16 +91,16 @@ public class RoleITCase extends AbstractITCase {
role = createRole(role);
assertNotNull(role);
- assertFalse(role.getEntitlements().contains(StandardEntitlement.WORKFLOW_TASK_LIST));
+ assertFalse(role.getEntitlements().contains(FlowableEntitlement.WORKFLOW_TASK_LIST));
assertFalse(role.getRealms().contains("/even/two"));
- role.getEntitlements().add(StandardEntitlement.WORKFLOW_TASK_LIST);
+ role.getEntitlements().add(FlowableEntitlement.WORKFLOW_TASK_LIST);
role.getRealms().add("/even/two");
roleService.update(role);
role = roleService.read(role.getKey());
- assertTrue(role.getEntitlements().contains(StandardEntitlement.WORKFLOW_TASK_LIST));
+ assertTrue(role.getEntitlements().contains(FlowableEntitlement.WORKFLOW_TASK_LIST));
assertTrue(role.getRealms().contains("/even/two"));
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
index dc0066d..24eacad 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
@@ -24,7 +24,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
import java.util.Date;
import java.util.List;
@@ -40,16 +39,12 @@ import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.types.ImplementationType;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
import org.apache.syncope.common.lib.types.JobAction;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.beans.ExecuteQuery;
import org.apache.syncope.common.rest.api.beans.ExecQuery;
import org.apache.syncope.common.rest.api.beans.TaskQuery;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
import org.apache.syncope.common.rest.api.service.TaskService;
-import org.apache.syncope.fit.FlowableDetector;
import org.apache.syncope.fit.core.reference.TestSampleJobDelegate;
import org.junit.jupiter.api.Test;
@@ -139,27 +134,6 @@ public class SchedTaskITCase extends AbstractTaskITCase {
}
@Test
- public void recertification() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- execTask(taskService, TaskType.SCHEDULED, "e95555d2-1b09-42c8-b25b-f4c4ec598989", "JOB_FIRED", 50, false);
-
- List<WorkflowFormTO> forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build()).getResult();
- assertFalse(forms.isEmpty());
- forms.forEach(form -> {
- userWorkflowService.claimForm(form.getTaskId());
- WorkflowFormPropertyTO approve = form.getProperty("approve").orElse(null);
- approve.setValue("true");
- userWorkflowService.submitForm(form);
- });
-
- forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build()).getResult();
- assertTrue(forms.isEmpty());
- }
-
- @Test
public void issueSYNCOPE144() {
ImplementationTO taskJobDelegate = implementationService.read(
ImplementationType.TASKJOB_DELEGATE, TestSampleJobDelegate.class.getSimpleName());
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
index b05480c..cd4940f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
@@ -714,7 +714,7 @@ public class UserITCase extends AbstractITCase {
@Test
public void createActivate() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
UserTO userTO = getUniqueSampleTO("createActivate@syncope.apache.org");
@@ -751,7 +751,7 @@ public class UserITCase extends AbstractITCase {
userTO = createUser(userTO).getEntity();
assertNotNull(userTO);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active"
: "created", userTO.getStatus());
@@ -787,7 +787,7 @@ public class UserITCase extends AbstractITCase {
userTO.getResources().add(RESOURCE_NAME_LDAP);
userTO = createUser(userTO).getEntity();
assertNotNull(userTO);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active"
: "created", userTO.getStatus());
String userKey = userTO.getKey();
[06/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml
new file mode 100644
index 0000000..cc905a3
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/Task.xml
@@ -0,0 +1,1418 @@
+<?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.
+-->
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+
+ <!-- TASK INSERT -->
+
+ <insert id="insertTask" parameterType="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ insert into ${prefix}ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_, ASSIGNEE_, DELEGATION_,
+ EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_,
+ TASK_DEF_KEY_, DUE_DATE_, CATEGORY_, SUSPENSION_STATE_, TENANT_ID_, FORM_KEY_, CLAIM_TIME_,
+ IS_COUNT_ENABLED_, VAR_COUNT_, ID_LINK_COUNT_, SUB_TASK_COUNT_)
+ values (#{id, jdbcType=VARCHAR},
+ 1,
+ #{name, jdbcType=VARCHAR},
+ #{parentTaskId, jdbcType=VARCHAR},
+ #{description, jdbcType=VARCHAR},
+ #{priority, jdbcType=INTEGER},
+ #{createTime, jdbcType=TIMESTAMP},
+ #{owner, jdbcType=VARCHAR},
+ #{assignee, jdbcType=VARCHAR},
+ #{delegationStateString, jdbcType=VARCHAR},
+ #{executionId, jdbcType=VARCHAR},
+ #{processInstanceId, jdbcType=VARCHAR},
+ #{processDefinitionId, jdbcType=VARCHAR},
+ #{taskDefinitionId, jdbcType=VARCHAR},
+ #{scopeId, jdbcType=VARCHAR},
+ #{subScopeId, jdbcType=VARCHAR},
+ #{scopeType, jdbcType=VARCHAR},
+ #{scopeDefinitionId, jdbcType=VARCHAR},
+ #{taskDefinitionKey, jdbcType=VARCHAR},
+ #{dueDate, jdbcType=TIMESTAMP},
+ #{category, jdbcType=VARCHAR},
+ #{suspensionState, jdbcType=INTEGER},
+ #{tenantId, jdbcType=VARCHAR},
+ #{formKey, jdbcType=VARCHAR},
+ #{claimTime, jdbcType=TIMESTAMP},
+ #{isCountEnabled, jdbcType=BOOLEAN},
+ #{variableCount, jdbcType=INTEGER},
+ #{identityLinkCount, jdbcType=INTEGER},
+ #{subTaskCount, jdbcType=INTEGER}
+ )
+ </insert>
+
+ <insert id="bulkInsertTask" parameterType="java.util.List">
+ INSERT INTO ${prefix}ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_, ASSIGNEE_, DELEGATION_,
+ EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_,
+ TASK_DEF_KEY_, DUE_DATE_, CATEGORY_, SUSPENSION_STATE_, TENANT_ID_, FORM_KEY_, CLAIM_TIME_,
+ IS_COUNT_ENABLED_, VAR_COUNT_, ID_LINK_COUNT_, SUB_TASK_COUNT_)
+ VALUES
+ <foreach collection="list" item="task" index="index" separator=",">
+ (#{task.id, jdbcType=VARCHAR},
+ 1,
+ #{task.name, jdbcType=VARCHAR},
+ #{task.parentTaskId, jdbcType=VARCHAR},
+ #{task.description, jdbcType=VARCHAR},
+ #{task.priority, jdbcType=INTEGER},
+ #{task.createTime, jdbcType=TIMESTAMP},
+ #{task.owner, jdbcType=VARCHAR},
+ #{task.assignee, jdbcType=VARCHAR},
+ #{task.delegationStateString, jdbcType=VARCHAR},
+ #{task.executionId, jdbcType=VARCHAR},
+ #{task.processInstanceId, jdbcType=VARCHAR},
+ #{task.processDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionId, jdbcType=VARCHAR},
+ #{task.scopeId, jdbcType=VARCHAR},
+ #{task.subScopeId, jdbcType=VARCHAR},
+ #{task.scopeType, jdbcType=VARCHAR},
+ #{task.scopeDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionKey, jdbcType=VARCHAR},
+ #{task.dueDate, jdbcType=TIMESTAMP},
+ #{task.category, jdbcType=VARCHAR},
+ #{task.suspensionState, jdbcType=INTEGER},
+ #{task.tenantId, jdbcType=VARCHAR},
+ #{task.formKey, jdbcType=VARCHAR},
+ #{task.claimTime, jdbcType=TIMESTAMP},
+ #{task.isCountEnabled, jdbcType=BOOLEAN},
+ #{task.variableCount, jdbcType=INTEGER},
+ #{task.identityLinkCount, jdbcType=INTEGER},
+ #{task.subTaskCount, jdbcType=INTEGER}
+ )
+ </foreach>
+ </insert>
+
+ <insert id="bulkInsertTask" databaseId="oracle" parameterType="java.util.List">
+ INSERT ALL
+ <foreach collection="list" item="task" index="index">
+ INTO ${prefix}ACT_RU_TASK (ID_, REV_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_, ASSIGNEE_, DELEGATION_,
+ EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, TASK_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, TASK_DEF_KEY_,
+ DUE_DATE_, CATEGORY_, SUSPENSION_STATE_, TENANT_ID_, FORM_KEY_, CLAIM_TIME_,
+ IS_COUNT_ENABLED_, VAR_COUNT_, ID_LINK_COUNT_, SUB_TASK_COUNT_) VALUES
+ (#{task.id, jdbcType=VARCHAR},
+ 1,
+ #{task.name, jdbcType=VARCHAR},
+ #{task.parentTaskId, jdbcType=VARCHAR},
+ #{task.description, jdbcType=VARCHAR},
+ #{task.priority, jdbcType=INTEGER},
+ #{task.createTime, jdbcType=TIMESTAMP},
+ #{task.owner, jdbcType=VARCHAR},
+ #{task.assignee, jdbcType=VARCHAR},
+ #{task.delegationStateString, jdbcType=VARCHAR},
+ #{task.executionId, jdbcType=VARCHAR},
+ #{task.processInstanceId, jdbcType=VARCHAR},
+ #{task.processDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionId, jdbcType=VARCHAR},
+ #{task.scopeId, jdbcType=VARCHAR},
+ #{task.subScopeId, jdbcType=VARCHAR},
+ #{task.scopeType, jdbcType=VARCHAR},
+ #{task.scopeDefinitionId, jdbcType=VARCHAR},
+ #{task.taskDefinitionKey, jdbcType=VARCHAR},
+ #{task.dueDate, jdbcType=TIMESTAMP},
+ #{task.category, jdbcType=VARCHAR},
+ #{task.suspensionState, jdbcType=INTEGER},
+ #{task.tenantId, jdbcType=VARCHAR},
+ #{task.formKey, jdbcType=VARCHAR},
+ #{task.claimTime, jdbcType=TIMESTAMP},
+ #{task.isCountEnabled, jdbcType=BOOLEAN},
+ #{task.variableCount, jdbcType=INTEGER},
+ #{task.identityLinkCount, jdbcType=INTEGER},
+ #{task.subTaskCount, jdbcType=INTEGER}
+ )
+ </foreach>
+ SELECT * FROM dual
+ </insert>
+
+ <!-- TASK UPDATE -->
+
+ <update id="updateTask" parameterType="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ update ${prefix}ACT_RU_TASK
+ <set>
+ REV_ = #{revisionNext, jdbcType=INTEGER},
+ <if test="originalPersistentState.name != name">
+ NAME_ = #{name, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.parentTaskId != parentTaskId">
+ PARENT_TASK_ID_ = #{parentTaskId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.priority != priority">
+ PRIORITY_ = #{priority, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.createTime != createTime">
+ CREATE_TIME_ = #{createTime, jdbcType=TIMESTAMP},
+ </if>
+ <if test="originalPersistentState.owner != owner">
+ OWNER_ = #{owner, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.assignee != assignee">
+ ASSIGNEE_ = #{assignee, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.delegationStateString != delegationStateString">
+ DELEGATION_ = #{delegationStateString, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.executionId != executionId">
+ EXECUTION_ID_ = #{executionId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.processDefinitionId != processDefinitionId">
+ PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.taskDefinitionId != taskDefinitionId">
+ TASK_DEF_ID_ = #{taskDefinitionId, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.scopeId != scopeId">
+ SCOPE_ID_ = #{scopeId, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.subScopeId != subScopeId">
+ SUB_SCOPE_ID_ = #{subScopeId, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.scopeType != scopeType">
+ SCOPE_TYPE_ = #{scopeType, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.scopeDefinitionId != scopeDefinitionId">
+ SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=VARCHAR}
+ </if>
+ <if test="originalPersistentState.description != description">
+ DESCRIPTION_ = #{description, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.dueDate != dueDate">
+ DUE_DATE_ = #{dueDate, jdbcType=TIMESTAMP},
+ </if>
+ <if test="originalPersistentState.category != category">
+ CATEGORY_ = #{category, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.suspensionState != suspensionState">
+ SUSPENSION_STATE_ = #{suspensionState, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.formKey != formKey">
+ FORM_KEY_ = #{formKey, jdbcType=VARCHAR},
+ </if>
+ <if test="originalPersistentState.claimTime != claimTime">
+ CLAIM_TIME_ = #{claimTime, jdbcType=TIMESTAMP},
+ </if>
+ <if test="originalPersistentState.isCountEnabled != isCountEnabled">
+ IS_COUNT_ENABLED_ = #{isCountEnabled, jdbcType=BOOLEAN},
+ </if>
+ <if test="originalPersistentState.variableCount != variableCount">
+ VAR_COUNT_ = #{variableCount, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.identityLinkCount != identityLinkCount">
+ ID_LINK_COUNT_ = #{identityLinkCount, jdbcType=INTEGER},
+ </if>
+ <if test="originalPersistentState.subTaskCount != subTaskCount">
+ SUB_TASK_COUNT_ = #{subTaskCount, jdbcType=INTEGER}
+ </if>
+ </set>
+ where ID_= #{id, jdbcType=VARCHAR}
+ and REV_ = #{revision, jdbcType=INTEGER}
+ </update>
+
+ <update id="updateTaskTenantIdForDeployment" parameterType="java.util.Map">
+ update ${prefix}ACT_RU_TASK set
+ TENANT_ID_ = #{tenantId, jdbcType=VARCHAR}
+ where
+ ID_ in (
+ SELECT T.ID_ from ${prefix}ACT_RU_TASK T
+ inner join ${prefix}ACT_RE_PROCDEF P on T.PROC_DEF_ID_ = P.ID_
+ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_
+ where D.ID_ = #{deploymentId, jdbcType=VARCHAR}
+ )
+ </update>
+
+ <!-- See http://stackoverflow.com/questions/4429319/you-cant-specify-target-table-for-update-in-from-clause
+ Tested this on MySQL 5.6: does NOT use a temporary table (so good, performance0 -->
+ <update id="updateTaskTenantIdForDeployment" databaseId="mysql" parameterType="java.util.Map">
+ update ${prefix}ACT_RU_TASK set
+ TENANT_ID_ = #{tenantId, jdbcType=VARCHAR}
+ where
+ ID_ in (
+
+ SELECT tempTask.tempId
+ FROM (
+ SELECT T.ID_ as tempId
+ FROM ${prefix}ACT_RU_TASK T
+ inner join ${prefix}ACT_RE_PROCDEF P on T.PROC_DEF_ID_ = P.ID_
+ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_
+ where D.ID_ = #{deploymentId, jdbcType=VARCHAR}
+
+ ) AS tempTask
+
+ )
+ </update>
+
+
+ <update id="updateTaskRelatedEntityCountEnabled" parameterType="boolean">
+ update ${prefix}ACT_RU_TASK
+ set IS_COUNT_ENABLED_ = #{parameter, jdbcType=BOOLEAN}
+ </update>
+
+ <!-- TASK DELETE -->
+ <delete id="deleteTask" parameterType="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ delete from ${prefix}ACT_RU_TASK where ID_ = #{id} and REV_ = #{revision}
+ </delete>
+
+ <delete id="deleteTasksByExecutionId" parameterType="string">
+ delete from ${prefix}ACT_RU_TASK where EXECUTION_ID_ = #{id}
+ </delete>
+
+ <delete id="bulkDeleteTask" parameterType="java.util.Collection">
+ delete from ${prefix}ACT_RU_TASK where
+ <foreach item="task" collection="list" index="index" separator=" or ">
+ ID_ = #{task.id, jdbcType=VARCHAR}
+ </foreach>
+ </delete>
+
+ <!-- TASK RESULTMAP -->
+
+ <resultMap id="taskResultMap" type="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ <id property="id" column="ID_" jdbcType="VARCHAR"/>
+ <result property="revision" column="REV_" jdbcType="INTEGER"/>
+ <result property="name" column="NAME_" jdbcType="VARCHAR"/>
+ <result property="parentTaskId" column="PARENT_TASK_ID_" jdbcType="VARCHAR"/>
+ <result property="description" column="DESCRIPTION_" jdbcType="VARCHAR"/>
+ <result property="priority" column="PRIORITY_" jdbcType="INTEGER"/>
+ <result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP" />
+ <result property="owner" column="OWNER_" jdbcType="VARCHAR"/>
+ <result property="assignee" column="ASSIGNEE_" jdbcType="VARCHAR"/>
+ <result property="delegationStateString" column="DELEGATION_" jdbcType="VARCHAR"/>
+ <result property="executionId" column="EXECUTION_ID_" jdbcType="VARCHAR" />
+ <result property="processInstanceId" column="PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="processDefinitionId" column="PROC_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionId" column="TASK_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeId" column="SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="subScopeId" column="SUB_SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeType" column="SCOPE_TYPE_" jdbcType="VARCHAR"/>
+ <result property="scopeDefinitionId" column="SCOPE_DEFINITION_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionKey" column="TASK_DEF_KEY_" jdbcType="VARCHAR"/>
+ <result property="dueDate" column="DUE_DATE_" jdbcType="TIMESTAMP"/>
+ <result property="category" column="CATEGORY_" jdbcType="VARCHAR" />
+ <result property="suspensionState" column="SUSPENSION_STATE_" jdbcType="INTEGER" />
+ <result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR" />
+ <result property="formKey" column="FORM_KEY_" jdbcType="VARCHAR" />
+ <result property="claimTime" column="CLAIM_TIME_" jdbcType="TIMESTAMP" />
+ <result property="isCountEnabled" column="IS_COUNT_ENABLED_" jdbcType="BOOLEAN" />
+ <result property="variableCount" column="VAR_COUNT_" jdbcType="INTEGER" />
+ <result property="identityLinkCount" column="ID_LINK_COUNT_" jdbcType="INTEGER" />
+ <result property="subTaskCount" column="SUB_TASK_COUNT_" jdbcType="INTEGER" />
+ </resultMap>
+
+ <resultMap id="taskAndRelatedEntitiesResultMap" type="org.flowable.task.service.impl.persistence.entity.TaskEntityImpl">
+ <id property="id" column="ID_" jdbcType="VARCHAR"/>
+ <result property="revision" column="REV_" jdbcType="INTEGER"/>
+ <result property="name" column="NAME_" jdbcType="VARCHAR"/>
+ <result property="parentTaskId" column="PARENT_TASK_ID_" jdbcType="VARCHAR"/>
+ <result property="description" column="DESCRIPTION_" jdbcType="VARCHAR"/>
+ <result property="priority" column="PRIORITY_" jdbcType="INTEGER"/>
+ <result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP" />
+ <result property="owner" column="OWNER_" jdbcType="VARCHAR"/>
+ <result property="assignee" column="ASSIGNEE_" jdbcType="VARCHAR"/>
+ <result property="delegationStateString" column="DELEGATION_" jdbcType="VARCHAR"/>
+ <result property="executionId" column="EXECUTION_ID_" jdbcType="VARCHAR" />
+ <result property="processInstanceId" column="PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="processDefinitionId" column="PROC_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionId" column="TASK_DEF_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeId" column="SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="subScopeId" column="SUB_SCOPE_ID_" jdbcType="VARCHAR"/>
+ <result property="scopeType" column="SCOPE_TYPE_" jdbcType="VARCHAR"/>
+ <result property="scopeDefinitionId" column="SCOPE_DEFINITION_ID_" jdbcType="VARCHAR"/>
+ <result property="taskDefinitionKey" column="TASK_DEF_KEY_" jdbcType="VARCHAR"/>
+ <result property="dueDate" column="DUE_DATE_" jdbcType="TIMESTAMP"/>
+ <result property="category" column="CATEGORY_" jdbcType="VARCHAR" />
+ <result property="suspensionState" column="SUSPENSION_STATE_" jdbcType="INTEGER" />
+ <result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR" />
+ <result property="formKey" column="FORM_KEY_" jdbcType="VARCHAR" />
+ <result property="claimTime" column="CLAIM_TIME_" jdbcType="TIMESTAMP" />
+ <result property="isCountEnabled" column="IS_COUNT_ENABLED_" jdbcType="BOOLEAN" />
+ <result property="variableCount" column="VAR_COUNT_" jdbcType="INTEGER" />
+ <result property="identityLinkCount" column="ID_LINK_COUNT_" jdbcType="INTEGER" />
+ <result property="subTaskCount" column="SUB_TASK_COUNT_" jdbcType="INTEGER" />
+ <collection property="queryVariables" column="TASK_ID_" javaType="ArrayList" ofType="org.flowable.variable.service.impl.persistence.entity.VariableInstanceEntityImpl">
+ <id property="id" column="VAR_ID_"/>
+ <result property="name" column="VAR_NAME_" javaType="String" jdbcType="VARCHAR" />
+ <result property="type" column="VAR_TYPE_" javaType="org.flowable.variable.api.types.VariableType" jdbcType="VARCHAR" />
+ <result property="revision" column="VAR_REV_" jdbcType="INTEGER" />
+ <result property="processInstanceId" column="VAR_PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="executionId" column="VAR_EXECUTION_ID_" jdbcType="VARCHAR" />
+ <result property="taskId" column="VAR_TASK_ID_" jdbcType="VARCHAR" />
+ <result property="byteArrayRef" column="VAR_BYTEARRAY_ID_" typeHandler="VariableByteArrayRefTypeHandler"/>
+ <result property="doubleValue" column="VAR_DOUBLE_" jdbcType="DOUBLE" />
+ <result property="textValue" column="VAR_TEXT_" jdbcType="VARCHAR" />
+ <result property="textValue2" column="VAR_TEXT2_" jdbcType="VARCHAR" />
+ <result property="longValue" column="VAR_LONG_" jdbcType="BIGINT" />
+ </collection>
+ <collection property="queryIdentityLinks" column="TASK_ID_" javaType="ArrayList" ofType="org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntityImpl">
+ <id property="id" column="ILINK_ID_"/>
+ <result property="type" column="ILINK_TYPE_" jdbcType="VARCHAR" />
+ <result property="userId" column="ILINK_USER_ID_" jdbcType="VARCHAR" />
+ <result property="groupId" column="ILINK_GROUP_ID_" jdbcType="VARCHAR" />
+ <result property="taskId" column="ILINK_TASK_ID_" jdbcType="VARCHAR" />
+ <result property="processInstanceId" column="ILINK_PROC_INST_ID_" jdbcType="VARCHAR" />
+ <result property="processDefId" column="ILINK_PROC_DEF_ID_" jdbcType="VARCHAR" />
+ </collection>
+ </resultMap>
+
+ <!-- TASK SELECT -->
+
+ <select id="selectTask" parameterType="string" resultMap="taskResultMap">
+ select * from ${prefix}ACT_RU_TASK where ID_ = #{id, jdbcType=VARCHAR}
+ </select>
+
+ <select id="selectTasksByParentTaskId" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select * from ${prefix}ACT_RU_TASK where PARENT_TASK_ID_ = #{parameter}
+ </select>
+
+ <select id="selectTasksByExecutionId" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select distinct T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.EXECUTION_ID_ = #{parameter}
+ </select>
+
+ <select id="selectTasksByProcessInstanceId" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.PROC_INST_ID_ = #{parameter}
+ </select>
+
+ <select id="selectTasksBySubScopeIdAndScopeType" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.SUB_SCOPE_ID_ = #{parameter.subScopeId, jdbcType=VARCHAR} and T.SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=VARCHAR}
+ </select>
+
+ <select id="selectTasksByScopeIdAndScopeType" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="taskResultMap">
+ select T.*
+ from ${prefix}ACT_RU_TASK T
+ where T.SCOPE_ID_ = #{parameter.scopeId, jdbcType=VARCHAR} and T.SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=VARCHAR}
+ </select>
+
+ <!-- Using distinct here because a task can appear multiple times in a resultset when -->
+ <select id="selectTaskByQueryCriteria" parameterType="org.apache.syncope.core.flowable.impl.SyncopeTaskQueryImpl" resultMap="taskResultMap">
+ <if test="firstResult != null and firstResult >= 0">${limitBefore}</if>
+ select distinct RES.* <if test="nullHandlingColumn != null">, ${nullHandlingColumn}</if>
+ <if test="firstResult != null and firstResult >= 0">${limitBetween}</if>
+ <include refid="selectTaskByQueryCriteriaSql"/>
+ ${orderBy}
+ <if test="firstResult != null and firstResult >= 0">${limitAfter}</if>
+ </select>
+
+ <select id="selectTaskCountByQueryCriteria" parameterType="org.apache.syncope.core.flowable.impl.SyncopeTaskQueryImpl" resultType="long">
+ select count(distinct RES.ID_)
+ <include refid="selectTaskByQueryCriteriaSql"/>
+ </select>
+
+ <sql id="selectTaskByQueryCriteriaSql">
+ from ${prefix}ACT_RU_TASK RES
+ <include refid="commonSelectTaskByQueryCriteriaSql"/>
+ </sql>
+
+ <select id="selectTasksWithRelatedEntitiesByQueryCriteria" parameterType="org.apache.syncope.core.flowable.impl.SyncopeTaskQueryImpl" resultMap="taskAndRelatedEntitiesResultMap">
+ <include refid="selectTasksWithRelatedEntitiesByQueryCriteriaColumns"/>
+ <include refid="selectTasksWithRelatedEntitiesByQueryCriteriaSql"/>
+ ${orderBy}
+ <if test="firstResult != null and firstResult >= 0">${limitAfter}</if>
+ </select>
+
+ <sql id="selectTasksWithRelatedEntitiesByQueryCriteriaColumns">
+ <if test="firstResult != null and firstResult >= 0">${limitBefore}</if>
+ <if test="_databaseId != 'db2' and _databaseId != 'mssql'">
+ select RES.*,
+ <if test="includeTaskLocalVariables or includeProcessVariables">
+ VAR.ID_ as VAR_ID_, VAR.NAME_ as VAR_NAME_, VAR.TYPE_ as VAR_TYPE_, VAR.REV_ as VAR_REV_,
+ VAR.PROC_INST_ID_ as VAR_PROC_INST_ID_, VAR.EXECUTION_ID_ as VAR_EXECUTION_ID_, VAR.TASK_ID_ as VAR_TASK_ID_,
+ VAR.BYTEARRAY_ID_ as VAR_BYTEARRAY_ID_, VAR.DOUBLE_ as VAR_DOUBLE_,
+ VAR.TEXT_ as VAR_TEXT_, VAR.TEXT2_ as VAR_TEXT2_, VAR.LONG_ as VAR_LONG_
+ </if>
+ <if test="(includeTaskLocalVariables or includeProcessVariables) and includeIdentityLinks">
+ ,
+ </if>
+ <if test="includeIdentityLinks">
+ ILINK.ID_ as ILINK_ID_, ILINK.TYPE_ as ILINK_TYPE_, ILINK.USER_ID_ as ILINK_USER_ID_,
+ ILINK.GROUP_ID_ as ILINK_GROUP_ID_, ILINK.TASK_ID_ as ILINK_TASK_ID_,
+ ILINK.PROC_INST_ID_ as ILINK_PROC_INST_ID_, ILINK.PROC_DEF_ID_ as ILINK_PROC_DEF_ID_
+ </if>
+ <if test="firstResult != null and firstResult >= 0">${limitBetween}</if>
+ </if>
+ <if test="_databaseId == 'db2' || _databaseId == 'mssql'">
+ select distinct TEMPRES_ID_ as ID_, TEMPRES_REV_ as REV_, TEMPRES_NAME_ as NAME_,
+ TEMPRES_PARENT_TASK_ID_ as PARENT_TASK_ID_, TEMPRES_DESCRIPTION_ as DESCRIPTION_,
+ TEMPRES_PRIORITY_ as PRIORITY_, TEMPRES_CREATE_TIME_ as CREATE_TIME_,
+ TEMPRES_OWNER_ as OWNER_, TEMPRES_ASSIGNEE_ as ASSIGNEE_, TEMPRES_DELEGATION_ as DELEGATION_,
+ TEMPRES_FORM_KEY_ as FORM_KEY_, TEMPRES_CLAIM_TIME_ as CLAIM_TIME_, TEMPRES_EXECUTION_ID_ as EXECUTION_ID_,
+ TEMPRES_PROC_INST_ID_ as PROC_INST_ID_, TEMPRES_PROC_DEF_ID_ as PROC_DEF_ID_,
+ TEMPRES_TASK_DEF_ID_ as TASK_DEF_ID_, TEMPRES_TASK_DEF_KEY_ as TASK_DEF_KEY_,
+ TEMPRES_DUE_DATE_ as DUE_DATE_, TEMPRES_SUSPENSION_STATE_ as SUSPENSION_STATE_, TEMPRES_CATEGORY_ as CATEGORY_,
+ TEMPRES_IS_COUNT_ENABLED_ as IS_COUNT_ENABLED_, TEMPRES_VAR_COUNT_ as VAR_COUNT_, TEMPRES_ID_LINK_COUNT_ as ID_LINK_COUNT_, TEMPRES_ID_SUB_TASK_COUNT_ as SUB_TASK_COUNT_
+ <if test="includeTaskLocalVariables or includeProcessVariables">
+ ,
+ TEMPVAR_ID_ as VAR_ID_, TEMPVAR_NAME_ as VAR_NAME_, TEMPVAR_TYPE_ as VAR_TYPE_, TEMPVAR_REV_ as VAR_REV_,
+ TEMPVAR_PROC_INST_ID_ as VAR_PROC_INST_ID_, TEMPVAR_EXECUTION_ID_ as VAR_EXECUTION_ID_, TEMPVAR_TASK_ID_ as VAR_TASK_ID_,
+ TEMPVAR_BYTEARRAY_ID_ as VAR_BYTEARRAY_ID_, TEMPVAR_DOUBLE_ as VAR_DOUBLE_,
+ TEMPVAR_TEXT_ as VAR_TEXT_, TEMPVAR_TEXT2_ as VAR_TEXT2_, TEMPVAR_LONG_ as VAR_LONG_
+ </if>
+ <if test="includeIdentityLinks">
+ ,
+ TEMPILINK_ID_ as ILINK_ID_, TEMPILINK_TYPE_ as ILINK_TYPE_, TEMPILINK_USER_ID_ as ILINK_USER_ID_,
+ TEMPILINK_GROUP_ID_ as ILINK_GROUP_ID_, TEMPILINK_TASK_ID_ as ILINK_TASK_ID_,
+ TEMPILINK_PROC_INST_ID_ as ILINK_PROC_INST_ID_, TEMPILINK_PROC_DEF_ID_ as ILINK_PROC_DEF_ID_
+ </if>
+ <if test="firstResult != null and firstResult >= 0">${limitOuterJoinBetween}</if>
+ RES.ID_ as TEMPRES_ID_, RES.REV_ as TEMPRES_REV_, RES.NAME_ as TEMPRES_NAME_,
+ RES.PARENT_TASK_ID_ as TEMPRES_PARENT_TASK_ID_, RES.DESCRIPTION_ as TEMPRES_DESCRIPTION_,
+ RES.PRIORITY_ as TEMPRES_PRIORITY_, RES.CREATE_TIME_ as TEMPRES_CREATE_TIME_,
+ RES.OWNER_ as TEMPRES_OWNER_, RES.ASSIGNEE_ as TEMPRES_ASSIGNEE_, RES.DELEGATION_ as TEMPRES_DELEGATION_,
+ RES.FORM_KEY_ as TEMPRES_FORM_KEY_, RES.CLAIM_TIME_ as TEMPRES_CLAIM_TIME_, RES.EXECUTION_ID_ as TEMPRES_EXECUTION_ID_,
+ RES.PROC_INST_ID_ as TEMPRES_PROC_INST_ID_, RES.PROC_DEF_ID_ as TEMPRES_PROC_DEF_ID_,
+ RES.TASK_DEF_ID_ as TEMPRES_TASK_DEF_ID_, RES.TASK_DEF_KEY_ as TEMPRES_TASK_DEF_KEY_,
+ RES.DUE_DATE_ as TEMPRES_DUE_DATE_, RES.SUSPENSION_STATE_ as TEMPRES_SUSPENSION_STATE_, RES.CATEGORY_ as TEMPRES_CATEGORY_,
+ RES.IS_COUNT_ENABLED_ as TEMPRES_IS_COUNT_ENABLED_, RES.VAR_COUNT_ as TEMPRES_VAR_COUNT_, RES.ID_LINK_COUNT_ as TEMPRES_ID_LINK_COUNT_, RES.SUB_TASK_COUNT_ as TEMPRES_ID_SUB_TASK_COUNT_
+ <if test="includeTaskLocalVariables or includeProcessVariables">
+ ,
+ VAR.ID_ as TEMPVAR_ID_, VAR.NAME_ as TEMPVAR_NAME_, VAR.TYPE_ as TEMPVAR_TYPE_, VAR.REV_ as TEMPVAR_REV_,
+ VAR.PROC_INST_ID_ as TEMPVAR_PROC_INST_ID_, VAR.EXECUTION_ID_ as TEMPVAR_EXECUTION_ID_, VAR.TASK_ID_ as TEMPVAR_TASK_ID_,
+ VAR.BYTEARRAY_ID_ as TEMPVAR_BYTEARRAY_ID_, VAR.DOUBLE_ as TEMPVAR_DOUBLE_,
+ VAR.TEXT_ as TEMPVAR_TEXT_, VAR.TEXT2_ as TEMPVAR_TEXT2_, VAR.LONG_ as TEMPVAR_LONG_
+ </if>
+ <if test="includeIdentityLinks">
+ ,
+ ILINK.ID_ as TEMPILINK_ID_, ILINK.TYPE_ as TEMPILINK_TYPE_, ILINK.USER_ID_ as TEMPILINK_USER_ID_,
+ ILINK.GROUP_ID_ as TEMPILINK_GROUP_ID_, ILINK.TASK_ID_ as TEMPILINK_TASK_ID_,
+ ILINK.PROC_INST_ID_ as TEMPILINK_PROC_INST_ID_, ILINK.PROC_DEF_ID_ as TEMPILINK_PROC_DEF_ID_
+ </if>
+ </if>
+ </sql>
+
+ <sql id="selectTasksWithRelatedEntitiesByQueryCriteriaSql">
+ from ${prefix}ACT_RU_TASK RES
+ <choose>
+ <when test="includeTaskLocalVariables && includeProcessVariables">
+ left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.ID_ = VAR.TASK_ID_ or RES.PROC_INST_ID_ = VAR.EXECUTION_ID_
+ </when>
+ <otherwise>
+ <if test="includeTaskLocalVariables">
+ left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.ID_ = VAR.TASK_ID_
+ </if>
+ <if test="includeProcessVariables">
+ left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.PROC_INST_ID_ = VAR.EXECUTION_ID_ and VAR.TASK_ID_ is null
+ </if>
+ </otherwise>
+ </choose>
+ <if test="includeIdentityLinks">
+ left outer join ${prefix}ACT_RU_IDENTITYLINK ILINK on RES.ID_ = ILINK.TASK_ID_
+ </if>
+ <include refid="commonSelectTaskByQueryCriteriaSql"/>
+ </sql>
+
+ <sql id="commonSelectTaskByQueryCriteriaSql">
+ <if test="candidateUser != null || candidateGroups != null || bothCandidateAndAssigned">
+ <choose>
+ <when test="bothCandidateAndAssigned">left</when>
+ <otherwise>inner</otherwise>
+ </choose>
+ join ${prefix}ACT_RU_IDENTITYLINK I on I.TASK_ID_ = RES.ID_
+ </if>
+ <foreach collection="queryVariableValues" index="index" item="var">
+ <if test="!var.operator.equals('EXISTS') && !var.operator.equals('NOT_EXISTS')">
+ <choose>
+ <when test="var.local">
+ inner join ${prefix}ACT_RU_VARIABLE A${index} on RES.ID_ = A${index}.TASK_ID_
+ </when>
+ <otherwise>
+ inner join ${prefix}ACT_RU_VARIABLE A${index} on RES.PROC_INST_ID_ = A${index}.PROC_INST_ID_
+ </otherwise>
+ </choose>
+ </if>
+ </foreach>
+ <foreach collection="orQueryObjects" index="orIndex" item="orQueryObject">
+ <if test="orQueryObject.candidateUser != null || orQueryObject.candidateGroups != null || orQueryObject.bothCandidateAndAssigned">
+ <choose>
+ <when test="orQueryObject.bothCandidateAndAssigned">left</when>
+ <otherwise>inner</otherwise>
+ </choose>
+ join ${prefix}ACT_RU_IDENTITYLINK I_OR${orIndex} on I_OR${orIndex}.TASK_ID_ = RES.ID_
+ </if>
+ <if test="orQueryObject.queryVariableValues.size() > 0">
+ <if test="orQueryObject.hasValueComparisonQueryVariables()">
+ <if test="orQueryObject.hasLocalQueryVariableValue()">
+ left outer join ${prefix}ACT_RU_VARIABLE A_L_OR${orIndex} on RES.ID_ = A_L_OR${orIndex}.TASK_ID_
+ </if>
+ <if test="orQueryObject.hasNonLocalQueryVariableValue()">
+ left outer join ${prefix}ACT_RU_VARIABLE A_OR${orIndex} on RES.PROC_INST_ID_ = A_OR${orIndex}.PROC_INST_ID_
+ </if>
+ </if>
+ </if>
+
+ <if test="orQueryObject.processDefinitionKey != null || orQueryObject.processDefinitionKeyLike != null || orQueryObject.processDefinitionKeyLikeIgnoreCase != null || orQueryObject.processDefinitionName != null || orQueryObject.processDefinitionNameLike != null || (orQueryObject.processCategoryInList != null && orQueryObject.processCategoryInList.size() > 0) || (orQueryObject.processCategoryNotInList != null && orQueryObject.processCategoryNotInList.size() > 0) || (orQueryObject.processDefinitionKeys != null && orQueryObject.processDefinitionKeys.size() > 0)">
+ left outer join ${prefix}ACT_RE_PROCDEF D_OR${orIndex} on RES.PROC_DEF_ID_ = D_OR${orIndex}.ID_
+ </if>
+
+ <if test="orQueryObject.processInstanceBusinessKey != null || orQueryObject.processInstanceBusinessKeyLike != null || orQueryObject.processInstanceBusinessKeyLikeIgnoreCase != null">
+ inner join ${prefix}ACT_RU_EXECUTION E_OR${orIndex} on RES.PROC_INST_ID_ = E_OR${orIndex}.ID_
+ </if>
+
+ <if test="orQueryObject.deploymentId != null || (orQueryObject.deploymentIds != null && orQueryObject.deploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P_OR${orIndex} ON RES.PROC_DEF_ID_ = DEPLOY_P_OR${orIndex}.ID_
+ </if>
+ <if test="orQueryObject.cmmnDeploymentId != null || (orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C_OR${orIndex} ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C_OR${orIndex}.ID_
+ </if>
+ </foreach>
+
+ <if test="processDefinitionKey != null || processDefinitionKeyLike != null || processDefinitionKeyLikeIgnoreCase != null || processDefinitionName != null || processDefinitionNameLike != null || (processCategoryInList != null && processCategoryInList.size() > 0) || (processCategoryNotInList != null && processCategoryNotInList.size() > 0) || (processDefinitionKeys != null && processDefinitionKeys.size() > 0)">
+ inner join ${prefix}ACT_RE_PROCDEF D on RES.PROC_DEF_ID_ = D.ID_
+ </if>
+ <if test="processInstanceBusinessKey != null || processInstanceBusinessKeyLike != null || processInstanceBusinessKeyLikeIgnoreCase != null">
+ inner join ${prefix}ACT_RU_EXECUTION E on RES.PROC_INST_ID_ = E.ID_
+ </if>
+ <if test="deploymentId != null || (deploymentIds != null && deploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_RE_PROCDEF DEPLOY_P ON RES.PROC_DEF_ID_ = DEPLOY_P.ID_
+ </if>
+ <if test="cmmnDeploymentId != null || (cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0)">
+ left outer join ${prefix}ACT_CMMN_CASEDEF DEPLOY_C ON RES.SCOPE_DEFINITION_ID_ = DEPLOY_C.ID_
+ </if>
+ <where>
+ <if test="taskId != null">
+ RES.ID_ = #{taskId}
+ </if>
+ <if test="name != null">
+ and RES.NAME_ = #{name}
+ </if>
+ <if test="nameLike != null">
+ and RES.NAME_ like #{nameLike}${wildcardEscapeClause}
+ </if>
+ <if test="nameLikeIgnoreCase != null">
+ and lower(RES.NAME_) like #{nameLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="nameList != null && nameList.size() > 0">
+ and RES.NAME_ IN
+ <foreach item="name" index="index" collection="nameList"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="nameListIgnoreCase != null && nameListIgnoreCase.size() > 0">
+ and lower(RES.NAME_) IN
+ <foreach item="name" index="index" collection="nameListIgnoreCase"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="description != null">
+ and RES.DESCRIPTION_ = #{description}
+ </if>
+ <if test="descriptionLike != null">
+ and RES.DESCRIPTION_ like #{descriptionLike}${wildcardEscapeClause}
+ </if>
+ <if test="descriptionLikeIgnoreCase != null">
+ and lower(RES.DESCRIPTION_) like #{descriptionLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="priority != null">
+ and RES.PRIORITY_ = #{priority}
+ </if>
+ <if test="minPriority != null">
+ and RES.PRIORITY_ >= #{minPriority}
+ </if>
+ <if test="maxPriority != null">
+ and RES.PRIORITY_ <= #{maxPriority}
+ </if>
+ <if test="assignee != null">
+ and RES.ASSIGNEE_ = #{assignee}
+ </if>
+ <if test="assigneeLike != null">
+ and RES.ASSIGNEE_ like #{assigneeLike}${wildcardEscapeClause}
+ </if>
+ <if test="assigneeLikeIgnoreCase != null">
+ and lower(RES.ASSIGNEE_) like #{assigneeLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="assigneeIds != null && assigneeIds.size() > 0">
+ and RES.ASSIGNEE_ IN
+ <foreach item="assigneeId" index="index" collection="assigneeIds"
+ open="(" separator="," close=")">
+ #{assigneeId}
+ </foreach>
+ </if>
+ <if test="owner != null">
+ and RES.OWNER_ = #{owner}
+ </if>
+ <if test="ownerLike != null">
+ and RES.OWNER_ like #{ownerLike}${wildcardEscapeClause}
+ </if>
+ <if test="ownerLikeIgnoreCase != null">
+ and lower(RES.OWNER_) like #{ownerLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="unassigned">
+ and RES.ASSIGNEE_ IS NULL
+ </if>
+ <if test="noDelegationState">
+ and RES.DELEGATION_ IS NULL
+ </if>
+ <if test="delegationState != null">
+ and RES.DELEGATION_ = #{delegationStateString}
+ </if>
+ <if test="processInstanceId != null">
+ and RES.PROC_INST_ID_ = #{processInstanceId}
+ </if>
+ <if test="processInstanceIds != null && processInstanceIds.size() > 0">
+ and RES.PROC_INST_ID_ IN
+ <foreach item="processInstance" index="index" collection="processInstanceIds"
+ open="(" separator="," close=")">
+ #{processInstance}
+ </foreach>
+ </if>
+ <if test="processInstanceBusinessKey != null">
+ and E.BUSINESS_KEY_ = #{processInstanceBusinessKey}
+ </if>
+ <if test="processInstanceBusinessKeyLike != null">
+ and E.BUSINESS_KEY_ like #{processInstanceBusinessKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="processInstanceBusinessKeyLikeIgnoreCase != null">
+ and lower(E.BUSINESS_KEY_) like #{processInstanceBusinessKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="executionId != null">
+ and RES.EXECUTION_ID_ = #{executionId}
+ </if>
+ <if test="scopeId != null">
+ and RES.SCOPE_ID_ = #{scopeId}
+ </if>
+ <if test="subScopeId != null">
+ and RES.SUB_SCOPE_ID_ = #{subScopeId}
+ </if>
+ <if test="scopeType != null">
+ and RES.SCOPE_TYPE_ = #{scopeType}
+ </if>
+ <if test="scopeDefinitionId != null">
+ and RES.SCOPE_DEFINITION_ID_ = #{scopeDefinitionId}
+ </if>
+ <if test="createTime != null">
+ and RES.CREATE_TIME_ = #{createTime}
+ </if>
+ <if test="createTimeBefore != null">
+ and RES.CREATE_TIME_ < #{createTimeBefore}
+ </if>
+ <if test="createTimeAfter != null">
+ and RES.CREATE_TIME_ > #{createTimeAfter}
+ </if>
+ <if test="key != null">
+ and RES.TASK_DEF_KEY_ = #{key}
+ </if>
+ <if test="keyLike != null">
+ and RES.TASK_DEF_KEY_ like #{keyLike}
+ </if>
+ <if test="processDefinitionId != null">
+ and RES.PROC_DEF_ID_ = #{processDefinitionId}
+ </if>
+ <if test="taskDefinitionId != null">
+ and RES.TASK_DEF_ID_ = #{taskDefinitionId}
+ </if>
+ <if test="processDefinitionKey != null">
+ and D.KEY_ = #{processDefinitionKey}
+ </if>
+ <if test="processDefinitionKeyLike != null">
+ and D.KEY_ like #{processDefinitionKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="processDefinitionKeyLikeIgnoreCase != null">
+ and lower(D.KEY_) like #{processDefinitionKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="processDefinitionKeys != null && processDefinitionKeys.size() > 0">
+ and D.KEY_ in
+ <foreach item="item" index="index" collection="processDefinitionKeys" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </if>
+ <if test="processDefinitionName != null">
+ and D.NAME_ = #{processDefinitionName}
+ </if>
+ <if test="processDefinitionNameLike != null">
+ and D.NAME_ like #{processDefinitionNameLike}${wildcardEscapeClause}
+ </if>
+ <if test="processCategoryInList != null && processCategoryInList.size() > 0">
+ and D.CATEGORY_ IN
+ <foreach item="processCategory" index="index" collection="processCategoryInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="processCategoryNotInList != null && processCategoryNotInList.size() > 0">
+ and D.CATEGORY_ NOT IN
+ <foreach item="processCategory" index="index" collection="processCategoryNotInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="deploymentId != null && cmmnDeploymentId == null">
+ and DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId}
+ </if>
+ <if test="deploymentIds != null && deploymentIds.size() > 0 && cmmnDeploymentIds == null">
+ and DEPLOY_P.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="deploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="cmmnDeploymentId != null && deploymentId == null">
+ and DEPLOY_C.DEPLOYMENT_ID_ = #{cmmnDeploymentId}
+ </if>
+ <if test="cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds == null">
+ and DEPLOY_C.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="cmmnDeploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="deploymentId != null && cmmnDeploymentId != null">
+ and (DEPLOY_P.DEPLOYMENT_ID_ = #{deploymentId} or DEPLOY_C.DEPLOYMENT_ID = #{cmmnDeploymentId})
+ </if>
+ <if test="cmmnDeploymentIds != null && cmmnDeploymentIds.size() > 0 && deploymentIds != null && deploymentIds.size() > 0">
+ and (
+ DEPLOY_P.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="deploymentIds" open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ or
+ DEPLOY_C.DEPLOYMENT_ID_ IN
+ <foreach item="cmmnDeployment" index="index" collection="cmmnDeploymentIds" open="(" separator="," close=")">
+ #{cmmnDeployment}
+ </foreach>
+ )
+ </if>
+ <if test="dueDate != null">
+ and RES.DUE_DATE_ = #{dueDate}
+ </if>
+ <if test="dueBefore != null">
+ and RES.DUE_DATE_ < #{dueBefore}
+ </if>
+ <if test="dueAfter != null">
+ and RES.DUE_DATE_ > #{dueAfter}
+ </if>
+ <if test="withoutDueDate">
+ and RES.DUE_DATE_ is null
+ </if>
+ <if test="dueDate != null || dueBefore != null || dueAfter != null">
+ and RES.DUE_DATE_ is not null
+ </if>
+ <if test="category != null">
+ and RES.CATEGORY_ = #{category}
+ </if>
+ <!-- Syncope -->
+ <if test="withFormKey">
+ and RES.FORM_KEY_ IS NOT NULL
+ </if>
+ <!-- /Syncope -->
+ <if test="excludeSubtasks">
+ and RES.PARENT_TASK_ID_ IS NULL
+ </if>
+ <if test="!bothCandidateAndAssigned && (candidateUser != null || candidateGroups != null)">
+ <if test="!ignoreAssigneeValue">
+ and RES.ASSIGNEE_ is null
+ </if>
+ and I.TYPE_ = 'candidate'
+ and
+ (
+ <if test="candidateUser != null">
+ I.USER_ID_ = #{candidateUser}
+ </if>
+ <if test="candidateUser != null && candidateGroups != null && candidateGroups.size() > 0">
+ or
+ </if>
+ <if test="candidateGroups != null && candidateGroups.size() > 0">
+ I.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="candidateGroups"
+ open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ )
+ </if>
+ <if test="involvedUser != null">
+ and (
+ exists(select LINK.USER_ID_ from ${prefix}ACT_RU_IDENTITYLINK LINK where USER_ID_ = #{involvedUser} and LINK.TASK_ID_ = RES.ID_)
+ or RES.ASSIGNEE_ = #{involvedUser}
+ or RES.OWNER_ = #{involvedUser}
+ )
+ </if>
+ <foreach item="var" collection="queryVariableValues" index="index">
+ <choose>
+ <when test="var.operator.equals('EXISTS')">
+ and EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <when test="var.operator.equals('NOT_EXISTS')">
+ and NOT EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <otherwise>
+ <if test="!var.local">
+ <!-- When process instance variable is queried for, taskId should be null -->
+ and A${index}.TASK_ID_ is null
+ </if>
+ <if test="var.name != null">
+ <!-- Match-all variable-names when name is null -->
+ and A${index}.NAME_= #{var.name}
+ </if>
+ <if test="var.name == null">
+ and A${index}.NAME_ is not null
+ </if>
+ <if test="!var.type.equals('null')">
+ and A${index}.TYPE_ = #{var.type}
+ </if>
+
+ <!-- Variable value -->
+ <if test="var.textValue != null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('EQUALS_IGNORE_CASE') || var.operator.equals('NOT_EQUALS_IGNORE_CASE') || var.operator.equals('LIKE_IGNORE_CASE')">
+ and lower(A${index}.TEXT_)
+ </when>
+ <otherwise>
+ and A${index}.TEXT_
+ </otherwise>
+ </choose>
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue}
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.textValue2 != null">
+ and A${index}.TEXT2_
+ <choose>
+ <when test="var.operator.equals('LIKE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue2}
+ <choose>
+ <when test="var.operator.equals('LIKE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.longValue != null">
+ and A${index}.LONG_
+ <include refid="executionVariableOperator" />
+ #{var.longValue}
+ </if>
+ <if test="var.doubleValue != null">
+ and A${index}.DOUBLE_
+ <include refid="executionVariableOperator" />
+ #{var.doubleValue}
+ </if>
+ <!-- Null variable type -->
+ <if test="var.textValue == null && var.textValue2 == null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('NOT_EQUALS')">
+ and (A${index}.TEXT_ is not null or A${index}.TEXT2_ is not null or A${index}.LONG_ is not null or A${index}.DOUBLE_ is not null or A${index}.BYTEARRAY_ID_ is not null)
+ </when>
+ <otherwise>
+ and A${index}.TEXT_ is null and A${index}.TEXT2_ is null and A${index}.LONG_ is null and A${index}.DOUBLE_ is null and A${index}.BYTEARRAY_ID_ is null
+ </otherwise>
+ </choose>
+ </if>
+ </otherwise>
+ </choose>
+ </foreach>
+ <if test="suspensionState != null">
+ <if test="suspensionState.stateCode == 1">
+ and RES.SUSPENSION_STATE_ = 1
+ </if>
+ <if test="suspensionState.stateCode == 2">
+ and RES.SUSPENSION_STATE_ = 2
+ </if>
+ </if>
+ <if test="tenantId != null">
+ and RES.TENANT_ID_ = #{tenantId}
+ </if>
+ <if test="tenantIdLike != null">
+ and RES.TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause}
+ </if>
+ <if test="withoutTenantId">
+ and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null)
+ </if>
+ <choose>
+ <when test="bothCandidateAndAssigned">
+ <!-- if dbIdentityUsed set true in process engine configuration -->
+ <if test="userIdForCandidateAndAssignee != null">
+ <if test="candidateGroups == null">
+ and (RES.ASSIGNEE_ = #{userIdForCandidateAndAssignee}
+ or (
+ <if test="!ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null
+ </if>
+ and (I.USER_ID_ = #{userIdForCandidateAndAssignee}
+ or I.GROUP_ID_ IN (select g.GROUP_ID_ from ${prefix}ACT_ID_MEMBERSHIP g where g.USER_ID_ = #{userIdForCandidateAndAssignee} ) ) ) )
+ </if>
+ </if>
+ <!-- if dbIdentityUsed set false in process engine configuration of using custom session factory of GroupIdentityManager -->
+ <if test="candidateGroups != null">
+ and (RES.ASSIGNEE_ = #{userIdForCandidateAndAssignee}
+
+ or (
+ <if test="!ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ I.TYPE_ = 'candidate' and (I.USER_ID_ = #{userIdForCandidateAndAssignee}
+ <if test="candidateGroups.size() > 0">
+ or I.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="candidateGroups" open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ )))
+ </if>
+ </when>
+ </choose>
+ <foreach item="orQueryObject" index="orIndex" collection="orQueryObjects">
+ and
+ <trim prefix="(" prefixOverrides="OR" suffix=")">
+ <if test="orQueryObject.taskId != null">
+ RES.ID_ = #{orQueryObject.taskId}
+ </if>
+ <if test="orQueryObject.name != null">
+ or RES.NAME_ = #{orQueryObject.name}
+ </if>
+ <if test="orQueryObject.nameLike != null">
+ or RES.NAME_ like #{orQueryObject.nameLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.nameLikeIgnoreCase != null">
+ or lower(RES.NAME_) like #{orQueryObject.nameLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.nameList != null && orQueryObject.nameList.size() > 0">
+ or RES.NAME_ IN
+ <foreach item="name" index="index" collection="orQueryObject.nameList"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="orQueryObject.nameListIgnoreCase != null && orQueryObject.nameListIgnoreCase.size() > 0">
+ or lower(RES.NAME_) IN
+ <foreach item="name" index="index" collection="orQueryObject.nameListIgnoreCase"
+ open="(" separator="," close=")">
+ #{name}
+ </foreach>
+ </if>
+ <if test="orQueryObject.description != null">
+ or RES.DESCRIPTION_ = #{orQueryObject.description}
+ </if>
+ <if test="orQueryObject.descriptionLike != null">
+ or RES.DESCRIPTION_ like #{orQueryObject.descriptionLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.descriptionLikeIgnoreCase != null">
+ or lower(RES.DESCRIPTION_) like #{orQueryObject.descriptionLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.priority != null">
+ or RES.PRIORITY_ = #{orQueryObject.priority}
+ </if>
+ <if test="orQueryObject.minPriority != null">
+ or RES.PRIORITY_ >= #{orQueryObject.minPriority}
+ </if>
+ <if test="orQueryObject.maxPriority != null">
+ or RES.PRIORITY_ <= #{orQueryObject.maxPriority}
+ </if>
+ <if test="orQueryObject.assignee != null">
+ or RES.ASSIGNEE_ = #{orQueryObject.assignee}
+ </if>
+ <if test="orQueryObject.assigneeLike != null">
+ or RES.ASSIGNEE_ like #{orQueryObject.assigneeLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.assigneeLikeIgnoreCase != null">
+ or lower(RES.ASSIGNEE_) like #{orQueryObject.assigneeLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.assigneeIds != null && orQueryObject.assigneeIds.size() > 0">
+ or RES.ASSIGNEE_ IN
+ <foreach item="assigneeId" index="index" collection="orQueryObject.assigneeIds"
+ open="(" separator="," close=")">
+ #{assigneeId}
+ </foreach>
+ </if>
+ <if test="orQueryObject.owner != null">
+ or RES.OWNER_ = #{orQueryObject.owner}
+ </if>
+ <if test="orQueryObject.ownerLike != null">
+ or RES.OWNER_ like #{orQueryObject.ownerLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.ownerLikeIgnoreCase != null">
+ or RES.OWNER_ like #{orQueryObject.ownerLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.unassigned">
+ or RES.ASSIGNEE_ IS NULL
+ </if>
+ <if test="orQueryObject.noDelegationState">
+ or RES.DELEGATION_ IS NULL
+ </if>
+ <if test="orQueryObject.delegationState != null">
+ or RES.DELEGATION_ = #{orQueryObject.delegationStateString}
+ </if>
+ <if test="orQueryObject.processInstanceId != null">
+ or RES.PROC_INST_ID_ = #{orQueryObject.processInstanceId}
+ </if>
+ <if test="orQueryObject.processInstanceIds != null && orQueryObject.processInstanceIds.size() > 0">
+ or RES.PROC_INST_ID_ IN
+ <foreach item="processInstance" index="index" collection="orQueryObject.processInstanceIds"
+ open="(" separator="," close=")">
+ #{processInstance}
+ </foreach>
+ </if>
+ <if test="orQueryObject.processInstanceBusinessKey != null">
+ or E_OR${orIndex}.BUSINESS_KEY_ = #{orQueryObject.processInstanceBusinessKey}
+ </if>
+ <if test="orQueryObject.processInstanceBusinessKeyLike != null">
+ or E_OR${orIndex}.BUSINESS_KEY_ like #{orQueryObject.processInstanceBusinessKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processInstanceBusinessKeyLikeIgnoreCase != null">
+ or lower(E.BUSINESS_KEY_) like #{orQueryObject.processInstanceBusinessKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.executionId != null">
+ or RES.EXECUTION_ID_ = #{orQueryObject.executionId}
+ </if>
+ <if test="orQueryObject.scopeId != null">
+ and RES.SCOPE_ID_ = #{orQueryObject.scopeId}
+ </if>
+ <if test="orQueryObject.subScopeId != null">
+ and RES.SUB_SCOPE_ID_ = #{orQueryObject.subScopeId}
+ </if>
+ <if test="orQueryObject.scopeType != null">
+ and RES.SCOPE_TYPE_ = #{orQueryObject.scopeType}
+ </if>
+ <if test="orQueryObject.scopeDefinitionId != null">
+ and RES.SCOPE_DEFINITION_ID_ = #{orQueryObject.scopeDefinitionId}
+ </if>
+ <if test="orQueryObject.createTime != null">
+ or RES.CREATE_TIME_ = #{orQueryObject.createTime}
+ </if>
+ <if test="orQueryObject.createTimeBefore != null">
+ or RES.CREATE_TIME_ < #{orQueryObject.createTimeBefore}
+ </if>
+ <if test="orQueryObject.createTimeAfter != null">
+ or RES.CREATE_TIME_ > #{orQueryObject.createTimeAfter}
+ </if>
+ <if test="orQueryObject.key != null">
+ or RES.TASK_DEF_KEY_ = #{orQueryObject.key}
+ </if>
+ <if test="orQueryObject.keyLike != null">
+ or RES.TASK_DEF_KEY_ like #{orQueryObject.keyLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processDefinitionId != null">
+ or RES.PROC_DEF_ID_ = #{orQueryObject.processDefinitionId}
+ </if>
+ <if test="orQueryObject.taskDefinitionId != null">
+ or RES.TASK_DEF_ID_ = #{orQueryObject.taskDefinitionId}
+ </if>
+ <if test="orQueryObject.processDefinitionKey != null">
+ or D_OR${orIndex}.KEY_ = #{orQueryObject.processDefinitionKey}
+ </if>
+ <if test="orQueryObject.processDefinitionKeyLike != null">
+ or D_OR${orIndex}.KEY_ like #{orQueryObject.processDefinitionKeyLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processDefinitionKeyLikeIgnoreCase != null">
+ or lower(D_OR${orIndex}.KEY_) like #{orQueryObject.processDefinitionKeyLikeIgnoreCase}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processDefinitionKeys != null && orQueryObject.processDefinitionKeys.size() > 0">
+ or D_OR${orIndex}.KEY_ in
+ <foreach item="item" index="index" collection="orQueryObject.processDefinitionKeys" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </if>
+ <if test="orQueryObject.processDefinitionName != null">
+ or D_OR${orIndex}.NAME_ = #{orQueryObject.processDefinitionName}
+ </if>
+ <if test="orQueryObject.processDefinitionNameLike != null">
+ or D_OR${orIndex}.NAME_ like #{orQueryObject.processDefinitionNameLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.processCategoryInList != null && orQueryObject.processCategoryInList.size() > 0">
+ or D_OR${orIndex}.CATEGORY_ IN
+ <foreach item="processCategory" index="index" collection="orQueryObject.processCategoryInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="orQueryObject.processCategoryNotInList != null && orQueryObject.processCategoryNotInList.size() > 0">
+ or D_OR${orIndex}.CATEGORY_ NOT IN
+ <foreach item="processCategory" index="index" collection="orQueryObject.processCategoryNotInList"
+ open="(" separator="," close=")">
+ #{processCategory}
+ </foreach>
+ </if>
+ <if test="orQueryObject.deploymentId != null">
+ or DEPLOY_P_OR${orIndex}.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId}
+ </if>
+ <if test="orQueryObject.deploymentIds != null && orQueryObject.deploymentIds.size() > 0">
+ or DEPLOY_P_OR${orIndex}.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="orQueryObject.deploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="orQueryObject.cmmnDeploymentId != null">
+ or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ = #{orQueryObject.cmmnDeploymentId}
+ </if>
+ <if test="orQueryObject.cmmnDeploymentIds != null && orQueryObject.cmmnDeploymentIds.size() > 0">
+ or DEPLOY_C_OR${orIndex}.DEPLOYMENT_ID_ IN
+ <foreach item="deployment" index="index" collection="orQueryObject.cmmnDeploymentIds"
+ open="(" separator="," close=")">
+ #{deployment}
+ </foreach>
+ </if>
+ <if test="orQueryObject.dueDate != null">
+ or RES.DUE_DATE_ = #{orQueryObject.dueDate}
+ </if>
+ <if test="orQueryObject.dueBefore != null">
+ or (RES.DUE_DATE_ < #{orQueryObject.dueBefore} and RES.DUE_DATE_ is not null)
+ </if>
+ <if test="orQueryObject.dueAfter != null">
+ or (RES.DUE_DATE_ > #{orQueryObject.dueAfter} and RES.DUE_DATE_ is not null)
+ </if>
+ <if test="orQueryObject.withoutDueDate">
+ or RES.DUE_DATE_ is null
+ </if>
+ <if test="orQueryObject.category != null">
+ or RES.CATEGORY_ = #{orQueryObject.category}
+ </if>
+ <if test="orQueryObject.excludeSubtasks">
+ or RES.PARENT_TASK_ID_ IS NULL
+ </if>
+
+ <if test="!orQueryObject.bothCandidateAndAssigned && (orQueryObject.candidateUser != null || orQueryObject.candidateGroups != null)">
+ or (
+ <if test="!orQueryObject.ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ I_OR${orIndex}.TYPE_ = 'candidate'
+ and
+ (
+ <if test="orQueryObject.candidateUser != null">
+ I_OR${orIndex}.USER_ID_ = #{orQueryObject.candidateUser}
+ </if>
+ <if test="orQueryObject.candidateUser != null && orQueryObject.candidateGroups != null && orQueryObject.candidateGroups.size() > 0">
+ or
+ </if>
+ <if test="orQueryObject.candidateGroups != null && orQueryObject.candidateGroups.size() > 0">
+ I_OR${orIndex}.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="orQueryObject.candidateGroups"
+ open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ ))
+ </if>
+ <if test="orQueryObject.involvedUser != null">
+ or (
+ exists(select LINK.USER_ID_ from ${prefix}ACT_RU_IDENTITYLINK LINK where USER_ID_ = #{orQueryObject.involvedUser} and LINK.TASK_ID_ = RES.ID_)
+ or RES.ASSIGNEE_ = #{orQueryObject.involvedUser}
+ or RES.OWNER_ = #{orQueryObject.involvedUser}
+ )
+ </if>
+ <foreach item="var" collection="orQueryObject.queryVariableValues" index="index">
+ or
+ <trim prefix="(" prefixOverrides="AND" suffix=")">
+ <choose>
+ <when test="var.operator.equals('EXISTS')">
+ and EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <when test="var.operator.equals('NOT_EXISTS')">
+ and NOT EXISTS (
+ select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{var.name}
+ <if test="!var.local">
+ and RES.PROC_INST_ID_ = PROC_INST_ID_ and TASK_ID_ is null
+ </if>
+ <if test="var.local">
+ and RES.ID_ = TASK_ID_
+ </if>
+ )
+ </when>
+ <otherwise>
+ <choose>
+ <when test="!var.local">
+ <bind name="orLocal" value="''" />
+ <!-- When process instance variable is queried for, taskId should be null -->
+ and A_OR${orIndex}.TASK_ID_ is null
+ </when>
+ <otherwise>
+ <bind name="orLocal" value="'L_'" />
+ </otherwise>
+ </choose>
+ <if test="var.name != null">
+ <!-- Match-all variable-names when name is null -->
+ and A_${orLocal}OR${orIndex}.NAME_= #{var.name}
+ </if>
+ <if test="var.name == null">
+ and A_${orLocal}OR${orIndex}.NAME_ is not null
+ </if>
+ <if test="!var.type.equals('null')">
+ and A_${orLocal}OR${orIndex}.TYPE_ = #{var.type}
+ </if>
+ <!-- Variable value -->
+ <if test="var.textValue != null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('EQUALS_IGNORE_CASE') || var.operator.equals('NOT_EQUALS_IGNORE_CASE') || var.operator.equals('LIKE_IGNORE_CASE')">
+ and lower(A_${orLocal}OR${orIndex}.TEXT_)
+ </when>
+ <otherwise>
+ and A_${orLocal}OR${orIndex}.TEXT_
+ </otherwise>
+ </choose>
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue}
+ <choose>
+ <when test="var.operator.equals('LIKE') || var.operator.equals('LIKE_IGNORE_CASE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.textValue2 != null">
+ and A_${orLocal}OR${orIndex}.TEXT2_
+ <choose>
+ <when test="var.operator.equals('LIKE')">LIKE</when>
+ <otherwise>
+ <include refid="executionVariableOperator" />
+ </otherwise>
+ </choose>
+ #{var.textValue2}
+ <choose>
+ <when test="var.operator.equals('LIKE')">${wildcardEscapeClause}</when>
+ </choose>
+ </if>
+ <if test="var.longValue != null">
+ and A_${orLocal}OR${orIndex}.LONG_
+ <include refid="executionVariableOperator" />
+ #{var.longValue}
+ </if>
+ <if test="var.doubleValue != null">
+ and A_${orLocal}OR${orIndex}.DOUBLE_
+ <include refid="executionVariableOperator" />
+ #{var.doubleValue}
+ </if>
+ <!-- Null variable type -->
+ <if test="var.textValue == null && var.textValue2 == null && var.longValue == null && var.doubleValue == null">
+ <choose>
+ <when test="var.operator.equals('NOT_EQUALS')">
+ and (A_${orLocal}OR${orIndex}.TEXT_ is not null or A_${orLocal}OR${orIndex}.TEXT2_ is not null or A_${orLocal}OR${orIndex}.LONG_ is not null or A_${orLocal}OR${orIndex}.DOUBLE_ is not null or A_${orLocal}OR${orIndex}.BYTEARRAY_ID_ is not null)
+ </when>
+ <otherwise>
+ and A_${orLocal}OR${orIndex}.TEXT_ is null and A_${orLocal}OR${orIndex}.TEXT2_ is null and A_${orLocal}OR${orIndex}.LONG_ is null and A_${orLocal}OR${orIndex}.DOUBLE_ is null and A_${orLocal}OR${orIndex}.BYTEARRAY_ID_ is null
+ </otherwise>
+ </choose>
+ </if>
+ </otherwise>
+ </choose>
+ </trim>
+ </foreach>
+ <if test="orQueryObject.suspensionState != null">
+ <if test="orQueryObject.suspensionState.stateCode == 1">
+ or RES.SUSPENSION_STATE_ = 1
+ </if>
+ <if test="orQueryObject.suspensionState.stateCode == 2">
+ or RES.SUSPENSION_STATE_ = 2
+ </if>
+ </if>
+ <if test="orQueryObject.tenantId != null">
+ or RES.TENANT_ID_ = #{orQueryObject.tenantId}
+ </if>
+ <if test="orQueryObject.tenantIdLike != null">
+ or RES.TENANT_ID_ like #{orQueryObject.tenantIdLike}${wildcardEscapeClause}
+ </if>
+ <if test="orQueryObject.withoutTenantId">
+ or (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null)
+ </if>
+ <choose>
+ <when test="orQueryObject.bothCandidateAndAssigned">
+ <!-- if dbIdentityUsed set true in process engine configuration -->
+ <if test="orQueryObject.userIdForCandidateAndAssignee != null">
+ <if test="orQueryObject.candidateGroups == null">
+ or (RES.ASSIGNEE_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ or (
+ <if test="!orQueryObject.ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ (I_OR${orIndex}.USER_ID_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ or I_OR${orIndex}.GROUP_ID_ IN (select g.GROUP_ID_ from ${prefix}ACT_ID_MEMBERSHIP g where g.USER_ID_ = #{orQueryObject.userIdForCandidateAndAssignee} ) ) ) )
+ </if>
+ </if>
+ <!-- if dbIdentityUsed set false in process engine configuration of using custom session factory of GroupIdentityManager -->
+ <if test="orQueryObject.candidateGroups != null">
+ or (RES.ASSIGNEE_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ or (
+ <if test="!orQueryObject.ignoreAssigneeValue">
+ RES.ASSIGNEE_ is null and
+ </if>
+ I_OR${orIndex}.TYPE_ = 'candidate' and (I_OR${orIndex}.USER_ID_ = #{orQueryObject.userIdForCandidateAndAssignee}
+ <if test="orQueryObject.candidateGroups.size() > 0">
+ or I_OR${orIndex}.GROUP_ID_ IN
+ <foreach item="group" index="index" collection="orQueryObject.candidateGroups" open="(" separator="," close=")">
+ #{group}
+ </foreach>
+ </if>
+ )))
+ </if>
+ </when>
+ </choose>
+ </trim>
+ </foreach>
+ </where>
+ </sql>
+
+ <sql id="executionVariableOperator">
+ <choose>
+ <when test="var.operator.equals('EQUALS')">=</when>
+ <when test="var.operator.equals('EQUALS_IGNORE_CASE')">=</when>
+ <when test="var.operator.equals('NOT_EQUALS')"><></when>
+ <when test="var.operator.equals('NOT_EQUALS_IGNORE_CASE')"><></when>
+ <when test="var.operator.equals('GREATER_THAN')">></when>
+ <when test="var.operator.equals('GREATER_THAN_OR_EQUAL')">>=</when>
+ <when test="var.operator.equals('LESS_THAN')"><</when>
+ <when test="var.operator.equals('LESS_THAN_OR_EQUAL')"><=</when>
+ </choose>
+ </sql>
+
+ <select id="selectTaskByNativeQuery" parameterType="java.util.Map" resultMap="taskResultMap">
+ <include refid="org.flowable.task.service.db.common.selectByNativeQuery"/>
+ </select>
+
+ <select id="selectTaskCountByNativeQuery" parameterType="java.util.Map" resultType="long">
+ ${sql}
+ </select>
+
+</mapper>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml
new file mode 100644
index 0000000..1dd6888
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/org/apache/syncope/ext/flowable/mappings.xml
@@ -0,0 +1,73 @@
+<?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.
+-->
+<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
+
+<configuration>
+
+ <settings>
+ <setting name="lazyLoadingEnabled" value="false" />
+ </settings>
+ <typeAliases>
+ <typeAlias type="org.flowable.engine.impl.persistence.ByteArrayRefTypeHandler" alias="ByteArrayRefTypeHandler" />
+ <typeAlias type="org.flowable.variable.service.impl.persistence.VariableByteArrayRefTypeHandler" alias="VariableByteArrayRefTypeHandler" />
+ <typeAlias type="org.flowable.job.service.impl.persistence.JobByteArrayRefTypeHandler" alias="JobByteArrayRefTypeHandler" />
+ </typeAliases>
+ <typeHandlers>
+ <typeHandler handler="ByteArrayRefTypeHandler" javaType="org.flowable.engine.impl.persistence.entity.ByteArrayRef" jdbcType="VARCHAR" />
+ <typeHandler handler="VariableByteArrayRefTypeHandler" javaType="org.flowable.variable.service.impl.persistence.entity.VariableByteArrayRef" jdbcType="VARCHAR" />
+ <typeHandler handler="JobByteArrayRefTypeHandler" javaType="org.flowable.job.service.impl.persistence.entity.JobByteArrayRef" jdbcType="VARCHAR" />
+ </typeHandlers>
+
+ <mappers>
+ <mapper resource="org/flowable/db/mapping/common.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Attachment.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/ByteArray.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/common.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/entity/ByteArray.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/ByteArray.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Comment.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/DeadLetterJob.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Deployment.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Execution.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/HistoricActivityInstance.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/HistoricDetail.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/HistoricProcessInstance.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/entity/HistoricVariableInstance.xml" />
+ <mapper resource="org/flowable/task/service/db/mapping/entity/HistoricTaskInstance.xml" />
+ <mapper resource="org/flowable/identitylink/service/db/mapping/entity/HistoricIdentityLink.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/HistoryJob.xml" />
+ <mapper resource="org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/Job.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Model.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/ProcessDefinition.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/ProcessDefinitionInfo.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Property.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/Resource.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/SuspendedJob.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/TableData.xml" />
+ <mapper resource="org/flowable/task/service/db/mapping/common.xml" />
+ <mapper resource="org/apache/syncope/ext/flowable/Task.xml" />
+ <mapper resource="org/flowable/job/service/db/mapping/entity/TimerJob.xml" />
+ <mapper resource="org/flowable/variable/service/db/mapping/entity/VariableInstance.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/EventSubscription.xml" />
+ <mapper resource="org/flowable/db/mapping/entity/EventLogEntry.xml" />
+ </mappers>
+
+</configuration>
\ No newline at end of file
[04/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/console-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/console-reference/pom.xml b/fit/console-reference/pom.xml
index 8f98203..ca8d1e1 100644
--- a/fit/console-reference/pom.xml
+++ b/fit/console-reference/pom.xml
@@ -58,6 +58,12 @@ under the License.
</dependency>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-client-console</artifactId>
<version>${project.version}</version>
@@ -123,12 +129,6 @@ under the License.
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-ui-modeler-app</artifactId>
- <type>war</type>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.syncope.fit</groupId>
<artifactId>syncope-fit-build-tools</artifactId>
<version>${project.version}</version>
@@ -145,58 +145,7 @@ under the License.
</dependencies>
<build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>setupFlowableModeler</id>
- <phase>process-resources</phase>
- <configuration>
- <target>
- <unzip src="${settings.localRepository}/org/flowable/flowable-ui-modeler-app/${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war" dest="${flowable-modeler.directory}">
- <patternset>
- <include name="WEB-INF/classes/static/**" />
- <include name="WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" />
- </patternset>
- </unzip>
-
- <unzip src="${flowable-modeler.directory}/WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" dest="${flowable-modeler.directory}">
- <patternset>
- <include name="stencilset_bpmn.json" />
- </patternset>
- </unzip>
-
- <move todir="${flowable-modeler.directory}">
- <fileset dir="${flowable-modeler.directory}/WEB-INF/classes/static/">
- <include name="**" />
- </fileset>
- </move>
- <delete dir="${flowable-modeler.directory}/WEB-INF" />
-
- <replace file="${flowable-modeler.directory}/index.html" token="</head>" value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>" />
- <replace file="${flowable-modeler.directory}/index.html" token=" ng-click="backToLanding()"" value=" disabled="disabled"" />
- <replace file="${flowable-modeler.directory}/index.html" token="<ul class="nav navbar-nav" id="main-nav"" value="<ul class="nav navbar-nav" id="main-nav" style="display: none;"" />
- <replace file="${flowable-modeler.directory}/index.html" token="<div class="pull-right" value="<div style="display: none;" class="pull-right" />
- <replace file="${flowable-modeler.directory}/editor-app/editor.html" token="<div class="btn-group pull-right"" value="<div style="display: none;" class="btn-group pull-right"" />
- <replace file="${flowable-modeler.directory}/editor-app/configuration/toolbar-default-actions.js" token="$location.path('/processes');" value="window.close();" />
-
- <copy file="${basedir}/src/main/resources/app-cfg.js" todir="${flowable-modeler.directory}/scripts" overwrite="true" />
- <copy file="${basedir}/src/main/resources/url-config.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
- <copy file="${basedir}/src/main/resources/toolbar.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
- <copy file="${basedir}/src/main/resources/save-model.html" todir="${flowable-modeler.directory}/editor-app/popups" overwrite="true" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
+ <plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/console-reference/src/main/resources/app-cfg.js
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/app-cfg.js b/fit/console-reference/src/main/resources/app-cfg.js
deleted file mode 100644
index 15ec23a..0000000
--- a/fit/console-reference/src/main/resources/app-cfg.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2005-2015 Alfresco Software, Ltd.
- *
- * Licensed 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.
- */
-
-'use strict';
-
-var FLOWABLE = FLOWABLE || {};
-
-FLOWABLE.CONFIG = {
- 'onPremise' : true,
- 'contextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler')) + '/flowable-modeler',
- 'webContextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler') + '/flowable-modeler'),
- 'datesLocalization' : false
-};
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/console-reference/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/console.properties b/fit/console-reference/src/main/resources/console.properties
index 18c424f..484a331 100644
--- a/fit/console-reference/src/main/resources/console.properties
+++ b/fit/console-reference/src/main/resources/console.properties
@@ -33,15 +33,12 @@ maxWaitTimeOnApplyChanges=30
csrf=true
-flowableModelerDirectory=${flowable-modeler.directory}
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
page.realms=org.apache.syncope.client.console.pages.Realms
page.topology=org.apache.syncope.client.console.topology.Topology
page.reports=org.apache.syncope.client.console.pages.Reports
-page.workflow=org.apache.syncope.client.console.pages.Workflow
page.audit=org.apache.syncope.client.console.pages.Audit
page.implementations=org.apache.syncope.client.console.pages.Implementations
page.logs=org.apache.syncope.client.console.pages.Logs
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/console-reference/src/main/resources/save-model.html
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/save-model.html b/fit/console-reference/src/main/resources/save-model.html
deleted file mode 100644
index abd5ecf..0000000
--- a/fit/console-reference/src/main/resources/save-model.html
+++ /dev/null
@@ -1,132 +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.
--->
-<div class="modal" ng-controller="SaveModelCtrl">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h2>{{'MODEL.SAVE.TITLE'| translate}}</h2>
- </div>
- <div class="modal-body">
- <div ng-if="saveDialog.errorMessage && saveDialog.errorMessage.length > 0" class="alert error" style="font-size: 14px; margin-top:20px">
- <div class="popup-error" style="font-size: 14px">
- <span class="glyphicon glyphicon-remove-circle"></span>
- <span>{{saveDialog.errorMessage}}</span>
- </div>
- </div>
- <div class="form-group">
- <label for="nameField">{{'MODEL.NAME'| translate}}</label>
- <input type="text"
- ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
- id="nameField"
- class="form-control"
- ng-model="saveDialog.name" readonly="readonly"
- auto-focus />
- </div>
- <div class="form-group" style="display: none">
- <label for="keyField">{{'MODEL.KEY'| translate}}</label>
- <input type="text"
- ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
- id="keyField"
- class="form-control"
- ng-model="saveDialog.key" ng-init="saveDialog.key = saveDialog.name"/>
- </div>
- <div class="form-group" style="display: none">
- <label for="docTextArea">{{'MODEL.DESCRIPTION'| translate}}</label>
- <textarea id="docTextArea" ng-disabled="status.loading" class="form-control" ng-model="saveDialog.description"></textarea>
- </div>
- <div class="checkbox" ng-show="!error && !error.isConflict" style="display: none">
- <label>
- <input type="checkbox" ng-disabled="status.loading" ng-model="saveDialog.newVersion" >
- {{'MODEL.SAVE.NEWVERSION'| translate}}
- </label>
- </div>
- <div class="form-group" ng-if="saveDialog.newVersion">
- <label for="commentTextArea">{{'MODEL.SAVE.COMMENT'| translate}}</label>
- <textarea id="commentTextArea" class="form-control" ng-model="saveDialog.comment" ng-disabled="status.loading"></textarea>
- </div>
-
- <div ng-if="saveDialog.validationErrors" class="alert error" style="font-size: 14px; margin-top:20px">
-
- <div class="popup-error" style="font-size: 14px">
- <span class="glyphicon glyphicon-remove-circle"></span>
- <span>{{'MODEL.VALIDATIONERRORS'| translate:error}}</span>
- </div>
- </div>
-
- <div ng-if="error && error.isConflict && !status.loading" class="alert error" style="font-size: 14px; margin-top:20px">
-
- <div class="popup-error" style="font-size: 14px">
- <span class="glyphicon glyphicon-remove-circle"></span>
- <span>{{'MODEL.CONFLICT.WRITE'| translate:error}}</span>
- </div>
-
- <div>
-
- <div style="font-size: 14px; margin-bottom: 10px">{{'MODEL.CONFLICT.WRITE.OPTIONS'| translate}}</div>
- <div class="btn-group" data-toggle="buttons">
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'overwrite'">
- <input type="radio" name="options" id="option1">
- {{'MODEL.CONFLICT.WRITE.OPTION.OVERWRITE'| translate}}
- </label>
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'discardChanges'">
- <input type="radio" name="options" id="option2">
- {{'MODEL.CONFLICT.WRITE.OPTION.DISCARDCHANGES'| translate}}
- </label>
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'saveAs'">
- <input type="radio" name="options" id="option3" ng-disabled="account.type != 'enterprise'">
- {{'MODEL.CONFLICT.WRITE.OPTION.SAVEAS'| translate}}
- </label>
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'newVersion'">
- <input type="radio" name="options" id="optio43">
- {{'MODEL.CONFLICT.WRITE.OPTION.NEWVERSION'| translate}}
- </label>
- </div>
-
- <div ng-if="error.conflictResolveAction == 'saveAs'" style="margin-top: 10px">
- <span>{{'MODEL.CONFLICT.SAVEAS'| translate}}</span>
- <input type="text" ng-model="error.saveAs" style="width: 300px" auto-focus>
- </div>
- </div>
-
- </div>
-
- </div>
- <div class="modal-footer">
-
- <div class="pull-right">
- <button type="button" class="btn" ng-click="close()" ng-disabled="status.loading" translate>ACTION.CANCEL</button>
- <button class="btn btn-primary" ng-click="saveAndClose()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" translate>ACTION.SAVE-AND-CLOSE</button>
- <button class="btn btn-primary" ng-click="save()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" style="display: none" translate>ACTION.SAVE</button>
- <button class="btn btn-primary" ng-click="okClicked()" ng-disabled="isOkButtonDisabled()" ng-show="error && error.isConflict" translate>ACTION.OK</button>
- </div>
-
- <div class="pull-right popup-error" ng-if="error && !error.isConflict">
- <span>{{'MODEL.SAVE.ERROR'| translate}}</span>
- </div>
-
- <loading></loading>
-
- </div>
- </div>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/console-reference/src/main/resources/toolbar.js
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/toolbar.js b/fit/console-reference/src/main/resources/toolbar.js
deleted file mode 100644
index 920718c..0000000
--- a/fit/console-reference/src/main/resources/toolbar.js
+++ /dev/null
@@ -1,181 +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.
- */
-'use strict';
-
-var FLOWABLE = FLOWABLE || {};
-FLOWABLE.TOOLBAR_CONFIG = {
- "items" : [
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "editor-icon editor-icon-save",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.saveModel"
- },
- {
- "type" : "separator",
- "title" : "",
- "cssClass" : "toolbar-separator"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.CUT",
- "cssClass" : "editor-icon editor-icon-cut",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.cut",
- "enabled" : false,
- "enabledAction" : "element"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.COPY",
- "cssClass" : "editor-icon editor-icon-copy",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.copy",
- "enabled" : false,
- "enabledAction" : "element"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.PASTE",
- "cssClass" : "editor-icon editor-icon-paste",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.paste",
- "enabled" : false
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.DELETE",
- "cssClass" : "editor-icon editor-icon-delete",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.deleteItem",
- "enabled" : false,
- "enabledAction" : "element"
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.REDO",
- "cssClass" : "editor-icon editor-icon-redo",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.redo",
- "enabled" : false
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.UNDO",
- "cssClass" : "editor-icon editor-icon-undo",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.undo",
- "enabled" : false
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ALIGNVERTICAL",
- "cssClass" : "editor-icon editor-icon-align-vertical",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignVertical",
- "enabled" : false,
- "enabledAction" : "element",
- "disableInForm" : true,
- "minSelectionCount" : 2
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ALIGNHORIZONTAL",
- "cssClass" : "editor-icon editor-icon-align-horizontal",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignHorizontal",
- "enabledAction" : "element",
- "enabled" : false,
- "disableInForm" : true,
- "minSelectionCount" : 2
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.SAMESIZE",
- "cssClass" : "editor-icon editor-icon-same-size",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.sameSize",
- "enabledAction" : "element",
- "enabled" : false,
- "disableInForm" : true,
- "minSelectionCount" : 2
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator",
- "disableInForm" : true
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMIN",
- "cssClass" : "editor-icon editor-icon-zoom-in",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomIn"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMOUT",
- "cssClass" : "editor-icon editor-icon-zoom-out",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomOut"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMACTUAL",
- "cssClass" : "editor-icon editor-icon-zoom-actual",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomActual"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMFIT",
- "cssClass" : "editor-icon editor-icon-zoom-fit",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomFit"
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator",
- "disableInForm" : true
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.BENDPOINT.ADD",
- "cssClass" : "editor-icon editor-icon-bendpoint-add",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.addBendPoint",
- "id" : "add-bendpoint-button",
- "disableInForm" : true
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.BENDPOINT.REMOVE",
- "cssClass" : "editor-icon editor-icon-bendpoint-remove",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.removeBendPoint",
- "id" : "remove-bendpoint-button",
- "disableInForm" : true
- },
- {
- "type" : "separator",
- "title": "",
- "cssClass" : "toolbar-separator",
- "disableInForm" : true
- }
- ],
-
- "secondaryItems" : []
-};
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/console-reference/src/main/resources/url-config.js
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/url-config.js b/fit/console-reference/src/main/resources/url-config.js
deleted file mode 100644
index 6bf8979..0000000
--- a/fit/console-reference/src/main/resources/url-config.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Licensed 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.
- */
-var FLOWABLE = FLOWABLE || {};
-
-FLOWABLE.URL = {
-
- getModel: function(modelId) {
- return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
- + "/workflowDefGET?modelId=" + modelId;
- },
-
- getStencilSet: function() {
- return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
- + "/flowable-modeler/stencilset_bpmn.json";
- },
-
- getCmmnStencilSet: function() {
- return FLOWABLE.CONFIG.contextRoot + '/app/rest/stencil-sets/cmmneditor?version=' + Date.now();
- },
-
- putModel: function(modelId) {
- return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
- + "/workflowDefPUT?modelId=" + modelId;
- },
-
- validateModel: function(){
- return FLOWABLE.CONFIG.contextRoot + '/app/rest/model/validate';
- }
-};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/console-reference/src/test/resources/hotswap-agent.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/test/resources/hotswap-agent.properties b/fit/console-reference/src/test/resources/hotswap-agent.properties
index a2e489e..56ea8cc 100644
--- a/fit/console-reference/src/test/resources/hotswap-agent.properties
+++ b/fit/console-reference/src/test/resources/hotswap-agent.properties
@@ -22,6 +22,7 @@ autoHotswap=true
extraClasspath=\
${basedir}/../../client/console/target/classes/org,\
${basedir}/../../ext/camel/client-console/target/classes/org,\
+${basedir}/../../ext/flowable/client-console/target/classes/org,\
${basedir}/../../ext/saml2sp/client-console/target/classes/org,\
${basedir}/../../ext/scimv2/client-console/target/classes/org,\
${basedir}/../../ext/oidcclient/client-console/target/classes/org
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/pom.xml b/fit/core-reference/pom.xml
index 80851f5..c89241e 100644
--- a/fit/core-reference/pom.xml
+++ b/fit/core-reference/pom.xml
@@ -138,6 +138,18 @@ under the License.
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-rest-cxf</artifactId>
<version>${project.version}</version>
@@ -1466,8 +1478,8 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java
new file mode 100644
index 0000000..abdfcb6
--- /dev/null
+++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java
@@ -0,0 +1,63 @@
+/*
+ * 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.reference;
+
+import org.apache.syncope.common.lib.patch.MembershipPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.apache.syncope.core.flowable.task.AbstractFlowableServiceTask;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class AssignDirectorGroup extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ Boolean secondLevelApprove = engine.getRuntimeService().
+ getVariable(executionId, "secondLevelApprove", Boolean.class);
+ if (Boolean.TRUE.equals(secondLevelApprove)) {
+ user = userDAO.save(user);
+
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(user.getKey());
+ userPatch.getMemberships().add(new MembershipPatch.Builder().
+ group("ebf97068-aa4b-4a85-9f01-680e8c4cf227").build());
+
+ PropagationByResource propByRes = dataBinder.update(user, userPatch);
+
+ // report updated user and propagation by resource as result
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ } else {
+ LOG.info("Second level was not approved, not assigning the director group to " + user.getUsername());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/main/resources/all/workflow.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/all/workflow.properties b/fit/core-reference/src/main/resources/all/workflow.properties
index 36af01c..be8a7bb 100644
--- a/fit/core-reference/src/main/resources/all/workflow.properties
+++ b/fit/core-reference/src/main/resources/all/workflow.properties
@@ -16,6 +16,6 @@
# under the License.
wf.directory=${conf.directory}
historyLevel=activity
-uwfAdapter=org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter
+uwfAdapter=org.apache.syncope.core.flowable.impl.FlowableUserWorkflowAdapter
gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter
awfAdapter=org.apache.syncope.core.workflow.java.DefaultAnyObjectWorkflowAdapter
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/main/resources/all/workflowTestContext.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/all/workflowTestContext.xml b/fit/core-reference/src/main/resources/all/workflowTestContext.xml
new file mode 100644
index 0000000..2329c53
--- /dev/null
+++ b/fit/core-reference/src/main/resources/all/workflowTestContext.xml
@@ -0,0 +1,27 @@
+<?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="assignDirectorGroup" class="org.apache.syncope.fit.core.reference.AssignDirectorGroup"/>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml b/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml
new file mode 100644
index 0000000..fd482b5
--- /dev/null
+++ b/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml
@@ -0,0 +1,104 @@
+<?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:flowable="http://flowable.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://www.flowable.org/processdef">
+
+ <process id="directorGroupRequest" name="Assign director group" isExecutable="true">
+ <startEvent id="startevent1" name="Start"/>
+ <endEvent id="endevent1" name="End"/>
+ <userTask id="firstApproval" name="First approval" flowable:formKey="firstApproval" flowable:candidateGroups="managingDirector">
+ <extensionElements>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
+ <flowable:formProperty id="firstLevelApprove" name="Approve?" type="boolean" variable="firstLevelApprove" required="true"/>
+ <flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+ </extensionElements>
+ </userTask>
+ <userTask id="secondApproval" name="Second approval" flowable:formKey="secondApproval" flowable:candidateGroups="root">
+ <extensionElements>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
+ <flowable:formProperty id="secondLevelApprove" name="Approve?" type="boolean" variable="secondLevelApprove" required="true"/>
+ <flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+ </extensionElements>
+ </userTask>
+ <serviceTask id="assignDirectorGroup" name="Assign director group" flowable:expression="#{assignDirectorGroup.execute(execution.processInstanceId)}"/>
+ <exclusiveGateway id="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" default="sid-338A4B20-89E9-46B2-8AB3-36291455051B"/>
+ <sequenceFlow id="sid-A7C20EB5-AAE6-4CF3-A151-F1A9FA9207A0" sourceRef="firstApproval" targetRef="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15"/>
+ <sequenceFlow id="sid-92E7D60C-09E7-465A-8115-C60ACD06E955" sourceRef="secondApproval" targetRef="assignDirectorGroup"/>
+ <sequenceFlow id="sid-90AAE913-A229-4136-8C1D-AB5A78ACE209" sourceRef="assignDirectorGroup" targetRef="endevent1"/>
+ <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="firstApproval"/>
+ <sequenceFlow id="sid-338A4B20-89E9-46B2-8AB3-36291455051B" sourceRef="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" targetRef="secondApproval"/>
+ <sequenceFlow id="sid-D43EBA31-49F5-4305-B71D-122E98D1DE22" sourceRef="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" targetRef="endevent1">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!firstLevelApprove}]]></conditionExpression>
+ </sequenceFlow>
+ </process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_directorGroupRequest">
+ <bpmndi:BPMNPlane bpmnElement="directorGroupRequest" id="BPMNPlane_directorGroupRequest">
+ <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+ <omgdc:Bounds height="30.0" width="30.0" x="180.0" y="130.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+ <omgdc:Bounds height="28.0" width="28.0" x="711.0" y="131.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="firstApproval" id="BPMNShape_firstApproval">
+ <omgdc:Bounds height="80.0" width="100.0" x="300.0" y="105.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="secondApproval" id="BPMNShape_secondApproval">
+ <omgdc:Bounds height="80.0" width="100.0" x="480.0" y="235.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="assignDirectorGroup" id="BPMNShape_assignDirectorGroup">
+ <omgdc:Bounds height="80.0" width="100.0" x="675.0" y="235.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" id="BPMNShape_sid-1E2454BD-FAE9-4A15-B169-D41843A39C15">
+ <omgdc:Bounds height="40.0" width="40.0" x="510.0" y="125.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="209.94999837389875" y="145.0"/>
+ <omgdi:waypoint x="300.0" y="145.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-338A4B20-89E9-46B2-8AB3-36291455051B" id="BPMNEdge_sid-338A4B20-89E9-46B2-8AB3-36291455051B">
+ <omgdi:waypoint x="530.4263565891473" y="164.51605344694036"/>
+ <omgdi:waypoint x="530.1542471042471" y="235.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-90AAE913-A229-4136-8C1D-AB5A78ACE209" id="BPMNEdge_sid-90AAE913-A229-4136-8C1D-AB5A78ACE209">
+ <omgdi:waypoint x="725.0" y="235.0"/>
+ <omgdi:waypoint x="725.0" y="158.9499300542635"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-92E7D60C-09E7-465A-8115-C60ACD06E955" id="BPMNEdge_sid-92E7D60C-09E7-465A-8115-C60ACD06E955">
+ <omgdi:waypoint x="579.9499999997585" y="275.0"/>
+ <omgdi:waypoint x="674.9999999998254" y="275.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-D43EBA31-49F5-4305-B71D-122E98D1DE22" id="BPMNEdge_sid-D43EBA31-49F5-4305-B71D-122E98D1DE22">
+ <omgdi:waypoint x="549.49393353939" y="145.45103092783506"/>
+ <omgdi:waypoint x="711.0000424606164" y="145.03586113839918"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-A7C20EB5-AAE6-4CF3-A151-F1A9FA9207A0" id="BPMNEdge_sid-A7C20EB5-AAE6-4CF3-A151-F1A9FA9207A0">
+ <omgdi:waypoint x="399.9499999999431" y="145.0"/>
+ <omgdi:waypoint x="510.0" y="145.0"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
[03/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 0e68735..295dacf 100644
--- a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
+++ b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml
@@ -32,26 +32,14 @@ under the License.
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
<serviceTask id="create" name="Create" flowable: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' || flowableUtils.isUserIngroup(user, 'groupForWorkflowApproval')}]]>
- </conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW">
- <conditionExpression xsi:type="tFormalExpression">
- <![CDATA[${!flowableUtils.isUserIngroup(user, 'groupForWorkflowApproval')}]]>
- </conditionExpression>
- </sequenceFlow>
- <userTask id="createApproval" name="Create approval"
- flowable:candidateGroups="managingDirector" flowable:formKey="createApproval">
+ <exclusiveGateway id="createGW" default="create2Activate"/>
+ <userTask id="createApproval" name="Create approval" flowable:candidateGroups="managingDirector" flowable:formKey="createApproval">
<extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
<flowable:formProperty id="approveCreate" name="Approve?" type="boolean" variable="approveCreate" required="true"/>
<flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
</extensionElements>
</userTask>
- <sequenceFlow id="flow3" sourceRef="createApproval" targetRef="CreateApprovalEvaluation"/>
<scriptTask id="CreateApprovalEvaluation" name="Create approval evaluation" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
try {
@@ -68,33 +56,23 @@ try {
} catch(Exception te) {
execution.setVariable("task", null);
}
+} finally {
+ execution.removeVariable("approveCreate");
+ execution.removeVariable("rejectReason");
}]]></script>
</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"/>
- <sequenceFlow id="createApprovalGW2EnableGW" sourceRef="createApprovalGW" targetRef="enableGW">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'approve'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="createApproval2Reject" sourceRef="createApprovalGW" targetRef="reject">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'reject'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" sourceRef="createApprovalGW" targetRef="rejectedGw">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
- </sequenceFlow>
<exclusiveGateway id="enableGW"/>
- <sequenceFlow id="createApprovalGW2OptIn" sourceRef="enableGW" targetRef="generateToken">
- <conditionExpression xsi:type="tFormalExpression">
- <![CDATA[${flowableUtils.isUserIngroup(user, 'groupForWorkflowOptIn')}]]>
- </conditionExpression>
+ <sequenceFlow id="enableGW2GenerateToken" sourceRef="enableGW" targetRef="generateToken">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${flowableUtils.isUserIngroup(userTO, 'groupForWorkflowOptIn')}]]></conditionExpression>
</sequenceFlow>
- <sequenceFlow id="createApprovalGW2Activate" sourceRef="enableGW" targetRef="activate">
+ <sequenceFlow id="enableGW2Activate" sourceRef="enableGW" targetRef="activate">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled == null}]]></conditionExpression>
</sequenceFlow>
- <sequenceFlow id="createApprovalGW2Active" sourceRef="enableGW" targetRef="active">
+ <sequenceFlow id="enableGW2Active" sourceRef="enableGW" targetRef="active">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled}]]></conditionExpression>
</sequenceFlow>
- <sequenceFlow id="createApprovalGW2Suspended" sourceRef="enableGW" targetRef="suspend">
+ <sequenceFlow id="enableGW2Suspended" sourceRef="enableGW" targetRef="suspend">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!enabled}]]></conditionExpression>
</sequenceFlow>
<serviceTask id="activate" name="Activate" flowable:expression="#{autoActivate.execute(execution.processInstanceId)}"/>
@@ -112,7 +90,7 @@ try {
</sequenceFlow>
<scriptTask id="removeToken" name="Remove Token and Activate" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
- user.removeToken()
+ user.removeToken()
]]></script>
</scriptTask>
<sequenceFlow id="flow7" sourceRef="removeToken" targetRef="active"/>
@@ -141,15 +119,13 @@ try {
<sequenceFlow id="active2ConfirmPasswordReset" sourceRef="activeGw" targetRef="checkToken4ConfirmPasswordReset">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'confirmPasswordReset'}]]></conditionExpression>
</sequenceFlow>
- <userTask id="updateApproval" name="Update approval"
- flowable:candidateGroups="managingDirector" flowable:formKey="updateApproval">
+ <userTask id="updateApproval" name="Update approval" flowable:candidateGroups="managingDirector" flowable:formKey="updateApproval">
<extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
<flowable:formProperty id="approveUpdate" name="Approve?" type="boolean" variable="approveUpdate" required="true"/>
<flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
</extensionElements>
</userTask>
- <sequenceFlow id="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" sourceRef="updateApproval" targetRef="UpdateApprovalEvaluation"/>
<scriptTask id="UpdateApprovalEvaluation" name="Update approval evaluation" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
try {
@@ -166,9 +142,11 @@ try {
} catch(Exception te) {
execution.setVariable("task", null);
}
+} finally {
+ execution.removeVariable("approveUpdate");
+ execution.removeVariable("rejectReason");
}]]></script>
</scriptTask>
- <sequenceFlow id="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" sourceRef="UpdateApprovalEvaluation" targetRef="updateApprovalGW"/>
<exclusiveGateway id="updateApprovalGW" default="sid-E58BBC2D-8831-4CF2-A798-14B258FE569B"/>
<sequenceFlow id="sid-E58BBC2D-8831-4CF2-A798-14B258FE569B" sourceRef="updateApprovalGW" targetRef="updateApproval"/>
<sequenceFlow id="updateApprovalGW2Update" sourceRef="updateApprovalGW" targetRef="update">
@@ -188,28 +166,6 @@ try {
<sequenceFlow id="flow8ter" sourceRef="rejectUpdate" targetRef="active"/>
<serviceTask id="update" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
<sequenceFlow id="flow9" sourceRef="update" targetRef="active"/>
- <userTask id="recertificationRequest" name="Recertification Request"
- flowable:candidateGroups="managingDirector" flowable:formKey="recertify">
- <extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
- <flowable:formProperty id="approve" name="Recertify?" type="boolean" required="true"/>
- <flowable: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" flowable: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-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" flowable:expression="#{suspend.execute(execution.processInstanceId)}"/>
<sequenceFlow id="flow10" sourceRef="suspend" targetRef="suspended"/>
<userTask id="suspended" name="Suspended"/>
@@ -225,11 +181,11 @@ try {
<sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
<scriptTask id="reject" name="Reject" scriptFormat="groovy" flowable:autoStoreVariables="false">
<script><![CDATA[
- def scriptVar = rejectReason
- execution.setVariable("propByResource", null);
+ execution.removeVariable("userTO");
+ execution.removeVariable("encryptedPwd");
+ execution.removeVariable("propByResource");
]]></script>
</scriptTask>
- <sequenceFlow id="flow13" sourceRef="reject" targetRef="rejected"/>
<userTask id="rejected" name="Rejected"/>
<sequenceFlow id="flow14" sourceRef="rejected" targetRef="rejectedGw"/>
<exclusiveGateway id="rejectedGw"/>
@@ -239,10 +195,9 @@ try {
<sequenceFlow id="rejected2Rejected" sourceRef="rejectedGw" targetRef="rejected">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${empty task}]]></conditionExpression>
</sequenceFlow>
- <userTask id="deleteApproval" name="Delete approval"
- flowable:candidateGroups="managingDirector" flowable:formKey="deleteApproval">
+ <userTask id="deleteApproval" name="Delete approval" flowable:candidateGroups="managingDirector" flowable:formKey="deleteApproval">
<extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
<flowable:formProperty id="approveDelete" name="Approve?" type="boolean" variable="approveDelete" required="true"/>
<flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
</extensionElements>
@@ -272,434 +227,475 @@ try {
<serviceTask id="delete" name="Delete" flowable:expression="#{delete.execute(execution.processInstanceId)}"/>
<sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
<endEvent id="theEnd"/>
+ <serviceTask id="updateWhilePendingCreateApproval" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-76B82B68-099D-4729-B8CF-D028386FE900" sourceRef="createApprovalGW" targetRef="createApproval"/>
+ <sequenceFlow id="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" sourceRef="createApprovalGW" targetRef="rejectedGw">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+ </sequenceFlow>
+ <exclusiveGateway id="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" default="flow3"/>
+ <sequenceFlow id="flow13" sourceRef="reject" targetRef="rejected"/>
+ <sequenceFlow id="createApprovalGW2EnableGW" sourceRef="createApprovalGW" targetRef="enableGW">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'approve'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="createApproval2Reject" sourceRef="createApprovalGW" targetRef="reject">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'reject'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW"/>
+ <sequenceFlow id="flow3" sourceRef="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" targetRef="CreateApprovalEvaluation"/>
+ <sequenceFlow id="sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991" sourceRef="CreateApprovalEvaluation" targetRef="createApprovalGW"/>
+ <sequenceFlow id="createAsAnonymous2Approval" sourceRef="createGW" targetRef="createApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == 'anonymous' || flowableUtils.isUserIngroup(userTO, 'groupForWorkflowApproval')}]]></conditionExpression>
+ </sequenceFlow>
+ <serviceTask id="updateWhilePendingUpdateApproval" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
+ <exclusiveGateway id="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" default="sid-12E29B94-C369-45C1-BCEF-C165AFDA525A"/>
+ <sequenceFlow id="sid-930DADF1-C361-43DD-A240-582F21DEB9B6" sourceRef="createApproval" targetRef="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7"/>
+ <sequenceFlow id="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" sourceRef="updateApproval" targetRef="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07"/>
+ <sequenceFlow id="sid-66CDB1C4-7C2F-4BAE-9834-84CF0CF52BF3" sourceRef="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" targetRef="updateWhilePendingUpdateApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'update'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="sid-C9FA59AF-4F39-489E-B424-5C06B15AE317" sourceRef="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" targetRef="updateWhilePendingCreateApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'update'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="sid-F746E78F-F59B-4842-9D88-C9C79474FC06" sourceRef="updateWhilePendingCreateApproval" targetRef="createApproval"/>
+ <sequenceFlow id="sid-1D0DA593-85D7-412B-8DA3-79DC0CE00E1D" sourceRef="updateWhilePendingUpdateApproval" targetRef="updateApproval"/>
+ <sequenceFlow id="sid-12E29B94-C369-45C1-BCEF-C165AFDA525A" sourceRef="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" targetRef="UpdateApprovalEvaluation"/>
+ <sequenceFlow id="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" sourceRef="UpdateApprovalEvaluation" targetRef="updateApprovalGW"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
<bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
<bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
- <omgdc:Bounds height="35.0" width="35.0" x="333.0" y="252.0"></omgdc:Bounds>
+ <omgdc:Bounds height="30.0" width="30.0" x="333.0" y="252.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
- <omgdc:Bounds height="60.0" width="100.0" x="300.0" y="323.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="300.0" y="323.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="createGW" id="BPMNShape_createGW">
- <omgdc:Bounds height="40.0" width="40.0" x="330.0" y="507.0"></omgdc:Bounds>
+ <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="420.0" y="560.0"></omgdc:Bounds>
+ <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"></omgdc:Bounds>
+ <omgdc:Bounds height="80.0" width="100.0" x="477.5" y="765.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="createApprovalGW" id="BPMNShape_createApprovalGW">
- <omgdc:Bounds height="40.0" width="40.0" x="570.0" y="570.0"></omgdc:Bounds>
+ <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="690.0" y="429.0"></omgdc:Bounds>
+ <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="810.0" y="610.0"></omgdc:Bounds>
+ <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="810.0" y="213.0"></omgdc:Bounds>
+ <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="952.0" y="213.0"></omgdc:Bounds>
+ <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="1102.0" y="223.0"></omgdc:Bounds>
+ <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="1180.0" y="213.0"></omgdc:Bounds>
+ <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="1130.0" y="511.0"></omgdc:Bounds>
+ <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="1500.0" y="520.0"></omgdc:Bounds>
+ <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="1590.0" y="740.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1605.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.0"></omgdc:Bounds>
+ <omgdc:Bounds height="80.0" width="100.0" x="1740.0" y="855.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="updateApprovalGW" id="BPMNShape_updateApprovalGW">
- <omgdc:Bounds height="40.0" width="40.0" x="1770.0" y="750.0"></omgdc:Bounds>
+ <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="1890.0" y="840.0"></omgdc:Bounds>
+ <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="1890.0" y="700.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recertificationRequest" id="BPMNShape_recertificationRequest">
- <omgdc:Bounds height="80.0" width="100.0" x="1964.0" y="499.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recertify-task" id="BPMNShape_recertify-task">
- <omgdc:Bounds height="80.0" width="100.0" x="2106.0" y="500.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
- <omgdc:Bounds height="40.0" width="40.0" x="2136.0" y="410.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1890.0" y="700.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
- <omgdc:Bounds height="60.0" width="100.0" x="1590.0" y="100.0"></omgdc:Bounds>
+ <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="1740.0" y="120.0"></omgdc:Bounds>
+ <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="1920.0" y="180.0"></omgdc:Bounds>
+ <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="2040.0" y="110.0"></omgdc:Bounds>
+ <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="660.0" y="659.0"></omgdc:Bounds>
+ <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="810.0" y="770.0"></omgdc:Bounds>
+ <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="990.0" y="780.0"></omgdc:Bounds>
+ <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="1590.0" y="280.0"></omgdc:Bounds>
+ <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="1770.0" y="300.0"></omgdc:Bounds>
+ <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="1890.0" y="240.0"></omgdc:Bounds>
+ <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.0" width="100.0" x="1643.0" y="452.0"></omgdc:Bounds>
+ <omgdc:Bounds height="59.0" width="100.0" x="1643.0" y="452.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="452.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="452.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1643.0" y="561.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1643.0" y="561.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="561.0"></omgdc:Bounds>
+ <omgdc:Bounds height="60.0" width="100.0" x="1848.0" y="561.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
- <omgdc:Bounds height="60.0" width="100.0" x="2220.0" y="358.0"></omgdc:Bounds>
+ <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="35.0" width="35.0" x="2358.0" y="374.0"></omgdc:Bounds>
+ <omgdc:Bounds height="28.0" width="28.0" x="2358.0" y="374.0"/>
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="350.0" y="287.0"></omgdi:waypoint>
- <omgdi:waypoint x="350.0" y="323.0"></omgdi:waypoint>
+ <bpmndi:BPMNShape bpmnElement="updateWhilePendingCreateApproval" id="BPMNShape_updateWhilePendingCreateApproval">
+ <omgdc:Bounds height="60.0" width="100.0" x="362.5" y="770.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7" id="BPMNShape_sid-8CFA3152-19AA-4878-AD2C-96B63F6E98C7">
+ <omgdc:Bounds height="40.0" width="40.0" x="450.0" y="660.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="updateWhilePendingUpdateApproval" id="BPMNShape_updateWhilePendingUpdateApproval">
+ <omgdc:Bounds height="60.0" width="100.0" x="1455.0" y="865.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07" id="BPMNShape_sid-4C9C9117-26DB-4326-A12B-EEDA42EADF07">
+ <omgdc:Bounds height="40.0" width="40.0" x="1635.0" y="875.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
+ <omgdi:waypoint x="1539.9223684210267" y="540.0"/>
+ <omgdi:waypoint x="1556.0" y="540.0"/>
+ <omgdi:waypoint x="1556.0" y="730.0"/>
+ <omgdi:waypoint x="1889.999999999701" y="730.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
- <omgdi:waypoint x="350.0" y="383.0"></omgdi:waypoint>
- <omgdi:waypoint x="350.0" y="507.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-1D0DA593-85D7-412B-8DA3-79DC0CE00E1D" id="BPMNEdge_sid-1D0DA593-85D7-412B-8DA3-79DC0CE00E1D">
+ <omgdi:waypoint x="1540.94" y="865.0"/>
+ <omgdi:waypoint x="1619.0" y="799.9499999999999"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
- <omgdi:waypoint x="370.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="420.0" y="590.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
+ <omgdi:waypoint x="1539.9442374350085" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="561.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
- <omgdi:waypoint x="370.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="527.0"></omgdi:waypoint>
- <omgdi:waypoint x="382.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="690.0" y="449.0"></omgdi:waypoint>
+ <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="519.9499999997392" y="590.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
- <omgdi:waypoint x="470.0" y="620.0"></omgdi:waypoint>
- <omgdi:waypoint x="470.0" y="732.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-930DADF1-C361-43DD-A240-582F21DEB9B6" id="BPMNEdge_sid-930DADF1-C361-43DD-A240-582F21DEB9B6">
+ <omgdi:waypoint x="470.0" y="619.9499999999999"/>
+ <omgdi:waypoint x="470.0" y="660.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
+ <omgdi:waypoint x="990.0" y="800.0"/>
+ <omgdi:waypoint x="909.9499999999135" y="800.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991" id="BPMNEdge_sid-56E7041A-748A-4C71-ABF3-7DCA0BEC8991">
- <omgdi:waypoint x="470.0" y="732.0"></omgdi:waypoint>
- <omgdi:waypoint x="590.0" y="610.0"></omgdi:waypoint>
+ <omgdi:waypoint x="577.4499999999488" y="805.0"/>
+ <omgdi:waypoint x="590.0" y="805.0"/>
+ <omgdi:waypoint x="590.0" y="609.9046184271755"/>
</bpmndi:BPMNEdge>
- <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>
- <omgdi:waypoint x="520.0" y="590.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
+ <omgdi:waypoint x="1539.9189252336448" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="680.0"/>
+ <omgdi:waypoint x="2174.0" y="680.0"/>
+ <omgdi:waypoint x="2260.1369863013697" y="417.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
- <omgdi:waypoint x="610.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="690.0" y="449.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2GenerateToken" id="BPMNEdge_enableGW2GenerateToken">
+ <omgdi:waypoint x="729.9433544302707" y="449.0"/>
+ <omgdi:waypoint x="860.0" y="449.0"/>
+ <omgdi:waypoint x="860.0" y="272.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
- <omgdi:waypoint x="610.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="590.0"></omgdi:waypoint>
- <omgdi:waypoint x="622.0" y="689.0"></omgdi:waypoint>
- <omgdi:waypoint x="660.0" y="689.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="348.3475822648328" y="281.94584310464063"/>
+ <omgdi:waypoint x="349.30232558139534" y="323.0"/>
</bpmndi:BPMNEdge>
- <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>
- <omgdi:waypoint x="590.0" y="859.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="859.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="820.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2OptIn" id="BPMNEdge_createApprovalGW2OptIn">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="860.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="860.0" y="273.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Activate" id="BPMNEdge_createApprovalGW2Activate">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="810.0" y="640.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Active" id="BPMNEdge_createApprovalGW2Active">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="861.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="861.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1130.0" y="541.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Suspended" id="BPMNEdge_createApprovalGW2Suspended">
- <omgdi:waypoint x="730.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="449.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="130.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+ <omgdi:waypoint x="350.0" y="382.95"/>
+ <omgdi:waypoint x="350.0" y="507.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+ <omgdi:waypoint x="489.93253064798597" y="680.0"/>
+ <omgdi:waypoint x="527.0" y="680.0"/>
+ <omgdi:waypoint x="527.34" y="765.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
- <omgdi:waypoint x="910.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="922.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="1059.0" y="640.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
+ <omgdi:waypoint x="909.9499999998994" 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="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
+ <omgdi:waypoint x="1809.9339371980675" 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="flow5" id="BPMNEdge_flow5">
- <omgdi:waypoint x="910.0" y="243.0"></omgdi:waypoint>
- <omgdi:waypoint x="952.0" y="243.0"></omgdi:waypoint>
+ <omgdi:waypoint x="909.9499999999393" y="243.0"/>
+ <omgdi:waypoint x="952.0" y="243.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
- <omgdi:waypoint x="1002.0" y="273.0"></omgdi:waypoint>
- <omgdi:waypoint x="1002.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1122.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1122.0" y="263.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
- <omgdi:waypoint x="1142.0" y="243.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="243.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
- <omgdi:waypoint x="1102.0" y="243.0"></omgdi:waypoint>
- <omgdi:waypoint x="1052.0" y="243.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1002.0" y="272.95"/>
+ <omgdi:waypoint x="1002.0" y="310.0"/>
+ <omgdi:waypoint x="1122.0" y="310.0"/>
+ <omgdi:waypoint x="1122.0" y="262.9148355754858"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
- <omgdi:waypoint x="1230.0" y="273.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1224.96644295302" y="272.95"/>
+ <omgdi:waypoint x="1185.025167785235" y="511.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
- <omgdi:waypoint x="1230.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1500.0" y="540.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-66CDB1C4-7C2F-4BAE-9834-84CF0CF52BF3" id="BPMNEdge_sid-66CDB1C4-7C2F-4BAE-9834-84CF0CF52BF3">
+ <omgdi:waypoint x="1635.4333333333334" y="895.4333333333334"/>
+ <omgdi:waypoint x="1554.9499999999264" y="895.1659468438539"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="770.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+ <omgdi:waypoint x="1229.9499999999914" y="540.8529411764707"/>
+ <omgdi:waypoint x="1500.0586510263724" y="540.058504398827"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1554.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="310.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
+ <omgdi:waypoint x="1539.9189252336448" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="540.0"/>
+ <omgdi:waypoint x="1552.0" y="130.0"/>
+ <omgdi:waypoint x="1589.9999999999768" y="130.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1556.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1556.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="730.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+ <omgdi:waypoint x="1989.95" y="730.0"/>
+ <omgdi:waypoint x="2037.0" y="730.0"/>
+ <omgdi:waypoint x="2037.0" y="971.0"/>
+ <omgdi:waypoint x="1334.0" y="971.0"/>
+ <omgdi:waypoint x="1180.0" y="844.0"/>
+ <omgdi:waypoint x="1180.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2Active" id="BPMNEdge_enableGW2Active">
+ <omgdi:waypoint x="729.9433984115534" 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="active2Suspend" id="BPMNEdge_active2Suspend">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1590.0" y="130.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
+ <omgdi:waypoint x="1539.9207478005092" y="540.0"/>
+ <omgdi:waypoint x="1554.0" y="540.0"/>
+ <omgdi:waypoint x="1554.0" y="770.0"/>
+ <omgdi:waypoint x="1605.0" y="770.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1552.0" y="680.0"></omgdi:waypoint>
- <omgdi:waypoint x="2174.0" y="680.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="418.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2" id="BPMNEdge_sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2">
+ <omgdi:waypoint x="1790.0" y="789.9304794520548"/>
+ <omgdi:waypoint x="1790.0" y="821.0"/>
+ <omgdi:waypoint x="2270.0" y="821.0"/>
+ <omgdi:waypoint x="2270.0" y="417.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
+ <omgdi:waypoint x="1809.9339371980677" 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="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1693.0" y="561.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
+ <omgdi:waypoint x="369.91892523364487" 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-A2BDF803-688C-4A4D-9D33-6D859C029245" id="BPMNEdge_sid-A2BDF803-688C-4A4D-9D33-6D859C029245">
- <omgdi:waypoint x="1640.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="824.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
+ <omgdi:waypoint x="609.9189252336447" 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="sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F" id="BPMNEdge_sid-53FA7F29-CE60-4AE6-921D-AF7331CDB19F">
- <omgdi:waypoint x="1640.0" y="824.0"></omgdi:waypoint>
- <omgdi:waypoint x="1790.0" y="790.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <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>
- <omgdi:waypoint x="1690.0" y="770.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1790.0" y="855.0"/>
+ <omgdi:waypoint x="1790.0" y="789.9079463570856"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
- <omgdi:waypoint x="1810.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="730.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="rejected2Delete" id="BPMNEdge_rejected2Delete">
+ <omgdi:waypoint x="1029.9339371980675" 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="417.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
- <omgdi:waypoint x="1810.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="870.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="870.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-F746E78F-F59B-4842-9D88-C9C79474FC06" id="BPMNEdge_sid-F746E78F-F59B-4842-9D88-C9C79474FC06">
+ <omgdi:waypoint x="400.83333333333337" y="770.0"/>
+ <omgdi:waypoint x="367.0" y="683.0"/>
+ <omgdi:waypoint x="436.7741935483871" y="619.9499999999999"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2" id="BPMNEdge_sid-B5FFEBCA-1FBF-457F-BC55-39FD387188B2">
- <omgdi:waypoint x="1790.0" y="790.0"></omgdi:waypoint>
- <omgdi:waypoint x="1790.0" y="821.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="821.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="418.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
+ <omgdi:waypoint x="1889.9999999999998" y="260.7451923076923"/>
+ <omgdi:waypoint x="1524.0" y="193.0"/>
+ <omgdi:waypoint x="1209.6057471264367" y="511.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
- <omgdi:waypoint x="1940.0" y="900.0"></omgdi:waypoint>
- <omgdi:waypoint x="1940.0" y="924.0"></omgdi:waypoint>
- <omgdi:waypoint x="1338.0" y="924.0"></omgdi:waypoint>
- <omgdi:waypoint x="1214.0" y="837.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
+ <omgdi:waypoint x="1959.9469781884277" y="200.0"/>
+ <omgdi:waypoint x="2270.0" y="200.0"/>
+ <omgdi:waypoint x="2270.0" y="358.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
- <omgdi:waypoint x="1990.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="2037.0" y="730.0"></omgdi:waypoint>
- <omgdi:waypoint x="2037.0" y="946.0"></omgdi:waypoint>
- <omgdi:waypoint x="1336.0" y="946.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="844.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
- <omgdi:waypoint x="2064.0" y="539.0"></omgdi:waypoint>
- <omgdi:waypoint x="2106.0" y="540.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-request-start-flow" id="BPMNEdge_recert-request-start-flow">
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1964.0" y="539.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
- <omgdi:waypoint x="2156.0" y="500.0"></omgdi:waypoint>
- <omgdi:waypoint x="2156.0" y="450.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
- <omgdi:waypoint x="2156.0" y="410.0"></omgdi:waypoint>
- <omgdi:waypoint x="1593.0" y="365.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
- <omgdi:waypoint x="2156.0" y="410.0"></omgdi:waypoint>
- <omgdi:waypoint x="2156.0" y="53.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="53.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="100.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
+ <omgdi:waypoint x="1809.9339371980677" y="320.0"/>
+ <omgdi:waypoint x="1852.0" y="320.0"/>
+ <omgdi:waypoint x="1852.0" y="270.0"/>
+ <omgdi:waypoint x="1889.9999999999768" y="270.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
- <omgdi:waypoint x="1690.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="130.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="150.0"></omgdi:waypoint>
- <omgdi:waypoint x="1740.0" y="150.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
+ <omgdi:waypoint x="609.9189252336447" 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="flow11" id="BPMNEdge_flow11">
- <omgdi:waypoint x="1840.0" y="150.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="150.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="1920.0" y="200.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
+ <omgdi:waypoint x="1102.0" y="243.0"/>
+ <omgdi:waypoint x="1051.95" y="243.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
- <omgdi:waypoint x="1960.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2002.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2002.0" y="140.0"></omgdi:waypoint>
- <omgdi:waypoint x="2040.0" y="140.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1959.9339371980413" y="200.0"/>
+ <omgdi:waypoint x="2002.0" y="200.0"/>
+ <omgdi:waypoint x="2002.0" y="140.0"/>
+ <omgdi:waypoint x="2039.999999999977" y="140.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
- <omgdi:waypoint x="1960.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="200.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="358.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
+ <omgdi:waypoint x="1539.9207478005092" 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="flow12" id="BPMNEdge_flow12">
- <omgdi:waypoint x="2040.0" y="140.0"></omgdi:waypoint>
- <omgdi:waypoint x="2028.0" y="127.0"></omgdi:waypoint>
- <omgdi:waypoint x="1478.0" y="40.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
+ <omgdi:waypoint x="1742.95" y="591.0"/>
+ <omgdi:waypoint x="1848.0" y="591.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
+ <omgdi:waypoint x="1847.9999999999998" y="619.3716000000001"/>
+ <omgdi:waypoint x="1773.0" y="662.0"/>
+ <omgdi:waypoint x="1229.9499999999998" y="551.1921585160202"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-A2BDF803-688C-4A4D-9D33-6D859C029245" id="BPMNEdge_sid-A2BDF803-688C-4A4D-9D33-6D859C029245">
+ <omgdi:waypoint x="1655.1193227091633" y="799.9499999999999"/>
+ <omgdi:waypoint x="1655.42" y="875.42"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
- <omgdi:waypoint x="760.0" y="689.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="689.0"></omgdi:waypoint>
- <omgdi:waypoint x="772.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="810.0" y="800.0"></omgdi:waypoint>
+ <omgdi:waypoint x="759.9499999998994" 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="flow14" id="BPMNEdge_flow14">
- <omgdi:waypoint x="860.0" y="770.0"></omgdi:waypoint>
- <omgdi:waypoint x="860.0" y="732.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="732.0"></omgdi:waypoint>
- <omgdi:waypoint x="1010.0" y="780.0"></omgdi:waypoint>
+ <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="rejected2Delete" id="BPMNEdge_rejected2Delete">
- <omgdi:waypoint x="1030.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="1072.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="1323.0" y="1000.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="1000.0"></omgdi:waypoint>
- <omgdi:waypoint x="2270.0" y="418.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
+ <omgdi:waypoint x="1742.95" y="481.62182926829274"/>
+ <omgdi:waypoint x="1847.9999999999989" y="481.8780487804878"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
- <omgdi:waypoint x="990.0" y="800.0"></omgdi:waypoint>
- <omgdi:waypoint x="910.0" y="800.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58" id="BPMNEdge_sid-B2EEC511-2924-4A95-B0B8-E35DA268DD58">
+ <omgdi:waypoint x="590.0" y="609.9462931995539"/>
+ <omgdi:waypoint x="590.0" y="859.0"/>
+ <omgdi:waypoint x="1010.0" y="859.0"/>
+ <omgdi:waypoint x="1010.0" y="819.9168505942274"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
+ <omgdi:waypoint x="1809.9339371980675" 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="flow16" id="BPMNEdge_flow16">
+ <omgdi:waypoint x="1848.0" y="458.94174757281553"/>
+ <omgdi:waypoint x="1692.0" y="387.0"/>
+ <omgdi:waypoint x="1229.9499999999998" y="525.9609375"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-C9FA59AF-4F39-489E-B424-5C06B15AE317" id="BPMNEdge_sid-C9FA59AF-4F39-489E-B424-5C06B15AE317">
+ <omgdi:waypoint x="450.0" y="680.0"/>
+ <omgdi:waypoint x="412.0" y="680.0"/>
+ <omgdi:waypoint x="412.375" y="770.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2Suspended" id="BPMNEdge_enableGW2Suspended">
+ <omgdi:waypoint x="729.9339371980061" 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="flow14bis" id="BPMNEdge_flow14bis">
- <omgdi:waypoint x="1690.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="310.0"></omgdi:waypoint>
- <omgdi:waypoint x="1702.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1770.0" y="320.0"></omgdi:waypoint>
+ <omgdi:waypoint x="1689.949999999984" 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="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
- <omgdi:waypoint x="1810.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="388.0"></omgdi:waypoint>
- <omgdi:waypoint x="2220.0" y="388.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="enableGW2Activate" id="BPMNEdge_enableGW2Activate">
+ <omgdi:waypoint x="729.9339371980061" 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="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
- <omgdi:waypoint x="1810.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1852.0" y="270.0"></omgdi:waypoint>
- <omgdi:waypoint x="1890.0" y="270.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
+ <omgdi:waypoint x="1141.9407724328892" y="243.0"/>
+ <omgdi:waypoint x="1180.0" y="243.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
- <omgdi:waypoint x="1940.0" y="240.0"></omgdi:waypoint>
- <omgdi:waypoint x="1524.0" y="193.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="sid-12E29B94-C369-45C1-BCEF-C165AFDA525A" id="BPMNEdge_sid-12E29B94-C369-45C1-BCEF-C165AFDA525A">
+ <omgdi:waypoint x="1674.5135906040268" y="895.429104477612"/>
+ <omgdi:waypoint x="1740.0" y="895.185687732342"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
- <omgdi:waypoint x="1743.0" y="481.0"></omgdi:waypoint>
- <omgdi:waypoint x="1848.0" y="482.0"></omgdi:waypoint>
+ <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="1704.95" y="770.0"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
- <omgdi:waypoint x="1898.0" y="452.0"></omgdi:waypoint>
- <omgdi:waypoint x="1692.0" y="387.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="511.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
+ <omgdi:waypoint x="369.91892523364487" 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="flow17" id="BPMNEdge_flow17">
- <omgdi:waypoint x="1743.0" y="591.0"></omgdi:waypoint>
- <omgdi:waypoint x="1848.0" y="591.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
+ <omgdi:waypoint x="1539.9442374350085" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="540.0"/>
+ <omgdi:waypoint x="1693.0" y="510.95"/>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
- <omgdi:waypoint x="1898.0" y="621.0"></omgdi:waypoint>
- <omgdi:waypoint x="1773.0" y="662.0"></omgdi:waypoint>
- <omgdi:waypoint x="1180.0" y="571.0"></omgdi:waypoint>
+ <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+ <omgdi:waypoint x="1689.95" y="130.0"/>
+ <omgdi:waypoint x="1702.0" y="130.0"/>
+ <omgdi:waypoint x="1702.0" y="150.0"/>
+ <omgdi:waypoint x="1739.9999999999768" y="150.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+ <omgdi:waypoint x="1839.9499999999837" 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="2320.0" y="388.0"></omgdi:waypoint>
- <omgdi:waypoint x="2358.0" y="391.0"></omgdi:waypoint>
+ <omgdi:waypoint x="2319.9499999999875" y="388.0"/>
+ <omgdi:waypoint x="2358.0" y="388.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
+ <omgdi:waypoint x="2040.0" y="129.51612903225808"/>
+ <omgdi:waypoint x="2028.0" y="127.0"/>
+ <omgdi:waypoint x="1478.0" y="40.0"/>
+ <omgdi:waypoint x="1197.8145708582833" y="511.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
+ <omgdi:waypoint x="1940.0" y="899.9499999999999"/>
+ <omgdi:waypoint x="1940.0" y="948.0"/>
+ <omgdi:waypoint x="1339.0" y="948.0"/>
+ <omgdi:waypoint x="1214.0" y="837.0"/>
+ <omgdi:waypoint x="1183.4402027027027" y="570.95"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</definitions>
\ No newline at end of file
+</definitions>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
index 151f426..ee5d8e1 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
@@ -108,14 +108,15 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
import org.apache.syncope.common.rest.api.service.TaskService;
import org.apache.syncope.common.rest.api.service.UserSelfService;
import org.apache.syncope.common.rest.api.service.UserService;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
import org.apache.syncope.fit.core.UserITCase;
import org.identityconnectors.common.security.Encryptor;
import org.junit.jupiter.api.BeforeAll;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
+import org.apache.syncope.common.rest.api.service.BpmnProcessService;
+import org.apache.syncope.common.rest.api.service.UserWorkflowTaskService;
public abstract class AbstractITCase {
@@ -217,7 +218,9 @@ public abstract class AbstractITCase {
protected static UserSelfService userSelfService;
- protected static UserWorkflowService userWorkflowService;
+ protected static UserRequestService userRequestService;
+
+ protected static UserWorkflowTaskService userWorkflowTaskService;
protected static GroupService groupService;
@@ -241,7 +244,7 @@ public abstract class AbstractITCase {
protected static ReconciliationService reconciliationService;
- protected static WorkflowService workflowService;
+ protected static BpmnProcessService bpmnProcessService;
protected static MailTemplateService mailTemplateService;
@@ -314,7 +317,8 @@ public abstract class AbstractITCase {
dynRealmService = adminClient.getService(DynRealmService.class);
userService = adminClient.getService(UserService.class);
userSelfService = adminClient.getService(UserSelfService.class);
- userWorkflowService = adminClient.getService(UserWorkflowService.class);
+ userRequestService = adminClient.getService(UserRequestService.class);
+ userWorkflowTaskService = adminClient.getService(UserWorkflowTaskService.class);
groupService = adminClient.getService(GroupService.class);
resourceService = adminClient.getService(ResourceService.class);
resourceHistoryService = adminClient.getService(ResourceHistoryService.class);
@@ -327,7 +331,7 @@ public abstract class AbstractITCase {
taskService = adminClient.getService(TaskService.class);
reconciliationService = adminClient.getService(ReconciliationService.class);
policyService = adminClient.getService(PolicyService.class);
- workflowService = adminClient.getService(WorkflowService.class);
+ bpmnProcessService = adminClient.getService(BpmnProcessService.class);
mailTemplateService = adminClient.getService(MailTemplateService.class);
notificationService = adminClient.getService(NotificationService.class);
schemaService = adminClient.getService(SchemaService.class);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
index 0fbb094..08afd11 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
@@ -22,15 +22,7 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
public class FlowableDetector {
- public static boolean isFlowableEnabledForUsers(final SyncopeService syncopeService) {
+ public static boolean isFlowableEnabledForUserWorkflow(final SyncopeService syncopeService) {
return syncopeService.platform().getUserWorkflowAdapter().contains("Flowable");
}
-
- public static boolean isFlowableEnabledForGroups(final SyncopeService syncopeService) {
- return syncopeService.platform().getGroupWorkflowAdapter().contains("Flowable");
- }
-
- public static boolean isFlowableEnabledForAnyObjects(final SyncopeService syncopeService) {
- return syncopeService.platform().getAnyObjectWorkflowAdapter().contains("Flowable");
- }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
index bcc2c6d..0159d8f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AjaxBrowseITCase.java
@@ -27,9 +27,7 @@ import org.apache.syncope.client.console.pages.Realms;
import org.apache.syncope.client.console.pages.Reports;
import org.apache.syncope.client.console.pages.Security;
import org.apache.syncope.client.console.pages.Types;
-import org.apache.syncope.client.console.pages.Workflow;
import org.apache.syncope.client.console.topology.Topology;
-import org.apache.syncope.fit.FlowableDetector;
import org.junit.jupiter.api.Test;
// Please, keep the class name as is in order to respect the execution order. It seems that from wicket 7.5.0 the
@@ -69,11 +67,6 @@ public class AjaxBrowseITCase extends AbstractConsoleITCase {
TESTER.clickLink("body:reportsLI:reports");
TESTER.assertRenderedPage(Reports.class);
- if (FlowableDetector.isFlowableEnabledForUsers(SYNCOPE_SERVICE)) {
- TESTER.clickLink("body:configurationLI:configurationUL:workflowLI:workflow");
- TESTER.assertRenderedPage(Workflow.class);
- }
-
TESTER.clickLink("body:configurationLI:configurationUL:logsLI:logs");
TESTER.assertRenderedPage(Logs.class);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
index 7ec16f1..e2f351b 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
@@ -54,7 +54,7 @@ import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.ProvisioningResult;
import org.apache.syncope.common.lib.to.RoleTO;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.AttrSchemaType;
import org.apache.syncope.common.lib.types.CipherAlgorithm;
@@ -474,7 +474,7 @@ public class AuthenticationITCase extends AbstractITCase {
@Test
public void issueSYNCOPE434() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// 1. create user with group 'groupForWorkflowApproval'
// (users with group groupForWorkflowApproval are defined in workflow as subject to approval)
@@ -495,10 +495,10 @@ public class AuthenticationITCase extends AbstractITCase {
}
// 3. approve user
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
- userTO = userWorkflowService.submitForm(form);
+ userTO = userRequestService.submitForm(form);
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java
new file mode 100644
index 0000000..443cd83
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java
@@ -0,0 +1,72 @@
+/*
+ * 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 static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.fit.AbstractITCase;
+import org.apache.syncope.fit.FlowableDetector;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+public class BpmnProcessITCase extends AbstractITCase {
+
+ private static String userWorkflowKey = null;
+
+ @BeforeAll
+ public static void findDefault() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+ bpmnProcessService.list().stream().
+ filter(BpmnProcessTO::isUserWorkflow).findAny().
+ ifPresent(process -> {
+ userWorkflowKey = process.getKey();
+ });
+ assertNotNull(userWorkflowKey);
+ }
+
+ @Test
+ public void exportUserWorkflowProcess() throws IOException {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+ Response response = bpmnProcessService.get(userWorkflowKey);
+ assertTrue(response.getMediaType().toString().
+ startsWith(clientFactory.getContentType().getMediaType().toString()));
+ assertTrue(response.getEntity() instanceof InputStream);
+ String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
+ assertNotNull(definition);
+ assertFalse(definition.isEmpty());
+ }
+
+ @Test
+ public void updateUserWorkflowProcess() throws IOException {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+ Response response = bpmnProcessService.get(userWorkflowKey);
+ String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
+
+ bpmnProcessService.set(userWorkflowKey, definition);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
index d257264..e07c30f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
@@ -105,8 +105,8 @@ public class MultitenancyITCase extends AbstractITCase {
@Test
public void readPlainSchemas() {
- assertEquals(13, adminClient.getService(SchemaService.class).search(new SchemaQuery.Builder().type(
- SchemaType.PLAIN).build()).size());
+ assertEquals(12, adminClient.getService(SchemaService.class).
+ search(new SchemaQuery.Builder().type(SchemaType.PLAIN).build()).size());
}
@Test
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index 2dc671b..b1ba164 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -253,7 +253,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
UserTO userTO = userService.read(inUserTO.getKey());
assertNotNull(userTO);
assertEquals(userName, userTO.getUsername());
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active" : "created", userTO.getStatus());
assertEquals("test9@syncope.apache.org", userTO.getPlainAttr("email").get().getValues().get(0));
assertEquals("test9@syncope.apache.org", userTO.getPlainAttr("userId").get().getValues().get(0));
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
index b349d60..44a3d5c 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
@@ -31,6 +31,7 @@ import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.to.RoleTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.common.rest.api.service.RoleService;
import org.apache.syncope.fit.AbstractITCase;
@@ -90,16 +91,16 @@ public class RoleITCase extends AbstractITCase {
role = createRole(role);
assertNotNull(role);
- assertFalse(role.getEntitlements().contains(StandardEntitlement.WORKFLOW_TASK_LIST));
+ assertFalse(role.getEntitlements().contains(FlowableEntitlement.WORKFLOW_TASK_LIST));
assertFalse(role.getRealms().contains("/even/two"));
- role.getEntitlements().add(StandardEntitlement.WORKFLOW_TASK_LIST);
+ role.getEntitlements().add(FlowableEntitlement.WORKFLOW_TASK_LIST);
role.getRealms().add("/even/two");
roleService.update(role);
role = roleService.read(role.getKey());
- assertTrue(role.getEntitlements().contains(StandardEntitlement.WORKFLOW_TASK_LIST));
+ assertTrue(role.getEntitlements().contains(FlowableEntitlement.WORKFLOW_TASK_LIST));
assertTrue(role.getRealms().contains("/even/two"));
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
index dc0066d..24eacad 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
@@ -24,7 +24,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
import java.util.Date;
import java.util.List;
@@ -40,16 +39,12 @@ import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.types.ImplementationType;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
import org.apache.syncope.common.lib.types.JobAction;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.beans.ExecuteQuery;
import org.apache.syncope.common.rest.api.beans.ExecQuery;
import org.apache.syncope.common.rest.api.beans.TaskQuery;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
import org.apache.syncope.common.rest.api.service.TaskService;
-import org.apache.syncope.fit.FlowableDetector;
import org.apache.syncope.fit.core.reference.TestSampleJobDelegate;
import org.junit.jupiter.api.Test;
@@ -139,27 +134,6 @@ public class SchedTaskITCase extends AbstractTaskITCase {
}
@Test
- public void recertification() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- execTask(taskService, TaskType.SCHEDULED, "e95555d2-1b09-42c8-b25b-f4c4ec598989", "JOB_FIRED", 50, false);
-
- List<WorkflowFormTO> forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build()).getResult();
- assertFalse(forms.isEmpty());
- forms.forEach(form -> {
- userWorkflowService.claimForm(form.getTaskId());
- WorkflowFormPropertyTO approve = form.getProperty("approve").orElse(null);
- approve.setValue("true");
- userWorkflowService.submitForm(form);
- });
-
- forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build()).getResult();
- assertTrue(forms.isEmpty());
- }
-
- @Test
public void issueSYNCOPE144() {
ImplementationTO taskJobDelegate = implementationService.read(
ImplementationType.TASKJOB_DELEGATE, TestSampleJobDelegate.class.getSimpleName());
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
index b05480c..cd4940f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
@@ -714,7 +714,7 @@ public class UserITCase extends AbstractITCase {
@Test
public void createActivate() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
UserTO userTO = getUniqueSampleTO("createActivate@syncope.apache.org");
@@ -751,7 +751,7 @@ public class UserITCase extends AbstractITCase {
userTO = createUser(userTO).getEntity();
assertNotNull(userTO);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active"
: "created", userTO.getStatus());
@@ -787,7 +787,7 @@ public class UserITCase extends AbstractITCase {
userTO.getResources().add(RESOURCE_NAME_LDAP);
userTO = createUser(userTO).getEntity();
assertNotNull(userTO);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active"
: "created", userTO.getStatus());
String userKey = userTO.getKey();
[30/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/TwoContent.xml b/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
index b35beb4..23e372d 100644
--- a/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
@@ -105,15 +105,6 @@ 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"/>
-
<!-- JWT lifetime in minutes -->
<SyncopeSchema id="jwt.lifetime.minutes"/>
<PlainSchema id="jwt.lifetime.minutes" type="Long"
@@ -142,11 +133,6 @@ under the License.
<Implementation id="PushJobDelegate" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.pushpull.PushJobDelegate"/>
- <Implementation id="IdentityRecertification" type="TASKJOB_DELEGATE" engine="JAVA"
- body="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
- <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task" active="1"
- jobDelegate_id="IdentityRecertification"/>
-
<Implementation id="ExpiredAccessTokenCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup"/>
<Task DTYPE="SchedTask" id="89de5014-e3f5-4462-84d8-d97575740baf" name="Access Token Cleanup Task" active="1"
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index fde8fed..39f6df9 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -84,7 +84,6 @@ under the License.
<module>provisioning-java</module>
<module>workflow-api</module>
<module>workflow-java</module>
- <module>workflow-flowable</module>
<module>logic</module>
<module>rest-cxf</module>
<module>upgrade</module>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
index b2c978b..d9f5035 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
@@ -29,17 +29,21 @@ public class AnyDeletedEvent extends ApplicationEvent {
private final String anyKey;
+ private final String anyName;
+
private final String domain;
public AnyDeletedEvent(
final Object source,
final AnyTypeKind anyTypeKind,
final String anyKey,
+ final String anyName,
final String domain) {
super(source);
this.anyTypeKind = anyTypeKind;
this.anyKey = anyKey;
+ this.anyName = anyName;
this.domain = domain;
}
@@ -51,6 +55,10 @@ public class AnyDeletedEvent extends ApplicationEvent {
return anyKey;
}
+ public String getAnyName() {
+ return anyName;
+ }
+
public String getDomain() {
return domain;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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
deleted file mode 100755
index bd837e4..0000000
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
+++ /dev/null
@@ -1,126 +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.
- */
-package org.apache.syncope.core.provisioning.java.job;
-
-import java.util.List;
-import java.util.Optional;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.core.persistence.api.dao.AnyDAO;
-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 {
-
- private static final String RECERTIFICATION_TIME = "identity.recertification.day.interval";
-
- @Autowired
- private ConfDAO confDAO;
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private UserWorkflowAdapter uwfAdapter;
-
- private long recertificationTime = -1;
-
- protected void init() {
- synchronized (this) {
- if (recertificationTime == -1) {
- Optional<? extends CPlainAttr> recertificationTimeAttr = confDAO.find(RECERTIFICATION_TIME);
- if (!recertificationTimeAttr.isPresent()
- || recertificationTimeAttr.get().getValues().get(0).getLongValue() == null) {
-
- recertificationTime = -1;
- return;
- }
-
- recertificationTime = recertificationTimeAttr.get().getValues().
- get(0).getLongValue() * 1000 * 60 * 60 * 24;
- }
- }
- }
-
- protected boolean isToBeRecertified(final User user, final long now) {
- if (!user.isSuspended()
- && (user.getLastRecertification() == null
- || user.getLastRecertification().getTime() + recertificationTime < now)) {
-
- LOG.debug("{} is to be recertified", user);
- return true;
- }
-
- LOG.debug("{} does not need to be recertified", user);
- return false;
- }
-
- @Override
- protected String doExecute(final boolean dryRun) throws JobExecutionException {
- LOG.info("IdentityRecertification {} running [SchedTask {}]", dryRun ? "dry " : "", task.getKey());
-
- init();
- if (recertificationTime == -1) {
- LOG.debug("Identity Recertification disabled");
- return ("IDENTITY RECERTIFICATION DISABLED");
- }
-
- if (dryRun) {
- return "DRY RUN";
- }
-
- int total = userDAO.count();
- int pages = (total / AnyDAO.DEFAULT_PAGE_SIZE) + 1;
-
- status.set("Processing " + total + " users in " + pages + " pages");
-
- long now = System.currentTimeMillis();
- for (int page = 1; page <= pages && !interrupt; page++) {
- status.set("Processing " + total + " users: page " + page + " of " + pages);
-
- List<User> users = userDAO.findAll(page, AnyDAO.DEFAULT_PAGE_SIZE);
- for (int i = 0; i < users.size() && !interrupt; i++) {
- LOG.debug("Processing user: {}", users.get(i).getUsername());
-
- if (StringUtils.isNotBlank(users.get(i).getWorkflowId()) && isToBeRecertified(users.get(i), now)) {
- uwfAdapter.requestCertify(users.get(i));
- } else {
- LOG.warn("Workflow for {} is null or empty", users.get(i));
- }
- }
- }
- if (interrupt) {
- interrupted = true;
- return "Identity recertification interrupted";
- }
-
- return "SUCCESS";
- }
-
- @Override
- protected boolean hasToBeRegistered(final TaskExec execution) {
- return true;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
index 91d440e..8852870 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
@@ -152,11 +152,6 @@ public class ReconciliationReportlet extends AbstractReportlet {
}
break;
- case workflowId:
- type = ReportXMLConst.XSD_STRING;
- value = any.getWorkflowId();
- break;
-
case status:
type = ReportXMLConst.XSD_STRING;
value = any.getStatus();
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
index 8d51e4a..338ef9a 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
@@ -197,11 +197,6 @@ public class UserReportlet extends AbstractReportlet {
value = user.getUsername();
break;
- case workflowId:
- type = ReportXMLConst.XSD_STRING;
- value = user.getWorkflowId();
- break;
-
case status:
type = ReportXMLConst.XSD_STRING;
value = user.getStatus();
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
deleted file mode 100644
index 7a25cb8..0000000
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
+++ /dev/null
@@ -1,70 +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.
- */
-package org.apache.syncope.core.rest.cxf.service;
-
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.syncope.core.logic.UserWorkflowLogic;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class UserWorkflowServiceImpl extends AbstractServiceImpl implements UserWorkflowService {
-
- @Autowired
- private UserWorkflowLogic logic;
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- return logic.claimForm(taskId);
- }
-
- @Override
- public UserTO executeTask(final String taskId, final UserTO userTO) {
- return logic.executeWorkflowTask(userTO, taskId);
- }
-
- @Override
- public WorkflowFormTO getFormForUser(final String userKey) {
- return logic.getFormForUser(userKey);
- }
-
- @Override
- public PagedResult<WorkflowFormTO> getForms(final WorkflowFormQuery query) {
- Pair<Integer, List<WorkflowFormTO>> result = logic.getForms(
- query.getPage(), query.getSize(), getOrderByClauses(query.getOrderBy()));
- return buildPagedResult(result.getRight(), query.getPage(), query.getSize(), result.getLeft());
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String userKey) {
- return logic.getAvailableTasks(userKey);
- }
-
- @Override
- public UserTO submitForm(final WorkflowFormTO form) {
- return logic.submitForm(form);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
deleted file mode 100644
index 2321e0a..0000000
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
+++ /dev/null
@@ -1,83 +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.
- */
-package org.apache.syncope.core.rest.cxf.service;
-
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.StreamingOutput;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
-import org.apache.syncope.core.logic.WorkflowLogic;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class WorkflowServiceImpl extends AbstractServiceImpl implements WorkflowService {
-
- @Autowired
- private WorkflowLogic logic;
-
- @Override
- public List<WorkflowDefinitionTO> list(final String anyType) {
- return logic.list(anyType);
- }
-
- @Override
- public Response get(final String anyType, final String key) {
- WorkflowDefinitionFormat format =
- messageContext.getHttpHeaders().getAcceptableMediaTypes().contains(MediaType.APPLICATION_JSON_TYPE)
- ? WorkflowDefinitionFormat.JSON
- : WorkflowDefinitionFormat.XML;
-
- StreamingOutput sout = (os) -> logic.exportDefinition(anyType, key, format, os);
-
- return Response.ok(sout).
- type(format == WorkflowDefinitionFormat.JSON
- ? MediaType.APPLICATION_JSON_TYPE : MediaType.APPLICATION_XHTML_XML_TYPE).
- build();
- }
-
- @Override
- public Response exportDiagram(final String anyType, final String key) {
- StreamingOutput sout = (os) -> logic.exportDiagram(anyType, key, os);
-
- return Response.ok(sout).
- type(RESTHeaders.MEDIATYPE_IMAGE_PNG).
- build();
- }
-
- @Override
- public void set(final String anyType, final String key, final String definition) {
- WorkflowDefinitionFormat format =
- messageContext.getHttpHeaders().getMediaType().equals(MediaType.APPLICATION_JSON_TYPE)
- ? WorkflowDefinitionFormat.JSON
- : WorkflowDefinitionFormat.XML;
-
- logic.importDefinition(anyType, key, format, definition);
- }
-
- @Override
- public void delete(final String anyType, final String key) {
- logic.delete(anyType, key);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
index 8080676..6bc5fdb 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
@@ -19,8 +19,6 @@
package org.apache.syncope.core.spring.security;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -65,33 +63,26 @@ public final class AuthContextUtils {
public static Set<SyncopeGrantedAuthority> getAuthorities() {
SecurityContext ctx = SecurityContextHolder.getContext();
if (ctx != null && ctx.getAuthentication() != null && ctx.getAuthentication().getAuthorities() != null) {
- Set<SyncopeGrantedAuthority> result = new HashSet<>();
- ctx.getAuthentication().getAuthorities().stream().
- filter(authority -> (authority instanceof SyncopeGrantedAuthority)).
- forEachOrdered(authority -> result.add(SyncopeGrantedAuthority.class.cast(authority)));
-
- return result;
+ return ctx.getAuthentication().getAuthorities().stream().
+ filter(SyncopeGrantedAuthority.class::isInstance).
+ map(SyncopeGrantedAuthority.class::cast).
+ collect(Collectors.toSet());
}
return Collections.emptySet();
}
public static Map<String, Set<String>> getAuthorizations() {
- Map<String, Set<String>> result = null;
-
SecurityContext ctx = SecurityContextHolder.getContext();
if (ctx != null && ctx.getAuthentication() != null && ctx.getAuthentication().getAuthorities() != null) {
- result = new HashMap<>();
- for (GrantedAuthority authority : ctx.getAuthentication().getAuthorities()) {
- if (authority instanceof SyncopeGrantedAuthority) {
- result.put(
- SyncopeGrantedAuthority.class.cast(authority).getAuthority(),
- SyncopeGrantedAuthority.class.cast(authority).getRealms());
- }
- }
+ return ctx.getAuthentication().getAuthorities().stream().
+ filter(SyncopeGrantedAuthority.class::isInstance).
+ map(SyncopeGrantedAuthority.class::cast).
+ collect(Collectors.toMap(
+ SyncopeGrantedAuthority::getAuthority, SyncopeGrantedAuthority::getRealms));
}
- return result == null ? Collections.emptyMap() : result;
+ return Collections.emptyMap();
}
public static String getDomain() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
index 91d932b..daf093a 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
@@ -49,6 +49,10 @@ public final class SecureRandomUtils {
return FOR_LETTERS.generate(1);
}
+ public static String generateRandomLetters(final int length) {
+ return FOR_LETTERS.generate(length);
+ }
+
public static String generateRandomNumber() {
return FOR_NUMBERS.generate(1);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/upgrade/src/main/resources/schema.xml
----------------------------------------------------------------------
diff --git a/core/upgrade/src/main/resources/schema.xml b/core/upgrade/src/main/resources/schema.xml
index ea1a6a0..ad63e20 100644
--- a/core/upgrade/src/main/resources/schema.xml
+++ b/core/upgrade/src/main/resources/schema.xml
@@ -175,7 +175,6 @@ under the License.
<column name="lastChangeDate" type="timestamp"/>
<column name="lastModifier" type="varchar" size="255"/>
<column name="status" type="varchar" size="255"/>
- <column name="workflowId" type="varchar" size="255"/>
<column name="name" type="varchar" size="255"/>
<column name="REALM_ID" type="varchar" size="36"/>
<column name="TYPE_ID" type="varchar" size="255"/>
@@ -884,7 +883,6 @@ under the License.
<column name="lastChangeDate" type="timestamp"/>
<column name="lastModifier" type="varchar" size="255"/>
<column name="status" type="varchar" size="255"/>
- <column name="workflowId" type="varchar" size="255"/>
<column name="name" type="varchar" size="255"/>
<column name="REALM_ID" type="varchar" size="36"/>
<column name="GROUPOWNER_ID" type="varchar" size="36"/>
@@ -966,13 +964,10 @@ under the License.
<column name="lastChangeDate" type="timestamp"/>
<column name="lastModifier" type="varchar" size="255"/>
<column name="status" type="varchar" size="255"/>
- <column name="workflowId" type="varchar" size="255"/>
<column name="changePwdDate" type="timestamp"/>
<column name="cipherAlgorithm" type="varchar" size="20"/>
<column name="failedLogins" type="integer"/>
<column name="lastLoginDate" type="timestamp"/>
- <column name="lastRecertification" type="timestamp"/>
- <column name="lastRecertificator" type="varchar" size="255"/>
<column name="mustChangePassword" type="integer"/>
<column name="password" type="varchar" size="255"/>
<column name="securityAnswer" type="varchar" size="255"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
----------------------------------------------------------------------
diff --git a/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java b/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
index d81117c..42de069 100644
--- a/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
+++ b/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
@@ -78,7 +78,7 @@ public class GeneratedUpgradeSQLTest {
Integer implementations = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM Implementation", Integer.class);
assertNotNull(implementations);
- assertEquals(16, implementations.intValue());
+ assertEquals(15, implementations.intValue());
Integer pullTaskActions = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM PullTaskAction", Integer.class);
assertNotNull(pullTaskActions);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/upgrade/src/test/resources/syncopedb20.sql
----------------------------------------------------------------------
diff --git a/core/upgrade/src/test/resources/syncopedb20.sql b/core/upgrade/src/test/resources/syncopedb20.sql
index 314669b..59a2df0 100644
--- a/core/upgrade/src/test/resources/syncopedb20.sql
+++ b/core/upgrade/src/test/resources/syncopedb20.sql
@@ -261,17 +261,16 @@ CREATE MEMORY TABLE PUBLIC.ANYOBJECT(
LASTCHANGEDATE TIMESTAMP,
LASTMODIFIER VARCHAR(255),
STATUS VARCHAR(255),
- WORKFLOWID VARCHAR(255),
NAME VARCHAR(255),
REALM_ID VARCHAR(36),
TYPE_ID VARCHAR(255)
);
ALTER TABLE PUBLIC.ANYOBJECT ADD CONSTRAINT PUBLIC.CONSTRAINT_3 PRIMARY KEY(ID);
-- 3 +/- SELECT COUNT(*) FROM PUBLIC.ANYOBJECT;
-INSERT INTO PUBLIC.ANYOBJECT(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, TYPE_ID) VALUES
-('fc6dbc3a-6c07-4965-8781-921e7401a4a5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'HP LJ 1300n', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
-('8559d14d-58c2-46eb-a2d4-a7d35161e8f8', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'Canon MF 8030cn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
-('9e1d130c-d6a3-48b1-98b3-182477ed0688', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'Epson Stylus Color', '0679e069-7355-4b20-bd11-a5a0a5453c7c', 'PRINTER');
+INSERT INTO PUBLIC.ANYOBJECT(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, TYPE_ID) VALUES
+('fc6dbc3a-6c07-4965-8781-921e7401a4a5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'HP LJ 1300n', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
+('8559d14d-58c2-46eb-a2d4-a7d35161e8f8', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'Canon MF 8030cn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
+('9e1d130c-d6a3-48b1-98b3-182477ed0688', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'Epson Stylus Color', '0679e069-7355-4b20-bd11-a5a0a5453c7c', 'PRINTER');
CREATE MEMORY TABLE PUBLIC.ANYOBJECT_ANYTYPECLASS(
ANYOBJECT_ID VARCHAR(36),
ANYTYPECLASS_ID VARCHAR(255)
@@ -572,7 +571,6 @@ INSERT INTO PUBLIC.CPLAINATTR(ID, OWNER_ID, SCHEMA_ID) VALUES
('888ae8e1-a295-4ee2-a15e-31dbf6dfc3f9', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'authentication.statuses'),
('9891c0a7-27ee-4215-9eea-ca32e580b4e4', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'log.lastlogindate'),
('bcfd7efc-0605-4b5e-b4bb-85c1d5f6493a', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'return.password.value'),
-('bcfd7efc-0605-4b5e-b4bb-85c1d5f64bbb', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'identity.recertification.day.interval'),
('cfec3140-562d-459c-ac6a-e3e10758661d', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'jwt.lifetime.minutes'),
('ae36c6ab-0f39-40d7-b6e6-3b8394547c9c', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'connector.conf.history.size'),
('ae7ae53a-74cf-48b0-9a57-6d2c94928e60', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'resource.conf.history.size');
@@ -1100,7 +1098,6 @@ INSERT INTO PUBLIC.PLAINSCHEMA(ID, CIPHERALGORITHM, CONVERSIONPATTERN, ENUMERATI
('authentication.statuses', NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, NULL, 'String', 0, NULL, NULL),
('log.lastlogindate', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Boolean', 0, NULL, NULL),
('return.password.value', NULL, NULL, NULL, NULL, 'false', NULL, 0, 0, NULL, 'Boolean', 0, NULL, NULL),
-('identity.recertification.day.interval', NULL, NULL, NULL, NULL, 'false', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
('jwt.lifetime.minutes', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
('connector.conf.history.size', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
('resource.conf.history.size', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
@@ -1301,7 +1298,7 @@ CREATE MEMORY TABLE PUBLIC.REPORTLETCONFINSTANCE(
ALTER TABLE PUBLIC.REPORTLETCONFINSTANCE ADD CONSTRAINT PUBLIC.CONSTRAINT_4F PRIMARY KEY(ID);
-- 2 +/- SELECT COUNT(*) FROM PUBLIC.REPORTLETCONFINSTANCE;
INSERT INTO PUBLIC.REPORTLETCONFINSTANCE(ID, SERIALIZEDINSTANCE, REPORT_ID) VALUES
-('5874f3fa-578c-42c6-83b0-c11adafc98b2', '{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","workflowId","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}', '0062ea9c-924d-4ecf-9961-4492a8cc6d1b'),
+('5874f3fa-578c-42c6-83b0-c11adafc98b2', '{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}', '0062ea9c-924d-4ecf-9961-4492a8cc6d1b'),
('d6c2b475-4860-4eb1-8fde-618299c2a97c', '{"@class":"org.apache.syncope.common.lib.report.ReconciliationReportletConf","name":"dashboardReconciliationReportlet","userMatchingCond":null,"groupMatchingCond":null,"anyObjectMatchingCond":null,"features":["key","username","groupName"]}', 'c3520ad9-179f-49e7-b315-d684d216dd97');
CREATE MEMORY TABLE PUBLIC.REPORTTEMPLATE(
ID VARCHAR(255) NOT NULL,
@@ -1403,7 +1400,6 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEGROUP(
LASTCHANGEDATE TIMESTAMP,
LASTMODIFIER VARCHAR(255),
STATUS VARCHAR(255),
- WORKFLOWID VARCHAR(255),
NAME VARCHAR(255),
REALM_ID VARCHAR(36),
GROUPOWNER_ID VARCHAR(36),
@@ -1411,23 +1407,23 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEGROUP(
);
ALTER TABLE PUBLIC.SYNCOPEGROUP ADD CONSTRAINT PUBLIC.CONSTRAINT_8E PRIMARY KEY(ID);
-- 16 +/- SELECT COUNT(*) FROM PUBLIC.SYNCOPEGROUP;
-INSERT INTO PUBLIC.SYNCOPEGROUP(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) VALUES
-('37d15e4c-cdc1-460b-a591-8505c8133806', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'root', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('b1f7c12d-ec83-441f-a50e-1691daaedf3b', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'child', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('29f96485-729e-4d31-88a1-6fc60e4677f3', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'citizen', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('8fb2d51e-c605-4e80-a72b-13ffecf1aa9a', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'employee', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('a3c1a693-a6be-483f-a2b3-5cfec146f4bf', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'secretary', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('ebf97068-aa4b-4a85-9f01-680e8c4cf227', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'director', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, '823074dc-d280-436d-a7dd-07399fae48ec'),
-('bf825fe1-7320-4a54-bd64-143b5c18ab97', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'managingDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('f779c0d4-633b-4be5-8f57-32eb478a3ca5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'otherchild', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('0cbcabd2-4410-4b6b-8f05-a052b451d18f', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'groupForWorkflowApproval', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('b8d38784-57e7-4595-859a-076222644b55', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'managingConsultant', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('268fed79-f440-4390-9435-b273768eb5d6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'groupForWorkflowOptIn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('0626100b-a4ba-4e00-9971-86fad52a6216', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'aGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('ba9ed509-b1f5-48ab-a334-c8530a6422dc', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'bGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('ece66293-8f31-4a84-8e8d-23da36e70846', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'artDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('034740a9-fa10-453b-af37-dc7897e98fb1', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'additional', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL, NULL),
-('e7ff94e8-19c9-4f0a-b8b7-28327edbf6ed', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'fake', '722f3d84-9c2b-4525-8f6e-e4b82c55a36c', NULL, NULL);
+INSERT INTO PUBLIC.SYNCOPEGROUP(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) VALUES
+('37d15e4c-cdc1-460b-a591-8505c8133806', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'root', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('b1f7c12d-ec83-441f-a50e-1691daaedf3b', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'child', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('29f96485-729e-4d31-88a1-6fc60e4677f3', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'citizen', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('8fb2d51e-c605-4e80-a72b-13ffecf1aa9a', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'employee', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('a3c1a693-a6be-483f-a2b3-5cfec146f4bf', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'secretary', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('ebf97068-aa4b-4a85-9f01-680e8c4cf227', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'director', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, '823074dc-d280-436d-a7dd-07399fae48ec'),
+('bf825fe1-7320-4a54-bd64-143b5c18ab97', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'managingDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('f779c0d4-633b-4be5-8f57-32eb478a3ca5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'otherchild', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('0cbcabd2-4410-4b6b-8f05-a052b451d18f', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'groupForWorkflowApproval', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('b8d38784-57e7-4595-859a-076222644b55', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'managingConsultant', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('268fed79-f440-4390-9435-b273768eb5d6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'groupForWorkflowOptIn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('0626100b-a4ba-4e00-9971-86fad52a6216', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'aGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('ba9ed509-b1f5-48ab-a334-c8530a6422dc', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'bGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('ece66293-8f31-4a84-8e8d-23da36e70846', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'artDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('034740a9-fa10-453b-af37-dc7897e98fb1', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'additional', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL, NULL),
+('e7ff94e8-19c9-4f0a-b8b7-28327edbf6ed', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'fake', '722f3d84-9c2b-4525-8f6e-e4b82c55a36c', NULL, NULL);
CREATE MEMORY TABLE PUBLIC.SYNCOPEGROUP_ANYTYPECLASS(
GROUP_ID VARCHAR(36),
ANYTYPECLASS_ID VARCHAR(255)
@@ -1569,7 +1565,6 @@ INSERT INTO PUBLIC.SYNCOPESCHEMA(ID) VALUES
('authentication.statuses'),
('log.lastlogindate'),
('return.password.value'),
-('identity.recertification.day.interval'),
('jwt.lifetime.minutes'),
('connector.conf.history.size'),
('resource.conf.history.size'),
@@ -1619,13 +1614,10 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEUSER(
LASTCHANGEDATE TIMESTAMP,
LASTMODIFIER VARCHAR(255),
STATUS VARCHAR(255),
- WORKFLOWID VARCHAR(255),
CHANGEPWDDATE TIMESTAMP,
CIPHERALGORITHM VARCHAR(20),
FAILEDLOGINS INTEGER,
LASTLOGINDATE TIMESTAMP,
- LASTRECERTIFICATION TIMESTAMP,
- LASTRECERTIFICATOR VARCHAR(255),
MUSTCHANGEPASSWORD INTEGER,
PASSWORD VARCHAR(255),
SECURITYANSWER VARCHAR(255),
@@ -1638,12 +1630,12 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEUSER(
);
ALTER TABLE PUBLIC.SYNCOPEUSER ADD CONSTRAINT PUBLIC.CONSTRAINT_6FFB PRIMARY KEY(ID);
-- 5 +/- SELECT COUNT(*) FROM PUBLIC.SYNCOPEUSER;
-INSERT INTO PUBLIC.SYNCOPEUSER(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, LASTRECERTIFICATION, LASTRECERTIFICATOR, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) VALUES
-('1417acbe-cbf6-4277-9372-e75e04f97000', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '4', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'rossini', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL),
-('74cd8ece-715a-44a4-a736-e17b46c4e7e6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '6', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'verdi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
-('b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '8', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'vivaldi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
-('c9b2dec2-00a7-4855-97c0-d854842b4b24', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '10', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'bellini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
-('823074dc-d280-436d-a7dd-07399fae48ec', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '12', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'puccini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL);
+INSERT INTO PUBLIC.SYNCOPEUSER(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) VALUES
+('1417acbe-cbf6-4277-9372-e75e04f97000', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'rossini', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL),
+('74cd8ece-715a-44a4-a736-e17b46c4e7e6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'verdi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
+('b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'vivaldi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
+('c9b2dec2-00a7-4855-97c0-d854842b4b24', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'bellini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
+('823074dc-d280-436d-a7dd-07399fae48ec', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'puccini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL);
CREATE MEMORY TABLE PUBLIC.SYNCOPEUSER_ANYTYPECLASS(
USER_ID VARCHAR(36),
ANYTYPECLASS_ID VARCHAR(255)
@@ -1720,7 +1712,6 @@ INSERT INTO PUBLIC.TASK(ID, DTYPE, ACTIVE, CRONEXPRESSION, DESCRIPTION, JOBDELEG
('316285cc-ae52-4ea2-a33b-7355e189ac3f', 'PropagationTask', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'USER', '[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"type","value":["type"]}]', NULL, '1417acbe-cbf6-4277-9372-e75e04f97000', '__ACCOUNT__', NULL, 'DELETE', 'ws-target-resource-2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('c41b9b71-9bfa-4f90-89f2-84787def4c5c', 'PullTask', 1, NULL, NULL, NULL, 'CSV (update matching; assign unmatching)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'resource-csv', 'UPDATE', 1, 1, 1, 1, 'ASSIGN', 'INCREMENTAL', NULL, 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('e95555d2-1b09-42c8-b25b-f4c4ec597979', 'SchedTask', 1, '0 0 0 1 * ?', NULL, 'org.apache.syncope.fit.core.reference.TestSampleJobDelegate', 'SampleJob Task', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
-('e95555d2-1b09-42c8-b25b-f4c4ec598989', 'SchedTask', 1, NULL, NULL, 'org.apache.syncope.core.provisioning.java.job.IdentityRecertification', 'Identity Recertification Task', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('89de5014-e3f5-4462-84d8-d97575740baf', 'SchedTask', 1, '0 0/5 * * * ?', NULL, 'org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup', 'Access Token Cleanup Task', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('d6c2d6d3-6329-44c1-9187-f1469ead1cfa', 'PropagationTask', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'USER', '[{"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"]}]', NULL, '1417acbe-cbf6-4277-9372-e75e04f97000', '__ACCOUNT__', NULL, 'UPDATE', 'ws-target-resource-nopropagation', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO PUBLIC.TASK(ID, DTYPE, ACTIVE, CRONEXPRESSION, DESCRIPTION, JOBDELEGATECLASSNAME, NAME, STARTAT, ANYTYPE, ANYTYPEKIND, ATTRIBUTES, CONNOBJECTKEY, ENTITYKEY, OBJECTCLASSNAME, OLDCONNOBJECTKEY, OPERATION, RESOURCE_ID, MATCHINGRULE, PERFORMCREATE, PERFORMDELETE, PERFORMUPDATE, SYNCSTATUS, UNMATCHINGRULE, PULLMODE, RECONCILIATIONFILTERBUILDERCLASSNAME, DESTINATIONREALM_ID, EXECUTED, HTMLBODY, SENDER, SUBJECT, TEXTBODY, TRACELEVEL, NOTIFICATION_ID, SOURCEREALM_ID) VALUES
@@ -2386,7 +2377,7 @@ SELECT
SS.USER_ID AS ANY_ID,
SS.ROLE_ID AS ROLE_ID
FROM PUBLIC.SYNCOPEUSER_SYNCOPEROLE SS;
-CREATE FORCE VIEW PUBLIC.ANYOBJECT_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, TYPE_ID) AS
+CREATE FORCE VIEW PUBLIC.ANYOBJECT_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, TYPE_ID) AS
SELECT
A.ID AS ANY_ID,
A.ID,
@@ -2395,7 +2386,6 @@ SELECT
A.LASTCHANGEDATE,
A.LASTMODIFIER,
A.STATUS,
- A.WORKFLOWID,
A.NAME,
A.REALM_ID,
A.TYPE_ID
@@ -2406,7 +2396,7 @@ SELECT
M.ANYOBJECT_ID AS RIGHT_ANY_ID,
M.TYPE_ID AS TYPE
FROM PUBLIC.URELATIONSHIP M;
-CREATE FORCE VIEW PUBLIC.USER_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, LASTRECERTIFICATION, LASTRECERTIFICATOR, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) AS
+CREATE FORCE VIEW PUBLIC.USER_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) AS
SELECT
U.ID AS ANY_ID,
U.ID,
@@ -2415,13 +2405,10 @@ SELECT
U.LASTCHANGEDATE,
U.LASTMODIFIER,
U.STATUS,
- U.WORKFLOWID,
U.CHANGEPWDDATE,
U.CIPHERALGORITHM,
U.FAILEDLOGINS,
U.LASTLOGINDATE,
- U.LASTRECERTIFICATION,
- U.LASTRECERTIFICATOR,
U.MUSTCHANGEPASSWORD,
U.PASSWORD,
U.SECURITYANSWER,
@@ -2527,7 +2514,7 @@ FROM PUBLIC.AMEMBERSHIP M
INNER JOIN PUBLIC.SYNCOPEGROUP G
ON 1=1
WHERE M.GROUP_ID = G.ID;
-CREATE FORCE VIEW PUBLIC.GROUP_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) AS
+CREATE FORCE VIEW PUBLIC.GROUP_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) AS
SELECT
R.ID AS ANY_ID,
R.ID,
@@ -2536,7 +2523,6 @@ SELECT
R.LASTCHANGEDATE,
R.LASTMODIFIER,
R.STATUS,
- R.WORKFLOWID,
R.NAME,
R.REALM_ID,
R.GROUPOWNER_ID,
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
index 3a9f21f..1f7daca 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
@@ -36,15 +36,6 @@ public interface AnyObjectWorkflowAdapter extends WorkflowAdapter {
WorkflowResult<String> create(AnyObjectTO anyObjectTO);
/**
- * Execute a task on a anyObject.
- *
- * @param anyObjectTO anyObject to be subject to task
- * @param taskId to be executed
- * @return anyObject just updated
- */
- WorkflowResult<String> execute(AnyObjectTO anyObjectTO, String taskId);
-
- /**
* Update a anyObject.
*
* @param anyObjectPatch modification set to be performed
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java
deleted file mode 100644
index 43fb0dd..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,22 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-public interface AnyObjectWorkflowDefinitionAdapter extends WorkflowDefinitionAdapter {
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
index 72595f6..e478a26 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
@@ -36,15 +36,6 @@ public interface GroupWorkflowAdapter extends WorkflowAdapter {
WorkflowResult<String> create(GroupTO groupTO);
/**
- * Execute a task on a group.
- *
- * @param groupTO group to be subject to task
- * @param taskId to be executed
- * @return group just updated
- */
- WorkflowResult<String> execute(GroupTO groupTO, String taskId);
-
- /**
* Update a group.
*
* @param groupPatch modification set to be performed
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java
deleted file mode 100644
index 6dc2241..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,22 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-public interface GroupWorkflowDefinitionAdapter extends WorkflowDefinitionAdapter {
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 537294d..a29e584 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,7 +22,6 @@ 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.
@@ -51,23 +50,6 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
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);
-
- /**
- * Execute a task on an user.
- *
- * @param userTO user to be subject to task
- * @param taskId to be executed
- * @return user just updated
- */
- WorkflowResult<String> execute(UserTO userTO, String taskId);
-
- /**
* Activate an user.
*
* @param userKey user to be activated
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java
deleted file mode 100644
index 93b3969..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,22 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-public interface UserWorkflowDefinitionAdapter extends WorkflowDefinitionAdapter {
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
index 07ca5b4..ba42c53 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
@@ -18,60 +18,10 @@
*/
package org.apache.syncope.core.workflow.api;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.patch.AnyPatch;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
-import org.apache.syncope.core.provisioning.api.WorkflowResult;
-
public interface WorkflowAdapter {
/**
* @return any string that might be interpreted as 'prefix' (say table prefix in SQL environments)
*/
String getPrefix();
-
- /**
- * Get the forms for current workflow process instances matching the provided parameters.
- *
- * @param page result page
- * @param size items per page
- * @param orderByClauses sort conditions
- * @return total number of forms, list of forms matching the provided parameters
- */
- Pair<Integer, List<WorkflowFormTO>> getForms(int page, int size, List<OrderByClause> orderByClauses);
-
- /**
- * Get form for given workflowId (if present).
- *
- * @param workflowId workflow id
- * @return form (if present), otherwise null
- */
- WorkflowFormTO getForm(String workflowId);
-
- /**
- * Claim a form for a given object.
- *
- * @param taskId Workflow task to which the form is associated
- * @return updated form
- */
- WorkflowFormTO claimForm(String taskId);
-
- /**
- * Submit a form.
- *
- * @param form to be submitted
- * @return object updated by this form submit
- */
- WorkflowResult<? extends AnyPatch> submitForm(WorkflowFormTO form);
-
- /**
- * Get tasks available for execution, for given workflow id.
- *
- * @param workflowId workflow id
- * @return available tasks
- */
- List<WorkflowTaskTO> getAvailableTasks(String workflowId);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java
deleted file mode 100644
index ea84598..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,64 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-import java.io.OutputStream;
-import java.util.List;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-
-public interface WorkflowDefinitionAdapter {
-
- /**
- * @return all available workflow definitions.
- */
- List<WorkflowDefinitionTO> getDefinitions();
-
- /**
- * Export the workflow definition for the given key, in the requested format.
- *
- * @param key definition key
- * @param format export format
- * @param os export stream
- */
- void exportDefinition(String key, WorkflowDefinitionFormat format, OutputStream os);
-
- /**
- * Export the workflow graphical representation for the given key (if available).
- *
- * @param key definition key
- * @param os export stream
- */
- void exportDiagram(String key, OutputStream os);
-
- /**
- * Import the workflow definition for the given key.
- *
- * @param key definition key
- * @param format import format
- * @param definition definition
- */
- void importDefinition(String key, WorkflowDefinitionFormat format, String definition);
-
- /**
- * Remove the workflow definition for the given key.
- *
- * @param key definition key
- */
- void deleteDefinition(String key);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java
deleted file mode 100644
index f7d67f2..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java
+++ /dev/null
@@ -1,29 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-/**
- * Format for import / export of workflow definition.
- */
-public enum WorkflowDefinitionFormat {
-
- XML,
- JSON
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/pom.xml
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/pom.xml b/core/workflow-flowable/pom.xml
deleted file mode 100644
index f78f452..0000000
--- a/core/workflow-flowable/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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-core</artifactId>
- <version>2.1.2-SNAPSHOT</version>
- </parent>
-
- <name>Apache Syncope Core Workflow Flowable</name>
- <description>Apache Syncope Core Workflow Flowable</description>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
- <packaging>jar</packaging>
-
- <properties>
- <rootpom.basedir>${basedir}/../..</rootpom.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-email</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.javamail</groupId>
- <artifactId>geronimo-javamail_1.4_mail</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-engine</artifactId>
- </dependency>
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-spring</artifactId>
- </dependency>
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-json-converter</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-java</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java
deleted file mode 100644
index 8c04545..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java
+++ /dev/null
@@ -1,92 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Resource;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.core.spring.ResourceWithFallbackLoader;
-import org.apache.syncope.core.persistence.api.SyncopeLoader;
-import org.apache.syncope.core.workflow.flowable.spring.DomainProcessEngine;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.engine.repository.ProcessDefinition;
-import org.flowable.spring.SpringProcessEngineConfiguration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class FlowableDefinitionLoader implements SyncopeLoader {
-
- private static final Logger LOG = LoggerFactory.getLogger(FlowableDefinitionLoader.class);
-
- @Resource(name = "userWorkflowDef")
- private ResourceWithFallbackLoader userWorkflowDef;
-
- @Autowired
- private DomainProcessEngine dpEngine;
-
- @Override
- public Integer getPriority() {
- return Integer.MIN_VALUE;
- }
-
- @Override
- public void load() {
- byte[] wfDef = new byte[0];
-
- try (InputStream wfIn = userWorkflowDef.getResource().getInputStream()) {
- wfDef = IOUtils.toByteArray(wfIn);
- } catch (IOException e) {
- LOG.error("While loading " + userWorkflowDef.getResource().getFilename(), e);
- }
-
- for (Map.Entry<String, ProcessEngine> entry : dpEngine.getEngines().entrySet()) {
- List<ProcessDefinition> processes = entry.getValue().getRepositoryService().
- createProcessDefinitionQuery().processDefinitionKey(FlowableUserWorkflowAdapter.WF_PROCESS_ID).
- list();
- LOG.debug(FlowableUserWorkflowAdapter.WF_PROCESS_ID + " Flowable processes in repository: {}", processes);
-
- // Only loads process definition from file if not found in repository
- if (processes.isEmpty()) {
- entry.getValue().getRepositoryService().createDeployment().addInputStream(
- userWorkflowDef.getResource().getFilename(), new ByteArrayInputStream(wfDef)).deploy();
-
- ProcessDefinition procDef = entry.getValue().getRepositoryService().createProcessDefinitionQuery().
- processDefinitionKey(FlowableUserWorkflowAdapter.WF_PROCESS_ID).latestVersion().
- singleResult();
-
- FlowableDeployUtils.deployModel(entry.getValue(), procDef);
-
- LOG.debug("Flowable Workflow definition loaded for domain {}", entry.getKey());
- }
-
- // jump to the next ID block
- for (int i = 0; i < entry.getValue().getProcessEngineConfiguration().getIdBlockSize(); i++) {
- SpringProcessEngineConfiguration.class.cast(entry.getValue().getProcessEngineConfiguration()).
- getIdGenerator().getNextId();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java
deleted file mode 100644
index b2c6537..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java
+++ /dev/null
@@ -1,92 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import org.apache.syncope.core.workflow.api.WorkflowException;
-import org.flowable.bpmn.converter.BpmnXMLConverter;
-import org.flowable.bpmn.model.BpmnModel;
-import org.flowable.editor.constants.ModelDataJsonConstants;
-import org.flowable.editor.language.json.converter.BpmnJsonConverter;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.common.engine.api.FlowableException;
-import org.flowable.engine.repository.Deployment;
-import org.flowable.engine.repository.Model;
-import org.flowable.engine.repository.ProcessDefinition;
-
-public final class FlowableDeployUtils {
-
- private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
- public static Deployment deployDefinition(
- final ProcessEngine engine, final String resourceName, final byte[] definition) {
-
- try {
- return engine.getRepositoryService().createDeployment().
- addInputStream(resourceName, new ByteArrayInputStream(definition)).deploy();
- } catch (FlowableException e) {
- throw new WorkflowException("While importing " + resourceName, e);
- }
- }
-
- public static void deployModel(final ProcessEngine engine, final ProcessDefinition procDef) {
- XMLStreamReader xtr = null;
- try (InputStream bpmnStream = engine.getRepositoryService().
- getResourceAsStream(procDef.getDeploymentId(), procDef.getResourceName());
- InputStreamReader isr = new InputStreamReader(bpmnStream)) {
-
- xtr = XMLInputFactory.newInstance().createXMLStreamReader(isr);
- BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
-
- Model model = engine.getRepositoryService().newModel();
- ObjectNode modelObjectNode = OBJECT_MAPPER.createObjectNode();
- modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, procDef.getName());
- model.setMetaInfo(modelObjectNode.toString());
- model.setName(procDef.getName());
- model.setDeploymentId(procDef.getDeploymentId());
- model.setVersion(procDef.getVersion());
-
- engine.getRepositoryService().saveModel(model);
- engine.getRepositoryService().addModelEditorSource(
- model.getId(),
- new BpmnJsonConverter().convertToJson(bpmnModel).toString().getBytes());
- } catch (Exception e) {
- throw new WorkflowException("While importing " + procDef.getResourceName(), e);
- } finally {
- if (xtr != null) {
- try {
- xtr.close();
- } catch (XMLStreamException e) {
- // ignore
- }
- }
- }
- }
-
- private FlowableDeployUtils() {
- // private constructor for static utility class
- }
-}
[33/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
deleted file mode 100644
index 24f0e59..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDirectoryPanel.java
+++ /dev/null
@@ -1,358 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.commons.DirectoryDataProvider;
-import org.apache.syncope.client.console.panels.DirectoryPanel;
-import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
-import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel.ApprovalProvider;
-import org.apache.syncope.client.console.layout.FormLayoutInfoUtils;
-import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.rest.AnyTypeRestClient;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
-import org.apache.syncope.client.console.wizards.AjaxWizard;
-import org.apache.syncope.client.console.wizards.any.AnyWrapper;
-import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
-import org.apache.syncope.common.lib.AnyOperations;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.ProvisioningResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.event.Broadcast;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-
-public class ApprovalDirectoryPanel
- extends DirectoryPanel<WorkflowFormTO, WorkflowFormTO, ApprovalProvider, UserWorkflowRestClient> {
-
- private static final long serialVersionUID = -7122136682275797903L;
-
- protected final BaseModal<WorkflowFormTO> manageApprovalModal = new BaseModal<WorkflowFormTO>("outer") {
-
- private static final long serialVersionUID = 389935548143327858L;
-
- @Override
- protected void onConfigure() {
- super.onConfigure();
- addSubmitButton();
- size(Modal.Size.Large);
- }
-
- };
-
- public ApprovalDirectoryPanel(final String id, final PageReference pageReference) {
- super(id, pageReference, true);
- disableCheckBoxes();
- setFooterVisibility(false);
- modal.size(Modal.Size.Large);
-
- addOuterObject(manageApprovalModal);
-
- manageApprovalModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
- private static final long serialVersionUID = 8804221891699487139L;
-
- @Override
- public void onClose(final AjaxRequestTarget target) {
- updateResultTable(target);
- ((BasePage) pageReference.getPage()).getApprovalsWidget().refreshLatestAlerts(target);
- manageApprovalModal.show(false);
- }
- });
-
- restClient = new UserWorkflowRestClient();
-
- initResultTable();
-
- MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.WORKFLOW_FORM_SUBMIT);
- }
-
- @Override
- protected List<IColumn<WorkflowFormTO, String>> getColumns() {
- List<IColumn<WorkflowFormTO, String>> columns = new ArrayList<>();
-
- columns.add(new PropertyColumn<>(
- new ResourceModel("taskId"), "taskId", "taskId"));
- columns.add(new PropertyColumn<>(
- new ResourceModel("key"), "key"));
- columns.add(new PropertyColumn<>(
- new ResourceModel("username"), "username"));
- columns.add(new DatePropertyColumn<>(
- new ResourceModel("createTime"), "createTime", "createTime"));
- columns.add(new DatePropertyColumn<>(
- new ResourceModel("dueDate"), "dueDate", "dueDate"));
- columns.add(new PropertyColumn<>(
- new ResourceModel("owner"), "owner", "owner"));
-
- return columns;
- }
-
- @Override
- public ActionsPanel<WorkflowFormTO> getActions(final IModel<WorkflowFormTO> model) {
- final ActionsPanel<WorkflowFormTO> panel = super.getActions(model);
-
- panel.add(new ActionLink<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -3722207913631435501L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowFormTO ignore) {
- claimForm(model.getObject().getTaskId());
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- target.add(container);
- }
- }, ActionLink.ActionType.CLAIM, StandardEntitlement.WORKFLOW_FORM_CLAIM);
-
- panel.add(new ActionLink<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -3722207913631435501L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowFormTO ignore) {
- manageApprovalModal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
-
- target.add(manageApprovalModal.setContent(
- new ApprovalModal(manageApprovalModal, pageRef, model.getObject()) {
-
- private static final long serialVersionUID = 5546519445061007248L;
-
- @Override
- public void onSubmit(final AjaxRequestTarget target) {
- try {
- super.onSubmit(target);
-
- ApprovalDirectoryPanel.this.getTogglePanel().close(target);
- } catch (SyncopeClientException e) {
- SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-
- }));
-
- manageApprovalModal.header(new Model<>(getString("approval.manage", new Model<>(model.getObject()))));
- manageApprovalModal.show(true);
- }
-
- @Override
- protected boolean statusCondition(final WorkflowFormTO modelObject) {
- return SyncopeConsoleSession.get().getSelfTO().getUsername().
- equals(model.getObject().getOwner());
- }
-
- }, ActionLink.ActionType.MANAGE_APPROVAL, StandardEntitlement.WORKFLOW_FORM_READ);
-
- // SYNCOPE-1200 edit user while in approval state
- panel.add(new ActionLink<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -3722207913631435501L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowFormTO ignore) {
- modal.setFormModel(new CompoundPropertyModel<>(model.getObject()));
-
- WorkflowFormTO formTO = model.getObject();
- UserTO newUserTO;
- UserTO previousUserTO;
- if (formTO.getUserPatch() == null) {
- newUserTO = formTO.getUserTO();
- previousUserTO = null;
- } else if (formTO.getUserTO() == null) {
- // make it stronger by handling possible NPE
- previousUserTO = new UserTO();
- previousUserTO.setKey(formTO.getUserPatch().getKey());
- newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
- } else {
- previousUserTO = formTO.getUserTO();
- formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
- formTO.getUserTO().setPassword(null);
- newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
- }
-
- AjaxWizard.EditItemActionEvent<UserTO> editItemActionEvent =
- new AjaxWizard.EditItemActionEvent<>(newUserTO, target);
- editItemActionEvent.forceModalPanel(new ApprovalUserWizardBuilder(
- model.getObject(),
- previousUserTO,
- newUserTO,
- new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
- FormLayoutInfoUtils.fetch(Collections.singletonList(AnyTypeKind.USER.name())).getLeft(),
- pageRef
- ).build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT));
-
- send(ApprovalDirectoryPanel.this, Broadcast.EXACT, editItemActionEvent);
- }
-
- @Override
- protected boolean statusCondition(final WorkflowFormTO modelObject) {
- return SyncopeConsoleSession.get().getSelfTO().getUsername().
- equals(model.getObject().getOwner());
- }
-
- }, ActionLink.ActionType.EDIT_APPROVAL, StandardEntitlement.WORKFLOW_FORM_SUBMIT);
-
- return panel;
- }
-
- @Override
- protected ApprovalProvider dataProvider() {
- return new ApprovalProvider(rows);
- }
-
- @Override
- protected String paginatorRowsKey() {
- return Constants.PREF_WORKFLOW_FORM_PAGINATOR_ROWS;
- }
-
- public static class ApprovalProvider extends DirectoryDataProvider<WorkflowFormTO> {
-
- private static final long serialVersionUID = -2311716167583335852L;
-
- private final UserWorkflowRestClient restClient = new UserWorkflowRestClient();
-
- public ApprovalProvider(final int paginatorRows) {
- super(paginatorRows);
-
- setSort("createTime", SortOrder.ASCENDING);
- }
-
- @Override
- public Iterator<WorkflowFormTO> iterator(final long first, final long count) {
- int page = ((int) first / paginatorRows);
- return restClient.getForms((page < 0 ? 0 : page) + 1, paginatorRows, getSort()).iterator();
- }
-
- @Override
- public long size() {
- return restClient.countForms();
- }
-
- @Override
- public IModel<WorkflowFormTO> model(final WorkflowFormTO form) {
- return new IModel<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -2566070996511906708L;
-
- @Override
- public WorkflowFormTO getObject() {
- return form;
- }
- };
- }
- }
-
- @Override
- protected Collection<ActionLink.ActionType> getBatches() {
- return Collections.<ActionLink.ActionType>emptyList();
- }
-
- private void claimForm(final String taskId) {
- try {
- restClient.claimForm(taskId);
- } catch (SyncopeClientException scee) {
- SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + scee.getMessage());
- }
- }
-
- private class ApprovalUserWizardBuilder extends UserWizardBuilder {
-
- private static final long serialVersionUID = 1854981134836384069L;
-
- private final WorkflowFormTO formTO;
-
- ApprovalUserWizardBuilder(
- final WorkflowFormTO formTO,
- final UserTO previousUserTO,
- final UserTO userTO,
- final List<String> anyTypeClasses,
- final UserFormLayoutInfo formLayoutInfo,
- final PageReference pageRef) {
-
- super(previousUserTO, userTO, anyTypeClasses, formLayoutInfo, pageRef);
- this.formTO = formTO;
- }
-
- @Override
- protected Serializable onApplyInternal(final AnyWrapper<UserTO> modelObject) {
- UserTO inner = modelObject.getInnerObject();
-
- ProvisioningResult<UserTO> result;
-
- if (formTO.getUserPatch() == null) {
- result = new ProvisioningResult<>();
- UserTO user = new UserWorkflowRestClient().executeTask("default", inner);
- result.setEntity(user);
- claimForm(restClient.getFormForUser(result.getEntity().getKey()).getTaskId());
- } else {
- UserPatch patch = AnyOperations.diff(inner, formTO.getUserTO(), false);
-
- if (StringUtils.isNotBlank(inner.getPassword())) {
- PasswordPatch passwordPatch = new PasswordPatch.Builder().
- value(inner.getPassword()).onSyncope(true).resources(inner.
- getResources()).
- build();
- patch.setPassword(passwordPatch);
- }
- // update just if it is changed
- if (patch.isEmpty()) {
- result = new ProvisioningResult<>();
- result.setEntity(inner);
- } else {
- result = userRestClient.update(getOriginalItem().getInnerObject().getETagValue(), patch);
- WorkflowFormTO workFlowTO = restClient.getFormForUser(result.getEntity().getKey());
- if (workFlowTO != null) {
- claimForm(workFlowTO.getTaskId());
- }
- }
-
- }
-
- return result;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
deleted file mode 100644
index 1b1ce48..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalModal.java
+++ /dev/null
@@ -1,82 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.panels.MultilevelPanel;
-import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.syncope.client.console.panels.SubmitableModalPanel;
-import org.apache.syncope.client.console.panels.WizardModalPanel;
-
-public class ApprovalModal extends Panel implements SubmitableModalPanel, WizardModalPanel<WorkflowFormTO> {
-
- private static final long serialVersionUID = -8847854414429745216L;
-
- private final UserWorkflowRestClient restClient = new UserWorkflowRestClient();
-
- private final BaseModal<?> modal;
-
- private final WorkflowFormTO formTO;
-
- private final PageReference pageRef;
-
- public ApprovalModal(final BaseModal<?> modal, final PageReference pageRef, final WorkflowFormTO formTO) {
- super(BaseModal.CONTENT_ID);
- this.modal = modal;
- this.formTO = formTO;
- this.pageRef = pageRef;
-
- MultilevelPanel mlp = new MultilevelPanel("approval");
- mlp.setFirstLevel(new Approval(pageRef, formTO) {
-
- private static final long serialVersionUID = -2195387360323687302L;
-
- @Override
- protected void viewDetails(final AjaxRequestTarget target) {
- mlp.next(getString("approval.details"), new ApprovalDetails(pageRef, formTO), target);
- }
- });
- add(mlp);
- }
-
- @Override
- public void onSubmit(final AjaxRequestTarget target) {
- this.restClient.submitForm(formTO);
- this.modal.show(false);
- this.modal.close(target);
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- }
-
- @Override
- public void onError(final AjaxRequestTarget target) {
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-
- @Override
- public WorkflowFormTO getItem() {
- return this.formTO;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
index 2bfd9ed..48b58137 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
@@ -37,8 +37,6 @@ public final class Constants {
public static final String VEIL_INDICATOR_MARKUP_ID = "veil";
- public static final String FLOWABLE_MODELER_CONTEXT = "flowable-modeler";
-
public static final String MODELER_CONTEXT = "modelerContext";
public static final String MODEL_ID_PARAM = "modelId";
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
index 876d299..edb7b61 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
@@ -34,10 +34,12 @@ import org.apache.syncope.client.console.pages.BaseExtPage;
import org.apache.syncope.client.console.annotations.BinaryPreview;
import org.apache.syncope.client.console.annotations.ExtPage;
import org.apache.syncope.client.console.annotations.ExtWidget;
+import org.apache.syncope.client.console.annotations.Resource;
import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.panels.SSOLoginFormPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
import org.apache.syncope.client.console.widgets.BaseExtWidget;
+import org.apache.syncope.client.console.widgets.ExtAlertWidget;
import org.apache.syncope.common.lib.policy.AccountRuleConf;
import org.apache.syncope.common.lib.policy.PasswordRuleConf;
import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
@@ -46,6 +48,7 @@ import org.apache.syncope.common.lib.report.ReportletConf;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.request.resource.AbstractResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
@@ -93,6 +96,8 @@ public class ClassPathScanImplementationLookup {
private List<Class<? extends BaseExtWidget>> extWidgets;
+ private List<Class<? extends ExtAlertWidget<?>>> extAlertWidgets;
+
private List<Class<? extends SSOLoginFormPanel>> ssoLoginFormPanels;
private Map<String, Class<? extends ReportletConf>> reportletConfs;
@@ -105,6 +110,8 @@ public class ClassPathScanImplementationLookup {
private Map<String, Class<? extends PushCorrelationRuleConf>> pushCorrelationRuleConfs;
+ private List<Class<? extends AbstractResource>> resources;
+
/**
* This method can be overridden by subclasses to customize classpath scan.
*
@@ -120,24 +127,28 @@ public class ClassPathScanImplementationLookup {
previewers = new ArrayList<>();
extPages = new ArrayList<>();
extWidgets = new ArrayList<>();
+ extAlertWidgets = new ArrayList<>();
ssoLoginFormPanels = new ArrayList<>();
reportletConfs = new HashMap<>();
accountRuleConfs = new HashMap<>();
passwordRuleConfs = new HashMap<>();
pullCorrelationRuleConfs = new HashMap<>();
pushCorrelationRuleConfs = new HashMap<>();
+ resources = new ArrayList<>();
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.addIncludeFilter(new AssignableTypeFilter(BasePage.class));
scanner.addIncludeFilter(new AssignableTypeFilter(AbstractBinaryPreviewer.class));
scanner.addIncludeFilter(new AssignableTypeFilter(BaseExtPage.class));
scanner.addIncludeFilter(new AssignableTypeFilter(BaseExtWidget.class));
+ scanner.addIncludeFilter(new AssignableTypeFilter(ExtAlertWidget.class));
scanner.addIncludeFilter(new AssignableTypeFilter(SSOLoginFormPanel.class));
scanner.addIncludeFilter(new AssignableTypeFilter(ReportletConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(AccountRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PasswordRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PullCorrelationRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PushCorrelationRuleConf.class));
+ scanner.addIncludeFilter(new AssignableTypeFilter(AbstractResource.class));
scanner.findCandidateComponents(getBasePackage()).forEach(bd -> {
try {
@@ -160,6 +171,13 @@ public class ClassPathScanImplementationLookup {
LOG.error("Could not find annotation {} in {}, ignoring",
ExtWidget.class.getName(), clazz.getName());
}
+ } else if (ExtAlertWidget.class.isAssignableFrom(clazz)) {
+ if (clazz.isAnnotationPresent(ExtWidget.class)) {
+ extAlertWidgets.add((Class<? extends ExtAlertWidget<?>>) clazz);
+ } else {
+ LOG.error("Could not find annotation {} in {}, ignoring",
+ ExtWidget.class.getName(), clazz.getName());
+ }
} else if (BasePage.class.isAssignableFrom(clazz)) {
pages.add((Class<? extends BasePage>) clazz);
} else if (AbstractBinaryPreviewer.class.isAssignableFrom(clazz)) {
@@ -176,6 +194,13 @@ public class ClassPathScanImplementationLookup {
pullCorrelationRuleConfs.put(clazz.getName(), (Class<? extends PullCorrelationRuleConf>) clazz);
} else if (PushCorrelationRuleConf.class.isAssignableFrom(clazz)) {
pushCorrelationRuleConfs.put(clazz.getName(), (Class<? extends PushCorrelationRuleConf>) clazz);
+ } else if (AbstractResource.class.isAssignableFrom(clazz)) {
+ if (clazz.isAnnotationPresent(Resource.class)) {
+ resources.add((Class<? extends AbstractResource>) clazz);
+ } else {
+ LOG.error("Could not find annotation {} in {}, ignoring",
+ Resource.class.getName(), clazz.getName());
+ }
}
}
} catch (Throwable t) {
@@ -185,18 +210,21 @@ public class ClassPathScanImplementationLookup {
pages = Collections.unmodifiableList(pages);
previewers = Collections.unmodifiableList(previewers);
- Collections.sort(extPages, (o1, o2)
- -> ObjectUtils.compare(
- o1.getAnnotation(ExtPage.class).priority(),
- o2.getAnnotation(ExtPage.class).priority()));
+ extPages.sort((o1, o2) -> ObjectUtils.compare(
+ o1.getAnnotation(ExtPage.class).priority(),
+ o2.getAnnotation(ExtPage.class).priority()));
extPages = Collections.unmodifiableList(extPages);
- Collections.sort(extWidgets, (o1, o2)
- -> ObjectUtils.compare(
- o1.getAnnotation(ExtWidget.class).priority(),
- o2.getAnnotation(ExtWidget.class).priority()));
+ extWidgets.sort((o1, o2) -> ObjectUtils.compare(
+ o1.getAnnotation(ExtWidget.class).priority(),
+ o2.getAnnotation(ExtWidget.class).priority()));
extWidgets = Collections.unmodifiableList(extWidgets);
+ extAlertWidgets.sort((o1, o2) -> ObjectUtils.compare(
+ o1.getAnnotation(ExtWidget.class).priority(),
+ o2.getAnnotation(ExtWidget.class).priority()));
+ extAlertWidgets = Collections.unmodifiableList(extAlertWidgets);
+
ssoLoginFormPanels = Collections.unmodifiableList(ssoLoginFormPanels);
reportletConfs = Collections.unmodifiableMap(reportletConfs);
@@ -205,15 +233,19 @@ public class ClassPathScanImplementationLookup {
pullCorrelationRuleConfs = Collections.unmodifiableMap(pullCorrelationRuleConfs);
pushCorrelationRuleConfs = Collections.unmodifiableMap(pushCorrelationRuleConfs);
+ resources = Collections.unmodifiableList(resources);
+
LOG.debug("Binary previewers found: {}", previewers);
LOG.debug("Extension pages found: {}", extPages);
LOG.debug("Extension widgets found: {}", extWidgets);
+ LOG.debug("Extension alert widgets found: {}", extAlertWidgets);
LOG.debug("SSO Login pages found: {}", ssoLoginFormPanels);
LOG.debug("Reportlet configurations found: {}", reportletConfs);
LOG.debug("Account Rule configurations found: {}", accountRuleConfs);
LOG.debug("Password Rule configurations found: {}", passwordRuleConfs);
LOG.debug("Pull Correlation Rule configurations found: {}", pullCorrelationRuleConfs);
LOG.debug("Push Correlation Rule configurations found: {}", pushCorrelationRuleConfs);
+ LOG.debug("Resources found: {}", resources);
}
public Class<? extends AbstractBinaryPreviewer> getPreviewerClass(final String mimeType) {
@@ -242,6 +274,10 @@ public class ClassPathScanImplementationLookup {
return extWidgets;
}
+ public List<Class<? extends ExtAlertWidget<?>>> getExtAlertWidgetClasses() {
+ return extAlertWidgets;
+ }
+
public List<Class<? extends SSOLoginFormPanel>> getSSOLoginFormPanels() {
return ssoLoginFormPanels;
}
@@ -265,4 +301,8 @@ public class ClassPathScanImplementationLookup {
public Map<String, Class<? extends PushCorrelationRuleConf>> getPushCorrelationRuleConfs() {
return pushCorrelationRuleConfs;
}
+
+ public List<Class<? extends AbstractResource>> getResources() {
+ return resources;
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
deleted file mode 100644
index 0dbc4db..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Approvals.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.syncope.client.console.pages;
-
-import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
-import org.apache.syncope.client.console.approvals.ApprovalDirectoryPanel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-
-public class Approvals extends BasePage {
-
- private static final long serialVersionUID = -1100228004207271271L;
-
- public Approvals(final PageParameters parameters) {
- super(parameters);
-
- body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
-
- WebMarkupContainer content = new WebMarkupContainer("content");
- content.setOutputMarkupId(true);
- body.add(content);
-
- content.add(new ApprovalDirectoryPanel("wfPanel", getPageReference()));
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index d79cec7..a4ef3f0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -19,6 +19,7 @@
package org.apache.syncope.client.console.pages;
import java.io.Serializable;
+import java.lang.reflect.Constructor;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
@@ -34,7 +35,7 @@ import org.apache.syncope.client.console.rest.ConfRestClient;
import org.apache.syncope.client.console.topology.Topology;
import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.widgets.ApprovalsWidget;
+import org.apache.syncope.client.console.widgets.ExtAlertWidget;
import org.apache.syncope.client.console.widgets.RemediationsWidget;
import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.lib.info.SystemInfo;
@@ -42,6 +43,7 @@ import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.IAjaxIndicatorAware;
import org.apache.wicket.ajax.attributes.AjaxCallListener;
@@ -81,8 +83,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
protected NotificationPanel notificationPanel;
- protected ApprovalsWidget approvalsWidget;
-
protected RemediationsWidget remediationWidget;
public BasePage() {
@@ -108,9 +108,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
remediationWidget = new RemediationsWidget("remediationWidget", getPageReference());
body.add(remediationWidget.setRenderBodyOnly(true));
- approvalsWidget = new ApprovalsWidget("approvalsWidget", getPageReference());
- body.add(approvalsWidget.setRenderBodyOnly(true));
-
// right sidebar
PlatformInfo platformInfo = SyncopeConsoleSession.get().getPlatformInfo();
Label version = new Label("version", platformInfo.getVersion());
@@ -187,14 +184,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
WebMarkupContainer confULContainer = new WebMarkupContainer(getULContainerId("configuration"));
confLIContainer.add(confULContainer);
- liContainer = new WebMarkupContainer(getLIContainerId("workflow"));
- liContainer.setOutputMarkupPlaceholderTag(true);
- liContainer.setVisible(platformInfo.getUserWorkflowAdapter().contains("Flowable"));
- confULContainer.add(liContainer);
- link = BookmarkablePageLinkBuilder.build("workflow", Workflow.class);
- MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, StandardEntitlement.WORKFLOW_DEF_GET);
- liContainer.add(link);
-
liContainer = new WebMarkupContainer(getLIContainerId("audit"));
confULContainer.add(liContainer);
link = BookmarkablePageLinkBuilder.build("audit", Audit.class);
@@ -331,10 +320,33 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
}
// Extensions
- ClassPathScanImplementationLookup classPathScanImplementationLookup =
- (ClassPathScanImplementationLookup) SyncopeConsoleApplication.get().
- getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
- List<Class<? extends BaseExtPage>> extPageClasses = classPathScanImplementationLookup.getExtPageClasses();
+ ClassPathScanImplementationLookup lookup = (ClassPathScanImplementationLookup) SyncopeConsoleApplication.get().
+ getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
+
+ List<Class<? extends ExtAlertWidget<?>>> extAlertWidgetClasses = lookup.getExtAlertWidgetClasses();
+ ListView<Class<? extends ExtAlertWidget<?>>> extAlertWidgets = new ListView<Class<? extends ExtAlertWidget<?>>>(
+ "extAlertWidgets", extAlertWidgetClasses) {
+
+ private static final long serialVersionUID = -9112553137618363167L;
+
+ @Override
+ protected void populateItem(final ListItem<Class<? extends ExtAlertWidget<?>>> item) {
+ try {
+ Constructor<? extends ExtAlertWidget<?>> constructor =
+ item.getModelObject().getDeclaredConstructor(String.class, PageReference.class);
+ ExtAlertWidget<?> widget = constructor.newInstance("extAlertWidget", getPageReference());
+
+ SyncopeConsoleSession.get().setAttribute(widget.getClass().getName(), widget);
+
+ item.add(widget.setRenderBodyOnly(true));
+ } catch (Exception e) {
+ LOG.error("Could not instantiate {}", item.getModelObject().getName(), e);
+ }
+ }
+ };
+ body.add(extAlertWidgets);
+
+ List<Class<? extends BaseExtPage>> extPageClasses = lookup.getExtPageClasses();
WebMarkupContainer extensionsLI = new WebMarkupContainer(getLIContainerId("extensions"));
extensionsLI.setOutputMarkupPlaceholderTag(true);
@@ -431,10 +443,6 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
return remediationWidget;
}
- public ApprovalsWidget getApprovalsWidget() {
- return approvalsWidget;
- }
-
/**
* Set a WindowClosedCallback for a Modal instance.
*
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
deleted file mode 100644
index b55d2b5..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.java
+++ /dev/null
@@ -1,27 +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.
- */
-package org.apache.syncope.client.console.pages;
-
-import org.apache.wicket.markup.html.WebPage;
-
-public class FlowableModelerPopupPage extends WebPage {
-
- private static final long serialVersionUID = -7031206743629422898L;
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
deleted file mode 100644
index 5ab09c3..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
+++ /dev/null
@@ -1,64 +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.
- */
-package org.apache.syncope.client.console.pages;
-
-import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.panels.WorkflowDirectoryPanel;
-import org.apache.syncope.client.console.wizards.WizardMgtPanel;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-
-public class Workflow extends BasePage {
-
- private static final long serialVersionUID = -8781434495150074529L;
-
- public Workflow(final PageParameters parameters) {
- super(parameters);
-
- body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
-
- WebMarkupContainer content = new WebMarkupContainer("content");
- content.setOutputMarkupId(true);
- body.add(content);
-
- WebMarkupContainer disabled = new WebMarkupContainer("disabled");
- disabled.setOutputMarkupPlaceholderTag(true);
- content.add(disabled);
-
- WizardMgtPanel<WorkflowDefinitionTO> workflowsPanel = new WorkflowDirectoryPanel.Builder(getPageReference()) {
-
- private static final long serialVersionUID = -5960765294082359003L;
-
- }.disableCheckBoxes().build("workflowsPanel");
- workflowsPanel.setOutputMarkupPlaceholderTag(true);
- MetaDataRoleAuthorizationStrategy.authorize(workflowsPanel, ENABLE, StandardEntitlement.WORKFLOW_DEF_LIST);
-
- content.add(workflowsPanel);
-
- if (SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Flowable")) {
- disabled.setVisible(false);
- } else {
- workflowsPanel.setVisible(false);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
deleted file mode 100644
index f0971c6..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
+++ /dev/null
@@ -1,87 +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.
- */
-package org.apache.syncope.client.console.panels;
-
-import java.io.Serializable;
-import javax.ws.rs.core.MediaType;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.pdfbox.util.Charsets;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.Model;
-
-public class NewWorkflowProcess extends TogglePanel<Serializable> {
-
- private static final long serialVersionUID = -4886361549305302161L;
-
- private final WorkflowRestClient restClient = new WorkflowRestClient();
-
- private final Form<?> form;
-
- public NewWorkflowProcess(final String id, final WebMarkupContainer container, final PageReference pageRef) {
- super(id, pageRef);
-
- form = new Form<>("form");
- addInnerObject(form);
-
- final TextField<String> key = new TextField<>("key", new Model<>());
- key.setRequired(true);
- form.add(key);
-
- form.add(new AjaxSubmitLink("submit", form) {
-
- private static final long serialVersionUID = 4947613489823025052L;
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target) {
- try {
- restClient.setDefinition(MediaType.APPLICATION_XML_TYPE, key.getModelObject(),
- IOUtils.toString(
- getClass().getResourceAsStream("empty.bpmn20.xml"),
- Charsets.UTF_8.name()).replaceAll("%KEY%", key.getModelObject()));
-
- key.getModel().setObject(null);
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- toggle(target, false);
- target.add(container);
- } catch (Exception e) {
- LOG.error("While creating new workflow process", e);
- SyncopeConsoleSession.get().error(
- StringUtils.isBlank(e.getMessage())
- ? e.getClass().getName() : e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target) {
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
- });
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
index 9bce309..8cd3fb8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDirectoryPanel.java
@@ -166,7 +166,6 @@ public class ParametersDirectoryPanel
super.populateItem(item, componentId, rowModel);
}
}
-
});
return columns;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
index e9f8029..fb8047c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
@@ -42,8 +42,6 @@ import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.SecurityQuestionTO;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.PageReference;
@@ -202,12 +200,8 @@ public abstract class TogglePanel<T extends Serializable> extends WizardMgtPanel
key = ((AccessTokenTO) modelObject).getKey();
} else if (modelObject instanceof ExecTO) {
key = ((ExecTO) modelObject).getKey();
- } else if (modelObject instanceof WorkflowDefinitionTO) {
- key = ((WorkflowDefinitionTO) modelObject).getKey();
} else if (modelObject instanceof ProvisioningTaskTO) {
key = ((ProvisioningTaskTO) modelObject).getKey();
- } else if (modelObject instanceof WorkflowFormTO) {
- key = ((WorkflowFormTO) modelObject).getKey();
} else if (modelObject instanceof EntityTO) {
key = ((EntityTO) modelObject).getKey();
} else if (modelObject instanceof StatusBean) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
deleted file mode 100644
index a640367..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
+++ /dev/null
@@ -1,333 +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.
- */
-package org.apache.syncope.client.console.panels;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleApplication;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.commons.DirectoryDataProvider;
-import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.pages.ModelerPopupPage;
-import org.apache.syncope.client.console.panels.WorkflowDirectoryPanel.WorkflowDefinitionDataProvider;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.ImageModalPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.XMLEditorPanel;
-import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
-import org.apache.syncope.client.console.wizards.WizardMgtPanel;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.Page;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
-import org.apache.wicket.extensions.wizard.WizardModel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.util.io.IOUtils;
-
-public class WorkflowDirectoryPanel extends DirectoryPanel<
- WorkflowDefinitionTO, WorkflowDefinitionTO, WorkflowDefinitionDataProvider, WorkflowRestClient> {
-
- private static final long serialVersionUID = 2705668831139984998L;
-
- private final BaseModal<String> utility;
-
- private String modelerCtx;
-
- protected WorkflowDirectoryPanel(final String id, final Builder builder) {
- super(id, builder);
-
- this.addNewItemPanelBuilder(new AjaxWizardBuilder<WorkflowDefinitionTO>(new WorkflowDefinitionTO(), pageRef) {
-
- private static final long serialVersionUID = 1633859795677053912L;
-
- @Override
- protected WizardModel buildModelSteps(
- final WorkflowDefinitionTO modelObject, final WizardModel wizardModel) {
-
- return wizardModel;
- }
- }, false);
- final NewWorkflowProcess newWorkflowProcess = new NewWorkflowProcess("newWorkflowProcess", container, pageRef);
- addInnerObject(newWorkflowProcess);
- AjaxLink<Void> newWorkflowProcessLink = new AjaxLink<Void>("add") {
-
- private static final long serialVersionUID = -7978723352517770644L;
-
- @Override
- public void onClick(final AjaxRequestTarget target) {
- newWorkflowProcess.toggle(target, true);
- }
- };
- ((WebMarkupContainer) get("container:content")).addOrReplace(newWorkflowProcessLink);
-
- setShowResultPage(true);
-
- modal.size(Modal.Size.Large);
-
- utility = new BaseModal<>("outer");
- addOuterObject(utility);
- utility.size(Modal.Size.Large);
- AjaxSubmitLink xmlEditorSubmit = utility.addSubmitButton();
- MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, RENDER, StandardEntitlement.WORKFLOW_DEF_SET);
- utility.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
- private static final long serialVersionUID = 8804221891699487139L;
-
- @Override
- public void onClose(final AjaxRequestTarget target) {
- utility.show(false);
- utility.close(target);
- }
- });
- initResultTable();
-
- // Check if Flowable Modeler directory is found
- modelerCtx = null;
- try {
- if (SyncopeConsoleApplication.get().getFlowableModelerDirectory() != null) {
- File baseDir = new File(SyncopeConsoleApplication.get().getFlowableModelerDirectory());
- if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
- modelerCtx = Constants.FLOWABLE_MODELER_CONTEXT;
- }
- }
- } catch (Exception e) {
- LOG.error("Could not check for Modeler directory", e);
- }
- }
-
- @Override
- protected WorkflowDefinitionDataProvider dataProvider() {
- return new WorkflowDefinitionDataProvider(rows);
- }
-
- @Override
- protected String paginatorRowsKey() {
- return Constants.PREF_WORKFLOW_PAGINATOR_ROWS;
- }
-
- @Override
- protected List<IColumn<WorkflowDefinitionTO, String>> getColumns() {
- List<IColumn<WorkflowDefinitionTO, String>> columns = new ArrayList<>();
-
- columns.add(new KeyPropertyColumn<>(new ResourceModel("key"), "key"));
- columns.add(new PropertyColumn<>(new ResourceModel("name"), "name", "name"));
- columns.add(new BooleanPropertyColumn<>(new ResourceModel("main"), null, "main"));
-
- return columns;
- }
-
- @Override
- public ActionsPanel<WorkflowDefinitionTO> getActions(final IModel<WorkflowDefinitionTO> model) {
- final ActionsPanel<WorkflowDefinitionTO> panel = super.getActions(model);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = -184018732772021627L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- final IModel<String> wfDefinition = new Model<>();
- try {
- wfDefinition.setObject(IOUtils.toString(restClient.getDefinition(
- MediaType.APPLICATION_XML_TYPE, model.getObject().getKey())));
- } catch (IOException e) {
- LOG.error("Could not get workflow definition", e);
- }
-
- utility.header(Model.of(model.getObject().getKey()));
- utility.setContent(new XMLEditorPanel(utility, wfDefinition, false, pageRef) {
-
- private static final long serialVersionUID = -7688359318035249200L;
-
- @Override
- public void onSubmit(final AjaxRequestTarget target) {
- if (StringUtils.isNotBlank(wfDefinition.getObject())) {
- try {
- restClient.setDefinition(MediaType.APPLICATION_XML_TYPE,
- model.getObject().getKey(), wfDefinition.getObject());
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
-
- target.add(container);
- utility.show(false);
- utility.close(target);
- } catch (SyncopeClientException e) {
- SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
- ? e.getClass().getName() : e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
- }
- });
- utility.show(target);
- target.add(utility);
- }
- }, ActionLink.ActionType.EDIT, StandardEntitlement.WORKFLOW_DEF_SET);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = 3109256773218160485L;
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- modal.header(Model.of(model.getObject().getKey()));
- modal.setContent(new ImageModalPanel<>(
- modal, restClient.getDiagram(model.getObject().getKey()), pageRef));
- modal.show(target);
- target.add(modal);
- }
- }, ActionLink.ActionType.VIEW, StandardEntitlement.WORKFLOW_DEF_GET);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = -184018732772021627L;
-
- @Override
- public Class<? extends Page> getPageClass() {
- return ModelerPopupPage.class;
- }
-
- @Override
- public PageParameters getPageParameters() {
- PageParameters parameters = new PageParameters();
- if (modelerCtx != null) {
- parameters.add(Constants.MODELER_CONTEXT, modelerCtx);
- }
- parameters.add(Constants.MODEL_ID_PARAM, model.getObject().getModelId());
-
- return parameters;
- }
-
- @Override
- protected boolean statusCondition(final WorkflowDefinitionTO modelObject) {
- return modelerCtx != null;
- }
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- // do nothing
- }
- }, ActionLink.ActionType.WORKFLOW_MODELER, StandardEntitlement.WORKFLOW_DEF_SET);
-
- panel.add(new ActionLink<WorkflowDefinitionTO>() {
-
- private static final long serialVersionUID = -7978723352517770644L;
-
- @Override
- protected boolean statusCondition(final WorkflowDefinitionTO modelObject) {
- return !modelObject.isMain();
- }
-
- @Override
- public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
- try {
- restClient.deleteDefinition(model.getObject().getKey());
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- target.add(container);
- } catch (SyncopeClientException e) {
- LOG.error("While deleting workflow definition {}", model.getObject().getName(), e);
- SyncopeConsoleSession.get().error(
- StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
- }, ActionLink.ActionType.DELETE, StandardEntitlement.WORKFLOW_DEF_DELETE, true);
-
- return panel;
- }
-
- @Override
- protected Collection<ActionLink.ActionType> getBatches() {
- return Collections.emptyList();
- }
-
- public abstract static class Builder
- extends DirectoryPanel.Builder<WorkflowDefinitionTO, WorkflowDefinitionTO, WorkflowRestClient> {
-
- private static final long serialVersionUID = 5088962796986706805L;
-
- public Builder(final PageReference pageRef) {
- super(new WorkflowRestClient(), pageRef);
- }
-
- @Override
- protected WizardMgtPanel<WorkflowDefinitionTO> newInstance(final String id, final boolean wizardInModal) {
- return new WorkflowDirectoryPanel(id, this);
- }
- }
-
- protected class WorkflowDefinitionDataProvider extends DirectoryDataProvider<WorkflowDefinitionTO> {
-
- private static final long serialVersionUID = 1764153405387687592L;
-
- private final SortableDataProviderComparator<WorkflowDefinitionTO> comparator;
-
- private final WorkflowRestClient restClient = new WorkflowRestClient();
-
- public WorkflowDefinitionDataProvider(final int paginatorRows) {
- super(paginatorRows);
- this.comparator = new SortableDataProviderComparator<>(this);
- setSort("main", SortOrder.DESCENDING);
- }
-
- @Override
- public Iterator<WorkflowDefinitionTO> iterator(final long first, final long count) {
- List<WorkflowDefinitionTO> result = restClient.getDefinitions();
- Collections.sort(result, comparator);
- return result.subList((int) first, (int) first + (int) count).iterator();
- }
-
- @Override
- public long size() {
- return restClient.getDefinitions().size();
- }
-
- @Override
- public IModel<WorkflowDefinitionTO> model(final WorkflowDefinitionTO object) {
- return new CompoundPropertyModel<>(object);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
deleted file mode 100644
index b76bd9e..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
+++ /dev/null
@@ -1,51 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import javax.ws.rs.NotFoundException;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.wicket.request.resource.AbstractResource;
-import org.apache.wicket.util.string.StringValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-abstract class AbstractWorkflowResource extends AbstractResource {
-
- private static final long serialVersionUID = 5163553843196539019L;
-
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractWorkflowResource.class);
-
- protected final WorkflowRestClient restClient = new WorkflowRestClient();
-
- protected WorkflowDefinitionTO getWorkflowDefinition(final Attributes attributes) {
- final StringValue modelId =
- attributes.getRequest().getQueryParameters().getParameterValue(Constants.MODEL_ID_PARAM);
-
- WorkflowDefinitionTO workflowDefinition = modelId == null || modelId.isNull() ? null
- : restClient.getDefinitions().stream().
- filter(object -> modelId.toString().equals(object.getModelId())).findAny().orElse(null);
- if (workflowDefinition == null) {
- throw new NotFoundException("Workflow definition with modelId " + modelId);
- }
-
- return workflowDefinition;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
deleted file mode 100644
index f8dc13d..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
+++ /dev/null
@@ -1,79 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import org.apache.wicket.request.resource.AbstractResource;
-import org.apache.wicket.util.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Mounts directory on local filesystem as subcontext.
- */
-public class FilesystemResource extends AbstractResource {
-
- private static final long serialVersionUID = -4791087117785935198L;
-
- private static final Logger LOG = LoggerFactory.getLogger(FilesystemResource.class);
-
- private final String baseCtx;
-
- private final String basePath;
-
- public FilesystemResource(final String baseCtx, final String basePath) {
- this.baseCtx = baseCtx;
- this.basePath = basePath;
- }
-
- @Override
- protected ResourceResponse newResourceResponse(final Attributes attributes) {
- ResourceResponse response = new ResourceResponse();
-
- final File baseDir = new File(basePath);
- if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
- String reqPath = attributes.getRequest().getUrl().getPath();
- final String subPath = reqPath.substring(reqPath.indexOf(baseCtx) + baseCtx.length()).
- replace('/', File.separatorChar);
- LOG.debug("Request for {}", subPath);
-
- response.setTextEncoding(StandardCharsets.UTF_8.name());
- response.setWriteCallback(new WriteCallback() {
-
- @Override
- public void writeData(final Attributes attributes) throws IOException {
- try (InputStream resourceIS = Files.newInputStream(new File(baseDir, subPath).toPath())) {
- IOUtils.copy(resourceIS, attributes.getResponse().getOutputStream());
- } catch (IOException e) {
- LOG.error("Could not read from {}", baseDir.getAbsolutePath() + subPath, e);
- }
- }
- });
- } else {
- LOG.error("{} not found, not readable or not a directory", basePath);
- }
-
- return response;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
deleted file mode 100644
index 46fb22a..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import javax.ws.rs.core.MediaType;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.wicket.util.io.IOUtils;
-
-/**
- * Mirror REST resource for obtaining user workflow definition in JSON (used by Flowable Modeler).
- *
- * @see org.apache.syncope.common.rest.api.service.WorkflowService#get
- */
-public class WorkflowDefGETResource extends AbstractWorkflowResource {
-
- private static final long serialVersionUID = 4637304868056148970L;
-
- @Override
- protected ResourceResponse newResourceResponse(final Attributes attributes) {
- final WorkflowDefinitionTO toGet = getWorkflowDefinition(attributes);
-
- ResourceResponse response = new ResourceResponse();
- response.disableCaching();
- response.setContentType(MediaType.APPLICATION_JSON);
- response.setTextEncoding(StandardCharsets.UTF_8.name());
- response.setWriteCallback(new WriteCallback() {
-
- @Override
- public void writeData(final Attributes attributes) throws IOException {
- IOUtils.copy(
- new WorkflowRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE, toGet.getKey()),
- attributes.getResponse().getOutputStream());
- }
- });
-
- return response;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
deleted file mode 100644
index 84ec3e5..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
+++ /dev/null
@@ -1,74 +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.
- */
-package org.apache.syncope.client.console.resources;
-
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.cxf.common.util.UrlUtils;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.wicket.util.io.IOUtils;
-
-/**
- * Mirror REST resource for putting user workflow definition in JSON (used by Flowable Modeler).
- *
- * @see org.apache.syncope.common.rest.api.service.WorkflowService#set
- */
-public class WorkflowDefPUTResource extends AbstractWorkflowResource {
-
- private static final long serialVersionUID = 2964542005207297944L;
-
- @Override
- protected ResourceResponse newResourceResponse(final Attributes attributes) {
- String definition = null;
- try {
- HttpServletRequest request = (HttpServletRequest) attributes.getRequest().getContainerRequest();
- String requestBody = IOUtils.toString(request.getInputStream());
- String[] split = requestBody.split("&");
- for (int i = 0; i < split.length && definition == null; i++) {
- String keyValue = split[i];
- if (keyValue.startsWith("json_xml=")) {
- definition = UrlUtils.urlDecode(keyValue.split("=")[1]);
- }
- }
- } catch (IOException e) {
- LOG.error("Could not extract workflow definition", e);
- }
-
- WorkflowDefinitionTO toSet = getWorkflowDefinition(attributes);
-
- if (definition == null || toSet == null) {
- return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
- setError(Response.Status.BAD_REQUEST.getStatusCode(),
- "Could not extract workflow model id and / or definition");
- }
-
- try {
- restClient.setDefinition(MediaType.APPLICATION_JSON_TYPE, toSet.getKey(), definition);
- return new ResourceResponse().setStatusCode(Response.Status.NO_CONTENT.getStatusCode());
- } catch (Exception e) {
- LOG.error("While updating workflow definition", e);
- return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
- setError(Response.Status.BAD_REQUEST.getStatusCode(),
- "While updating workflow definition: " + e.getMessage());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java
deleted file mode 100644
index 8ccf057..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserWorkflowRestClient.java
+++ /dev/null
@@ -1,59 +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.
- */
-package org.apache.syncope.client.console.rest;
-
-import java.util.List;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
-
-public class UserWorkflowRestClient extends BaseRestClient {
-
- private static final long serialVersionUID = -4785231164900813921L;
-
- public int countForms() {
- return getService(UserWorkflowService.class).
- getForms(new WorkflowFormQuery.Builder().page(1).size(1).build()).
- getTotalCount();
- }
-
- public List<WorkflowFormTO> getForms(final int page, final int size, final SortParam<String> sort) {
- return getService(UserWorkflowService.class).
- getForms(new WorkflowFormQuery.Builder().page(page).size(size).orderBy(toOrderBy(sort)).build()).
- getResult();
- }
-
- public WorkflowFormTO getFormForUser(final String userKey) {
- return getService(UserWorkflowService.class).getFormForUser(userKey);
- }
-
- public WorkflowFormTO claimForm(final String taskKey) {
- return getService(UserWorkflowService.class).claimForm(taskKey);
- }
-
- public void submitForm(final WorkflowFormTO form) {
- getService(UserWorkflowService.class).submitForm(form);
- }
-
- public UserTO executeTask(final String taskId, final UserTO form) {
- return getService(UserWorkflowService.class).executeTask(taskId, form);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
deleted file mode 100644
index 14711a4..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
+++ /dev/null
@@ -1,73 +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.
- */
-package org.apache.syncope.client.console.rest;
-
-import java.io.InputStream;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
-
-public class WorkflowRestClient extends BaseRestClient {
-
- private static final long serialVersionUID = 5049285686167071017L;
-
- private WorkflowService getService(final MediaType mediaType) {
- return SyncopeConsoleSession.get().getService(mediaType, WorkflowService.class);
- }
-
- public List<WorkflowDefinitionTO> getDefinitions() {
- return getService(WorkflowService.class).list(AnyTypeKind.USER.name());
- }
-
- public InputStream getDefinition(final MediaType mediaType, final String key) {
- Response response = getService(mediaType).get(AnyTypeKind.USER.name(), key);
-
- return (InputStream) response.getEntity();
- }
-
- public byte[] getDiagram(final String key) {
- WorkflowService service = getService(WorkflowService.class);
- WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
- Response response = service.exportDiagram(AnyTypeKind.USER.name(), key);
-
- byte[] diagram;
- try {
- diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
- } catch (Exception e) {
- LOG.error("Could not get workflow diagram", e);
- diagram = new byte[0];
- }
- return diagram;
- }
-
- public void setDefinition(final MediaType mediaType, final String key, final String definition) {
- getService(mediaType).set(AnyTypeKind.USER.name(), key, definition);
- }
-
- public void deleteDefinition(final String key) {
- getService(WorkflowService.class).delete(AnyTypeKind.USER.name(), key);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
index d8e8f77..7f8ade0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
@@ -98,11 +98,11 @@ public abstract class ActionLink<T extends Serializable> implements Serializable
NOTIFICATION_TASKS("read"),
ZOOM_IN("zoomin"),
ZOOM_OUT("zoomout"),
- WORKFLOW_MODELER("workflowModeler"),
VIEW_EXECUTIONS("read"),
VIEW_DETAILS("read"),
MANAGE_APPROVAL("edit"),
- EDIT_APPROVAL("edit");
+ EDIT_APPROVAL("edit"),
+ EXTERNAL_EDITOR("externalEditor");
private final String actionId;
[21/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/console-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/console-reference/pom.xml b/fit/console-reference/pom.xml
index 5b057f9..6524158 100644
--- a/fit/console-reference/pom.xml
+++ b/fit/console-reference/pom.xml
@@ -58,6 +58,12 @@ under the License.
</dependency>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-client-console</artifactId>
<version>${project.version}</version>
@@ -123,12 +129,6 @@ under the License.
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-ui-modeler-app</artifactId>
- <type>war</type>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.syncope.fit</groupId>
<artifactId>syncope-fit-build-tools</artifactId>
<version>${project.version}</version>
@@ -145,58 +145,7 @@ under the License.
</dependencies>
<build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>setupFlowableModeler</id>
- <phase>process-resources</phase>
- <configuration>
- <target>
- <unzip src="${settings.localRepository}/org/flowable/flowable-ui-modeler-app/${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war" dest="${flowable-modeler.directory}">
- <patternset>
- <include name="WEB-INF/classes/static/**" />
- <include name="WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" />
- </patternset>
- </unzip>
-
- <unzip src="${flowable-modeler.directory}/WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" dest="${flowable-modeler.directory}">
- <patternset>
- <include name="stencilset_bpmn.json" />
- </patternset>
- </unzip>
-
- <move todir="${flowable-modeler.directory}">
- <fileset dir="${flowable-modeler.directory}/WEB-INF/classes/static/">
- <include name="**" />
- </fileset>
- </move>
- <delete dir="${flowable-modeler.directory}/WEB-INF" />
-
- <replace file="${flowable-modeler.directory}/index.html" token="</head>" value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>" />
- <replace file="${flowable-modeler.directory}/index.html" token=" ng-click="backToLanding()"" value=" disabled="disabled"" />
- <replace file="${flowable-modeler.directory}/index.html" token="<ul class="nav navbar-nav" id="main-nav"" value="<ul class="nav navbar-nav" id="main-nav" style="display: none;"" />
- <replace file="${flowable-modeler.directory}/index.html" token="<div class="pull-right" value="<div style="display: none;" class="pull-right" />
- <replace file="${flowable-modeler.directory}/editor-app/editor.html" token="<div class="btn-group pull-right"" value="<div style="display: none;" class="btn-group pull-right"" />
- <replace file="${flowable-modeler.directory}/editor-app/configuration/toolbar-default-actions.js" token="$location.path('/processes');" value="window.close();" />
-
- <copy file="${basedir}/src/main/resources/app-cfg.js" todir="${flowable-modeler.directory}/scripts" overwrite="true" />
- <copy file="${basedir}/src/main/resources/url-config.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
- <copy file="${basedir}/src/main/resources/toolbar.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
- <copy file="${basedir}/src/main/resources/save-model.html" todir="${flowable-modeler.directory}/editor-app/popups" overwrite="true" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
+ <plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/console-reference/src/main/resources/app-cfg.js
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/app-cfg.js b/fit/console-reference/src/main/resources/app-cfg.js
deleted file mode 100644
index 15ec23a..0000000
--- a/fit/console-reference/src/main/resources/app-cfg.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2005-2015 Alfresco Software, Ltd.
- *
- * Licensed 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.
- */
-
-'use strict';
-
-var FLOWABLE = FLOWABLE || {};
-
-FLOWABLE.CONFIG = {
- 'onPremise' : true,
- 'contextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler')) + '/flowable-modeler',
- 'webContextRoot': window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler') + '/flowable-modeler'),
- 'datesLocalization' : false
-};
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/console-reference/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/console.properties b/fit/console-reference/src/main/resources/console.properties
index 18c424f..484a331 100644
--- a/fit/console-reference/src/main/resources/console.properties
+++ b/fit/console-reference/src/main/resources/console.properties
@@ -33,15 +33,12 @@ maxWaitTimeOnApplyChanges=30
csrf=true
-flowableModelerDirectory=${flowable-modeler.directory}
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
page.realms=org.apache.syncope.client.console.pages.Realms
page.topology=org.apache.syncope.client.console.topology.Topology
page.reports=org.apache.syncope.client.console.pages.Reports
-page.workflow=org.apache.syncope.client.console.pages.Workflow
page.audit=org.apache.syncope.client.console.pages.Audit
page.implementations=org.apache.syncope.client.console.pages.Implementations
page.logs=org.apache.syncope.client.console.pages.Logs
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/console-reference/src/main/resources/save-model.html
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/save-model.html b/fit/console-reference/src/main/resources/save-model.html
deleted file mode 100644
index abd5ecf..0000000
--- a/fit/console-reference/src/main/resources/save-model.html
+++ /dev/null
@@ -1,132 +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.
--->
-<div class="modal" ng-controller="SaveModelCtrl">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h2>{{'MODEL.SAVE.TITLE'| translate}}</h2>
- </div>
- <div class="modal-body">
- <div ng-if="saveDialog.errorMessage && saveDialog.errorMessage.length > 0" class="alert error" style="font-size: 14px; margin-top:20px">
- <div class="popup-error" style="font-size: 14px">
- <span class="glyphicon glyphicon-remove-circle"></span>
- <span>{{saveDialog.errorMessage}}</span>
- </div>
- </div>
- <div class="form-group">
- <label for="nameField">{{'MODEL.NAME'| translate}}</label>
- <input type="text"
- ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
- id="nameField"
- class="form-control"
- ng-model="saveDialog.name" readonly="readonly"
- auto-focus />
- </div>
- <div class="form-group" style="display: none">
- <label for="keyField">{{'MODEL.KEY'| translate}}</label>
- <input type="text"
- ng-disabled="status.loading || (error && error.conflictResolveAction == 'saveAs')"
- id="keyField"
- class="form-control"
- ng-model="saveDialog.key" ng-init="saveDialog.key = saveDialog.name"/>
- </div>
- <div class="form-group" style="display: none">
- <label for="docTextArea">{{'MODEL.DESCRIPTION'| translate}}</label>
- <textarea id="docTextArea" ng-disabled="status.loading" class="form-control" ng-model="saveDialog.description"></textarea>
- </div>
- <div class="checkbox" ng-show="!error && !error.isConflict" style="display: none">
- <label>
- <input type="checkbox" ng-disabled="status.loading" ng-model="saveDialog.newVersion" >
- {{'MODEL.SAVE.NEWVERSION'| translate}}
- </label>
- </div>
- <div class="form-group" ng-if="saveDialog.newVersion">
- <label for="commentTextArea">{{'MODEL.SAVE.COMMENT'| translate}}</label>
- <textarea id="commentTextArea" class="form-control" ng-model="saveDialog.comment" ng-disabled="status.loading"></textarea>
- </div>
-
- <div ng-if="saveDialog.validationErrors" class="alert error" style="font-size: 14px; margin-top:20px">
-
- <div class="popup-error" style="font-size: 14px">
- <span class="glyphicon glyphicon-remove-circle"></span>
- <span>{{'MODEL.VALIDATIONERRORS'| translate:error}}</span>
- </div>
- </div>
-
- <div ng-if="error && error.isConflict && !status.loading" class="alert error" style="font-size: 14px; margin-top:20px">
-
- <div class="popup-error" style="font-size: 14px">
- <span class="glyphicon glyphicon-remove-circle"></span>
- <span>{{'MODEL.CONFLICT.WRITE'| translate:error}}</span>
- </div>
-
- <div>
-
- <div style="font-size: 14px; margin-bottom: 10px">{{'MODEL.CONFLICT.WRITE.OPTIONS'| translate}}</div>
- <div class="btn-group" data-toggle="buttons">
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'overwrite'">
- <input type="radio" name="options" id="option1">
- {{'MODEL.CONFLICT.WRITE.OPTION.OVERWRITE'| translate}}
- </label>
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'discardChanges'">
- <input type="radio" name="options" id="option2">
- {{'MODEL.CONFLICT.WRITE.OPTION.DISCARDCHANGES'| translate}}
- </label>
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'saveAs'">
- <input type="radio" name="options" id="option3" ng-disabled="account.type != 'enterprise'">
- {{'MODEL.CONFLICT.WRITE.OPTION.SAVEAS'| translate}}
- </label>
- <label class="btn btn-danger"
- ng-click="error.conflictResolveAction = 'newVersion'">
- <input type="radio" name="options" id="optio43">
- {{'MODEL.CONFLICT.WRITE.OPTION.NEWVERSION'| translate}}
- </label>
- </div>
-
- <div ng-if="error.conflictResolveAction == 'saveAs'" style="margin-top: 10px">
- <span>{{'MODEL.CONFLICT.SAVEAS'| translate}}</span>
- <input type="text" ng-model="error.saveAs" style="width: 300px" auto-focus>
- </div>
- </div>
-
- </div>
-
- </div>
- <div class="modal-footer">
-
- <div class="pull-right">
- <button type="button" class="btn" ng-click="close()" ng-disabled="status.loading" translate>ACTION.CANCEL</button>
- <button class="btn btn-primary" ng-click="saveAndClose()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" translate>ACTION.SAVE-AND-CLOSE</button>
- <button class="btn btn-primary" ng-click="save()" ng-disabled="status.loading || saveDialog.name.length == 0 || saveDialog.key.length == 0" ng-show="!error && !error.isConflict" style="display: none" translate>ACTION.SAVE</button>
- <button class="btn btn-primary" ng-click="okClicked()" ng-disabled="isOkButtonDisabled()" ng-show="error && error.isConflict" translate>ACTION.OK</button>
- </div>
-
- <div class="pull-right popup-error" ng-if="error && !error.isConflict">
- <span>{{'MODEL.SAVE.ERROR'| translate}}</span>
- </div>
-
- <loading></loading>
-
- </div>
- </div>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/console-reference/src/main/resources/toolbar.js
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/toolbar.js b/fit/console-reference/src/main/resources/toolbar.js
deleted file mode 100644
index 920718c..0000000
--- a/fit/console-reference/src/main/resources/toolbar.js
+++ /dev/null
@@ -1,181 +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.
- */
-'use strict';
-
-var FLOWABLE = FLOWABLE || {};
-FLOWABLE.TOOLBAR_CONFIG = {
- "items" : [
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "editor-icon editor-icon-save",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.saveModel"
- },
- {
- "type" : "separator",
- "title" : "",
- "cssClass" : "toolbar-separator"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.CUT",
- "cssClass" : "editor-icon editor-icon-cut",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.cut",
- "enabled" : false,
- "enabledAction" : "element"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.COPY",
- "cssClass" : "editor-icon editor-icon-copy",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.copy",
- "enabled" : false,
- "enabledAction" : "element"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.PASTE",
- "cssClass" : "editor-icon editor-icon-paste",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.paste",
- "enabled" : false
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.DELETE",
- "cssClass" : "editor-icon editor-icon-delete",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.deleteItem",
- "enabled" : false,
- "enabledAction" : "element"
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.REDO",
- "cssClass" : "editor-icon editor-icon-redo",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.redo",
- "enabled" : false
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.UNDO",
- "cssClass" : "editor-icon editor-icon-undo",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.undo",
- "enabled" : false
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ALIGNVERTICAL",
- "cssClass" : "editor-icon editor-icon-align-vertical",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignVertical",
- "enabled" : false,
- "enabledAction" : "element",
- "disableInForm" : true,
- "minSelectionCount" : 2
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ALIGNHORIZONTAL",
- "cssClass" : "editor-icon editor-icon-align-horizontal",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.alignHorizontal",
- "enabledAction" : "element",
- "enabled" : false,
- "disableInForm" : true,
- "minSelectionCount" : 2
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.SAMESIZE",
- "cssClass" : "editor-icon editor-icon-same-size",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.sameSize",
- "enabledAction" : "element",
- "enabled" : false,
- "disableInForm" : true,
- "minSelectionCount" : 2
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator",
- "disableInForm" : true
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMIN",
- "cssClass" : "editor-icon editor-icon-zoom-in",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomIn"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMOUT",
- "cssClass" : "editor-icon editor-icon-zoom-out",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomOut"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMACTUAL",
- "cssClass" : "editor-icon editor-icon-zoom-actual",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomActual"
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.ZOOMFIT",
- "cssClass" : "editor-icon editor-icon-zoom-fit",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.zoomFit"
- },
- {
- "type" : "separator",
- "title" : "TOOLBAR.ACTION.SAVE",
- "cssClass" : "toolbar-separator",
- "disableInForm" : true
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.BENDPOINT.ADD",
- "cssClass" : "editor-icon editor-icon-bendpoint-add",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.addBendPoint",
- "id" : "add-bendpoint-button",
- "disableInForm" : true
- },
- {
- "type" : "button",
- "title" : "TOOLBAR.ACTION.BENDPOINT.REMOVE",
- "cssClass" : "editor-icon editor-icon-bendpoint-remove",
- "action" : "FLOWABLE.TOOLBAR.ACTIONS.removeBendPoint",
- "id" : "remove-bendpoint-button",
- "disableInForm" : true
- },
- {
- "type" : "separator",
- "title": "",
- "cssClass" : "toolbar-separator",
- "disableInForm" : true
- }
- ],
-
- "secondaryItems" : []
-};
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/console-reference/src/main/resources/url-config.js
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/url-config.js b/fit/console-reference/src/main/resources/url-config.js
deleted file mode 100644
index 6bf8979..0000000
--- a/fit/console-reference/src/main/resources/url-config.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Licensed 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.
- */
-var FLOWABLE = FLOWABLE || {};
-
-FLOWABLE.URL = {
-
- getModel: function(modelId) {
- return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
- + "/workflowDefGET?modelId=" + modelId;
- },
-
- getStencilSet: function() {
- return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
- + "/flowable-modeler/stencilset_bpmn.json";
- },
-
- getCmmnStencilSet: function() {
- return FLOWABLE.CONFIG.contextRoot + '/app/rest/stencil-sets/cmmneditor?version=' + Date.now();
- },
-
- putModel: function(modelId) {
- return window.location.toString().substr(0, window.location.toString().indexOf('/flowable-modeler'))
- + "/workflowDefPUT?modelId=" + modelId;
- },
-
- validateModel: function(){
- return FLOWABLE.CONFIG.contextRoot + '/app/rest/model/validate';
- }
-};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/console-reference/src/test/resources/hotswap-agent.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/test/resources/hotswap-agent.properties b/fit/console-reference/src/test/resources/hotswap-agent.properties
index a2e489e..56ea8cc 100644
--- a/fit/console-reference/src/test/resources/hotswap-agent.properties
+++ b/fit/console-reference/src/test/resources/hotswap-agent.properties
@@ -22,6 +22,7 @@ autoHotswap=true
extraClasspath=\
${basedir}/../../client/console/target/classes/org,\
${basedir}/../../ext/camel/client-console/target/classes/org,\
+${basedir}/../../ext/flowable/client-console/target/classes/org,\
${basedir}/../../ext/saml2sp/client-console/target/classes/org,\
${basedir}/../../ext/scimv2/client-console/target/classes/org,\
${basedir}/../../ext/oidcclient/client-console/target/classes/org
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/pom.xml b/fit/core-reference/pom.xml
index d4577c2..cc8b494 100644
--- a/fit/core-reference/pom.xml
+++ b/fit/core-reference/pom.xml
@@ -138,6 +138,18 @@ under the License.
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-rest-cxf</artifactId>
<version>${project.version}</version>
@@ -1466,8 +1478,8 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java
new file mode 100644
index 0000000..abdfcb6
--- /dev/null
+++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/AssignDirectorGroup.java
@@ -0,0 +1,63 @@
+/*
+ * 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.reference;
+
+import org.apache.syncope.common.lib.patch.MembershipPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.apache.syncope.core.flowable.task.AbstractFlowableServiceTask;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class AssignDirectorGroup extends AbstractFlowableServiceTask {
+
+ @Autowired
+ private UserDataBinder dataBinder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Override
+ protected void doExecute(final String executionId) {
+ User user = engine.getRuntimeService().
+ getVariable(executionId, FlowableRuntimeUtils.USER, User.class);
+
+ Boolean secondLevelApprove = engine.getRuntimeService().
+ getVariable(executionId, "secondLevelApprove", Boolean.class);
+ if (Boolean.TRUE.equals(secondLevelApprove)) {
+ user = userDAO.save(user);
+
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(user.getKey());
+ userPatch.getMemberships().add(new MembershipPatch.Builder().
+ group("ebf97068-aa4b-4a85-9f01-680e8c4cf227").build());
+
+ PropagationByResource propByRes = dataBinder.update(user, userPatch);
+
+ // report updated user and propagation by resource as result
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.USER, user);
+ engine.getRuntimeService().setVariable(executionId, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ } else {
+ LOG.info("Second level was not approved, not assigning the director group to " + user.getUsername());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/main/resources/all/workflow.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/all/workflow.properties b/fit/core-reference/src/main/resources/all/workflow.properties
index 36af01c..be8a7bb 100644
--- a/fit/core-reference/src/main/resources/all/workflow.properties
+++ b/fit/core-reference/src/main/resources/all/workflow.properties
@@ -16,6 +16,6 @@
# under the License.
wf.directory=${conf.directory}
historyLevel=activity
-uwfAdapter=org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter
+uwfAdapter=org.apache.syncope.core.flowable.impl.FlowableUserWorkflowAdapter
gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter
awfAdapter=org.apache.syncope.core.workflow.java.DefaultAnyObjectWorkflowAdapter
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/main/resources/all/workflowTestContext.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/all/workflowTestContext.xml b/fit/core-reference/src/main/resources/all/workflowTestContext.xml
new file mode 100644
index 0000000..2329c53
--- /dev/null
+++ b/fit/core-reference/src/main/resources/all/workflowTestContext.xml
@@ -0,0 +1,27 @@
+<?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="assignDirectorGroup" class="org.apache.syncope.fit.core.reference.AssignDirectorGroup"/>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml b/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml
new file mode 100644
index 0000000..fd482b5
--- /dev/null
+++ b/fit/core-reference/src/main/resources/directorGroupRequest.bpmn20.xml
@@ -0,0 +1,104 @@
+<?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:flowable="http://flowable.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://www.flowable.org/processdef">
+
+ <process id="directorGroupRequest" name="Assign director group" isExecutable="true">
+ <startEvent id="startevent1" name="Start"/>
+ <endEvent id="endevent1" name="End"/>
+ <userTask id="firstApproval" name="First approval" flowable:formKey="firstApproval" flowable:candidateGroups="managingDirector">
+ <extensionElements>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
+ <flowable:formProperty id="firstLevelApprove" name="Approve?" type="boolean" variable="firstLevelApprove" required="true"/>
+ <flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+ </extensionElements>
+ </userTask>
+ <userTask id="secondApproval" name="Second approval" flowable:formKey="secondApproval" flowable:candidateGroups="root">
+ <extensionElements>
+ <flowable:formProperty id="username" name="Username" type="string" expression="${userTO.username}" writable="false"/>
+ <flowable:formProperty id="secondLevelApprove" name="Approve?" type="boolean" variable="secondLevelApprove" required="true"/>
+ <flowable:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+ </extensionElements>
+ </userTask>
+ <serviceTask id="assignDirectorGroup" name="Assign director group" flowable:expression="#{assignDirectorGroup.execute(execution.processInstanceId)}"/>
+ <exclusiveGateway id="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" default="sid-338A4B20-89E9-46B2-8AB3-36291455051B"/>
+ <sequenceFlow id="sid-A7C20EB5-AAE6-4CF3-A151-F1A9FA9207A0" sourceRef="firstApproval" targetRef="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15"/>
+ <sequenceFlow id="sid-92E7D60C-09E7-465A-8115-C60ACD06E955" sourceRef="secondApproval" targetRef="assignDirectorGroup"/>
+ <sequenceFlow id="sid-90AAE913-A229-4136-8C1D-AB5A78ACE209" sourceRef="assignDirectorGroup" targetRef="endevent1"/>
+ <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="firstApproval"/>
+ <sequenceFlow id="sid-338A4B20-89E9-46B2-8AB3-36291455051B" sourceRef="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" targetRef="secondApproval"/>
+ <sequenceFlow id="sid-D43EBA31-49F5-4305-B71D-122E98D1DE22" sourceRef="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" targetRef="endevent1">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!firstLevelApprove}]]></conditionExpression>
+ </sequenceFlow>
+ </process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_directorGroupRequest">
+ <bpmndi:BPMNPlane bpmnElement="directorGroupRequest" id="BPMNPlane_directorGroupRequest">
+ <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+ <omgdc:Bounds height="30.0" width="30.0" x="180.0" y="130.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+ <omgdc:Bounds height="28.0" width="28.0" x="711.0" y="131.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="firstApproval" id="BPMNShape_firstApproval">
+ <omgdc:Bounds height="80.0" width="100.0" x="300.0" y="105.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="secondApproval" id="BPMNShape_secondApproval">
+ <omgdc:Bounds height="80.0" width="100.0" x="480.0" y="235.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="assignDirectorGroup" id="BPMNShape_assignDirectorGroup">
+ <omgdc:Bounds height="80.0" width="100.0" x="675.0" y="235.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="sid-1E2454BD-FAE9-4A15-B169-D41843A39C15" id="BPMNShape_sid-1E2454BD-FAE9-4A15-B169-D41843A39C15">
+ <omgdc:Bounds height="40.0" width="40.0" x="510.0" y="125.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="209.94999837389875" y="145.0"/>
+ <omgdi:waypoint x="300.0" y="145.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-338A4B20-89E9-46B2-8AB3-36291455051B" id="BPMNEdge_sid-338A4B20-89E9-46B2-8AB3-36291455051B">
+ <omgdi:waypoint x="530.4263565891473" y="164.51605344694036"/>
+ <omgdi:waypoint x="530.1542471042471" y="235.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-90AAE913-A229-4136-8C1D-AB5A78ACE209" id="BPMNEdge_sid-90AAE913-A229-4136-8C1D-AB5A78ACE209">
+ <omgdi:waypoint x="725.0" y="235.0"/>
+ <omgdi:waypoint x="725.0" y="158.9499300542635"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-92E7D60C-09E7-465A-8115-C60ACD06E955" id="BPMNEdge_sid-92E7D60C-09E7-465A-8115-C60ACD06E955">
+ <omgdi:waypoint x="579.9499999997585" y="275.0"/>
+ <omgdi:waypoint x="674.9999999998254" y="275.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-D43EBA31-49F5-4305-B71D-122E98D1DE22" id="BPMNEdge_sid-D43EBA31-49F5-4305-B71D-122E98D1DE22">
+ <omgdi:waypoint x="549.49393353939" y="145.45103092783506"/>
+ <omgdi:waypoint x="711.0000424606164" y="145.03586113839918"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-A7C20EB5-AAE6-4CF3-A151-F1A9FA9207A0" id="BPMNEdge_sid-A7C20EB5-AAE6-4CF3-A151-F1A9FA9207A0">
+ <omgdi:waypoint x="399.9499999999431" y="145.0"/>
+ <omgdi:waypoint x="510.0" y="145.0"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
[29/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java
deleted file mode 100644
index d71d8c2..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java
+++ /dev/null
@@ -1,1035 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import javax.annotation.Resource;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.core.provisioning.api.PropagationByResource;
-import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.common.lib.types.WorkflowFormPropertyType;
-import org.apache.syncope.core.spring.security.AuthContextUtils;
-import org.apache.syncope.core.spring.BeanUtils;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.ParsingValidationException;
-import org.apache.syncope.core.persistence.api.dao.NotFoundException;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.flowable.spring.DomainProcessEngine;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.apache.syncope.core.workflow.api.WorkflowException;
-import org.apache.syncope.core.workflow.java.AbstractUserWorkflowAdapter;
-import org.flowable.bpmn.converter.BpmnXMLConverter;
-import org.flowable.bpmn.model.BpmnModel;
-import org.flowable.bpmn.model.FlowElement;
-import org.flowable.bpmn.model.Gateway;
-import org.flowable.bpmn.model.Process;
-import org.flowable.bpmn.model.SequenceFlow;
-import org.flowable.editor.constants.ModelDataJsonConstants;
-import org.flowable.editor.language.json.converter.BpmnJsonConverter;
-import org.flowable.common.engine.api.FlowableException;
-import org.flowable.engine.form.FormProperty;
-import org.flowable.engine.form.FormType;
-import org.flowable.engine.form.TaskFormData;
-import org.flowable.engine.history.HistoricActivityInstance;
-import org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity;
-import org.flowable.engine.repository.Deployment;
-import org.flowable.engine.repository.Model;
-import org.flowable.engine.repository.ProcessDefinition;
-import org.flowable.engine.runtime.ProcessInstance;
-import org.flowable.task.api.Task;
-import org.flowable.task.api.TaskQuery;
-import org.flowable.task.api.history.HistoricTaskInstance;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * <a href="http://www.flowable.org/">Flowable</a> based implementation.
- */
-public class FlowableUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
-
- protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
- protected static final String[] PROPERTY_IGNORE_PROPS = { "type" };
-
- public static final String WF_PROCESS_ID = "userWorkflow";
-
- public static final String USER = "user";
-
- public static final String WF_EXECUTOR = "wfExecutor";
-
- public static final String FORM_SUBMITTER = "formSubmitter";
-
- public static final String USER_TO = "userTO";
-
- public static final String ENABLED = "enabled";
-
- public static final String USER_PATCH = "userPatch";
-
- public static final String EMAIL_KIND = "emailKind";
-
- public static final String TASK = "task";
-
- public static final String TOKEN = "token";
-
- public static final String PASSWORD = "password";
-
- public static final String PROP_BY_RESOURCE = "propByResource";
-
- public static final String PROPAGATE_ENABLE = "propagateEnable";
-
- public static final String ENCRYPTED_PWD = "encryptedPwd";
-
- public static final String TASK_IS_FORM = "taskIsForm";
-
- public static final String MODEL_DATA_JSON_MODEL = "model";
-
- public static final String STORE_PASSWORD = "storePassword";
-
- public static final String EVENT = "event";
-
- @Resource(name = "adminUser")
- protected String adminUser;
-
- @Autowired
- protected DomainProcessEngine engine;
-
- @Override
- public String getPrefix() {
- return "ACT_";
- }
-
- protected void throwException(final FlowableException e, final String defaultMessage) {
- if (e.getCause() != null) {
- if (e.getCause().getCause() instanceof SyncopeClientException) {
- throw (SyncopeClientException) e.getCause().getCause();
- } else if (e.getCause().getCause() instanceof ParsingValidationException) {
- throw (ParsingValidationException) e.getCause().getCause();
- } else if (e.getCause().getCause() instanceof InvalidEntityException) {
- throw (InvalidEntityException) e.getCause().getCause();
- }
- }
-
- throw new WorkflowException(defaultMessage, e);
- }
-
- protected void updateStatus(final User user) {
- List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(user.getWorkflowId()).list();
- if (tasks.isEmpty() || tasks.size() > 1) {
- LOG.warn("While setting user status: unexpected task number ({})", tasks.size());
- } else {
- user.setStatus(tasks.get(0).getTaskDefinitionKey());
- }
- }
-
- protected String getFormTask(final User user) {
- String result = null;
-
- List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(user.getWorkflowId()).list();
- if (tasks.isEmpty() || tasks.size() > 1) {
- LOG.debug("While checking if form task: unexpected task number ({})", tasks.size());
- } else {
- try {
- TaskFormData formData = engine.getFormService().getTaskFormData(tasks.get(0).getId());
- if (formData != null && !formData.getFormProperties().isEmpty()) {
- result = tasks.get(0).getId();
- }
- } catch (FlowableException e) {
- LOG.warn("Could not get task form data", e);
- }
- }
-
- return result;
- }
-
- protected Set<String> getPerformedTasks(final User user) {
- final Set<String> result = new HashSet<>();
-
- engine.getHistoryService().createHistoricActivityInstanceQuery().executionId(user.getWorkflowId()).list().
- forEach((task) -> {
- result.add(task.getActivityId());
- });
-
- return result;
- }
-
- /**
- * Saves resources to be propagated and password for later - after form submission - propagation.
- *
- * @param user user
- * @param password password
- * @param propByRes current propagation actions against resources
- */
- protected void saveForFormSubmit(final User user, final String password, final PropagationByResource propByRes) {
- String formTaskId = getFormTask(user);
- if (formTaskId != null) {
- UserTO userTO = engine.getRuntimeService().getVariable(user.getWorkflowId(), USER_TO, UserTO.class);
- if (userTO != null) {
- userTO.setKey(user.getKey());
- userTO.setCreationDate(user.getCreationDate());
- userTO.setLastChangeDate(user.getLastChangeDate());
- if (password == null) {
- String encryptedPwd = engine.getRuntimeService().
- getVariable(user.getWorkflowId(), ENCRYPTED_PWD, String.class);
- if (encryptedPwd != null) {
- userTO.setPassword(decrypt(encryptedPwd));
- }
- } else {
- userTO.setPassword(password);
- }
-
- engine.getRuntimeService().setVariable(user.getWorkflowId(), USER_TO, userTO);
- }
-
- // SYNCOPE-238: This is needed to simplify the task query in this.getForms()
- engine.getTaskService().setVariableLocal(formTaskId, TASK_IS_FORM, Boolean.TRUE);
-
- engine.getRuntimeService().setVariable(user.getWorkflowId(), PROP_BY_RESOURCE, propByRes);
- if (propByRes != null) {
- propByRes.clear();
- }
-
- if (password != null) {
- engine.getRuntimeService().setVariable(user.getWorkflowId(), ENCRYPTED_PWD, encrypt(password));
- }
- }
- }
-
- public <T> T getVariable(final String executionId, final String variableName, final Class<T> variableClass) {
- return engine.getRuntimeService().getVariable(executionId, variableName, variableClass);
- }
-
- public void setVariable(final String executionId, final String variableName, final Object value) {
- engine.getRuntimeService().setVariable(executionId, variableName, value);
- }
-
- @Override
- protected WorkflowResult<Pair<String, Boolean>> doCreate(
- final UserTO userTO,
- final boolean disablePwdPolicyCheck,
- final Boolean enabled,
- final boolean storePassword) {
-
- Map<String, Object> variables = new HashMap<>();
- variables.put(WF_EXECUTOR, AuthContextUtils.getUsername());
- variables.put(USER_TO, userTO);
- variables.put(ENABLED, enabled);
- variables.put(STORE_PASSWORD, storePassword);
-
- ProcessInstance processInstance = null;
- try {
- processInstance = engine.getRuntimeService().startProcessInstanceByKey(WF_PROCESS_ID, variables);
- } catch (FlowableException e) {
- throwException(e, "While starting " + WF_PROCESS_ID + " instance");
- }
-
- User user = engine.getRuntimeService().getVariable(processInstance.getProcessInstanceId(), USER, User.class);
-
- Boolean updatedEnabled =
- engine.getRuntimeService().getVariable(processInstance.getProcessInstanceId(), ENABLED, Boolean.class);
- if (updatedEnabled != null) {
- user.setSuspended(!updatedEnabled);
- }
-
- // this will make UserValidator not to consider password policies at all
- if (disablePwdPolicyCheck) {
- user.removeClearPassword();
- }
-
- updateStatus(user);
- user = userDAO.save(user);
-
- Boolean propagateEnable = engine.getRuntimeService().getVariable(
- processInstance.getProcessInstanceId(), PROPAGATE_ENABLE, Boolean.class);
- if (propagateEnable == null) {
- propagateEnable = enabled;
- }
-
- PropagationByResource propByRes = new PropagationByResource();
- propByRes.set(ResourceOperation.CREATE, userDAO.findAllResourceKeys(user.getKey()));
-
- saveForFormSubmit(user, userTO.getPassword(), propByRes);
-
- Set<String> tasks = getPerformedTasks(user);
-
- return new WorkflowResult<>(Pair.of(user.getKey(), propagateEnable), propByRes, tasks);
- }
-
- protected Set<String> doExecuteTask(final User user, final String task, final Map<String, Object> moreVariables) {
- Set<String> preTasks = getPerformedTasks(user);
-
- Map<String, Object> variables = new HashMap<>();
- variables.put(WF_EXECUTOR, AuthContextUtils.getUsername());
- variables.put(TASK, task);
-
- // using BeanUtils to access all user's properties and trigger lazy loading - we are about to
- // serialize a User instance for availability within workflow tasks, and this breaks transactions
- BeanUtils.copyProperties(user, entityFactory.newEntity(User.class));
- variables.put(USER, user);
-
- if (moreVariables != null && !moreVariables.isEmpty()) {
- variables.putAll(moreVariables);
- }
-
- if (StringUtils.isBlank(user.getWorkflowId())) {
- throw new WorkflowException(new NotFoundException("Empty workflow id for " + user));
- }
-
- List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(user.getWorkflowId()).list();
- if (tasks.size() == 1) {
- try {
- engine.getTaskService().complete(tasks.get(0).getId(), variables);
- } catch (FlowableException e) {
- throwException(e, "While completing task '" + tasks.get(0).getName() + "' for " + user);
- }
- } else {
- LOG.warn("Expected a single task, found {}", tasks.size());
- }
-
- Set<String> postTasks = getPerformedTasks(user);
- postTasks.removeAll(preTasks);
- postTasks.add(task);
-
- return postTasks;
- }
-
- @Override
- protected WorkflowResult<String> doActivate(final User user, final String token) {
- Set<String> tasks = doExecuteTask(user, "activate", Collections.singletonMap(TOKEN, (Object) token));
-
- updateStatus(user);
- User updated = userDAO.save(user);
-
- return new WorkflowResult<>(updated.getKey(), null, tasks);
- }
-
- @Override
- protected WorkflowResult<Pair<UserPatch, Boolean>> doUpdate(final User user, final UserPatch userPatch) {
- Set<String> tasks = doExecuteTask(user, "update", Collections.singletonMap(USER_PATCH, (Object) userPatch));
-
- updateStatus(user);
- User updated = userDAO.save(user);
-
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
- saveForFormSubmit(
- updated, userPatch.getPassword() == null ? null : userPatch.getPassword().getValue(), propByRes);
-
- Boolean propagateEnable = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROPAGATE_ENABLE, Boolean.class);
-
- return new WorkflowResult<>(Pair.of(userPatch, propagateEnable), propByRes, tasks);
- }
-
- @Override
- public WorkflowResult<String> requestCertify(final User user) {
- String authUser = AuthContextUtils.getUsername();
- engine.getRuntimeService().setVariable(user.getWorkflowId(), FORM_SUBMITTER, authUser);
-
- 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);
- }
-
- @Override
- protected WorkflowResult<String> doReactivate(final User user) {
- Set<String> performedTasks = doExecuteTask(user, "reactivate", null);
- updateStatus(user);
-
- User updated = userDAO.save(user);
-
- return new WorkflowResult<>(updated.getKey(), null, performedTasks);
- }
-
- @Override
- protected void doRequestPasswordReset(final User user) {
- Map<String, Object> variables = new HashMap<>(2);
- variables.put(USER_TO, dataBinder.getUserTO(user, true));
- variables.put(EVENT, "requestPasswordReset");
-
- doExecuteTask(user, "requestPasswordReset", variables);
- userDAO.save(user);
- }
-
- @Override
- protected WorkflowResult<Pair<UserPatch, Boolean>> doConfirmPasswordReset(
- final User user, final String token, final String password) {
-
- Map<String, Object> variables = new HashMap<>(4);
- variables.put(TOKEN, token);
- variables.put(PASSWORD, password);
- variables.put(USER_TO, dataBinder.getUserTO(user, true));
- variables.put(EVENT, "confirmPasswordReset");
-
- Set<String> tasks = doExecuteTask(user, "confirmPasswordReset", variables);
-
- userDAO.save(user);
-
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
- UserPatch updatedPatch = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), USER_PATCH, UserPatch.class);
- Boolean propagateEnable = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROPAGATE_ENABLE, Boolean.class);
-
- return new WorkflowResult<>(Pair.of(updatedPatch, propagateEnable), propByRes, tasks);
- }
-
- @Override
- protected void doDelete(final User user) {
- doExecuteTask(user, "delete", null);
-
- PropagationByResource propByRes = new PropagationByResource();
- propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceKeys(user.getKey()));
-
- saveForFormSubmit(user, null, propByRes);
-
- if (engine.getRuntimeService().createProcessInstanceQuery().
- processInstanceId(user.getWorkflowId()).active().list().isEmpty()) {
-
- userDAO.delete(user.getKey());
-
- if (!engine.getHistoryService().createHistoricProcessInstanceQuery().
- processInstanceId(user.getWorkflowId()).list().isEmpty()) {
-
- engine.getHistoryService().deleteHistoricProcessInstance(user.getWorkflowId());
- }
- } else {
- updateStatus(user);
- userDAO.save(user);
- }
- }
-
- @Override
- public WorkflowResult<String> execute(final UserTO userTO, final String taskId) {
- User user = userDAO.authFind(userTO.getKey());
-
- Map<String, Object> variables = new HashMap<>();
- variables.put(USER_TO, userTO);
-
- Set<String> performedTasks = doExecuteTask(user, taskId, variables);
- updateStatus(user);
- User updated = userDAO.save(user);
-
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
-
- saveForFormSubmit(updated, userTO.getPassword(), propByRes);
-
- return new WorkflowResult<>(updated.getKey(), null, performedTasks);
- }
-
- protected WorkflowFormPropertyType fromFlowableFormType(final FormType flowableFormType) {
- WorkflowFormPropertyType result = WorkflowFormPropertyType.String;
-
- if ("string".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.String;
- }
- if ("long".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Long;
- }
- if ("enum".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Enum;
- }
- if ("date".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Date;
- }
- if ("boolean".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Boolean;
- }
-
- return result;
- }
-
- protected WorkflowFormTO getFormTO(final Task task) {
- return getFormTO(task, engine.getFormService().getTaskFormData(task.getId()));
- }
-
- protected WorkflowFormTO getFormTO(final Task task, final TaskFormData fd) {
- WorkflowFormTO formTO =
- getFormTO(task.getProcessInstanceId(), task.getId(), fd.getFormKey(), fd.getFormProperties());
- BeanUtils.copyProperties(task, formTO);
-
- return formTO;
- }
-
- protected WorkflowFormTO getFormTO(final HistoricTaskInstance task) {
- final List<HistoricFormPropertyEntity> props = new ArrayList<>();
-
- engine.getHistoryService().createHistoricDetailQuery().taskId(task.getId()).list().stream().
- filter(historicDetail -> (historicDetail instanceof HistoricFormPropertyEntity)).
- forEachOrdered(historicDetail -> {
- props.add((HistoricFormPropertyEntity) historicDetail);
- });
-
- WorkflowFormTO formTO = getHistoricFormTO(
- task.getProcessInstanceId(), task.getId(), task.getFormKey(), props);
- BeanUtils.copyProperties(task, formTO);
-
- HistoricActivityInstance historicActivityInstance = engine.getHistoryService().
- createHistoricActivityInstanceQuery().
- executionId(task.getExecutionId()).activityType("userTask").activityName(task.getName()).singleResult();
-
- if (historicActivityInstance != null) {
- formTO.setCreateTime(historicActivityInstance.getStartTime());
- formTO.setDueDate(historicActivityInstance.getEndTime());
- }
-
- return formTO;
- }
-
- protected WorkflowFormTO getHistoricFormTO(
- final String processInstanceId,
- final String taskId,
- final String formKey,
- final List<HistoricFormPropertyEntity> props) {
-
- WorkflowFormTO formTO = new WorkflowFormTO();
-
- User user = userDAO.findByWorkflowId(processInstanceId);
- if (user == null) {
- throw new NotFoundException("User with workflow id " + processInstanceId);
- }
- formTO.setUsername(user.getUsername());
-
- formTO.setTaskId(taskId);
- formTO.setKey(formKey);
-
- formTO.setUserTO(engine.getRuntimeService().getVariable(processInstanceId, USER_TO, UserTO.class));
- formTO.setUserPatch(engine.getRuntimeService().getVariable(processInstanceId, USER_PATCH, UserPatch.class));
-
- props.stream().map(prop -> {
- WorkflowFormPropertyTO propertyTO = new WorkflowFormPropertyTO();
- propertyTO.setId(prop.getPropertyId());
- propertyTO.setName(prop.getPropertyId());
- propertyTO.setValue(prop.getPropertyValue());
- return propertyTO;
- }).forEachOrdered(propertyTO -> {
- formTO.getProperties().add(propertyTO);
- });
-
- return formTO;
- }
-
- @SuppressWarnings("unchecked")
- protected WorkflowFormTO getFormTO(
- final String processInstanceId,
- final String taskId,
- final String formKey,
- final List<FormProperty> properties) {
-
- WorkflowFormTO formTO = new WorkflowFormTO();
-
- User user = userDAO.findByWorkflowId(processInstanceId);
- if (user == null) {
- throw new NotFoundException("User with workflow id " + processInstanceId);
- }
- formTO.setUsername(user.getUsername());
-
- formTO.setTaskId(taskId);
- formTO.setKey(formKey);
-
- formTO.setUserTO(engine.getRuntimeService().getVariable(processInstanceId, USER_TO, UserTO.class));
- formTO.setUserPatch(engine.getRuntimeService().getVariable(processInstanceId, USER_PATCH, UserPatch.class));
-
- properties.stream().map(fProp -> {
- WorkflowFormPropertyTO propertyTO = new WorkflowFormPropertyTO();
- BeanUtils.copyProperties(fProp, propertyTO, PROPERTY_IGNORE_PROPS);
- propertyTO.setType(fromFlowableFormType(fProp.getType()));
- if (propertyTO.getType() == WorkflowFormPropertyType.Date) {
- propertyTO.setDatePattern((String) fProp.getType().getInformation("datePattern"));
- }
- if (propertyTO.getType() == WorkflowFormPropertyType.Enum) {
- propertyTO.getEnumValues().putAll((Map<String, String>) fProp.getType().getInformation("values"));
- }
- return propertyTO;
- }).forEachOrdered(propertyTO -> {
- formTO.getProperties().add(propertyTO);
- });
-
- return formTO;
- }
-
- @Transactional(readOnly = true)
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- Pair<Integer, List<WorkflowFormTO>> forms = null;
-
- String authUser = AuthContextUtils.getUsername();
- if (adminUser.equals(authUser)) {
- forms = getForms(engine.getTaskService().createTaskQuery().
- taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE), page, size, orderByClauses);
- } else {
- User user = userDAO.findByUsername(authUser);
- if (user == null) {
- throw new NotFoundException("Syncope User " + authUser);
- }
-
- forms = getForms(engine.getTaskService().createTaskQuery().
- taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE).
- taskCandidateOrAssigned(user.getUsername()), page, size, orderByClauses);
-
- List<String> candidateGroups = new ArrayList<>();
- userDAO.findAllGroupNames(user).forEach(group -> {
- candidateGroups.add(group);
- });
- if (!candidateGroups.isEmpty()) {
- forms = getForms(engine.getTaskService().createTaskQuery().
- taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE).
- taskCandidateGroupIn(candidateGroups), page, size, orderByClauses);
- }
- }
-
- return forms == null
- ? Pair.of(0, Collections.<WorkflowFormTO>emptyList())
- : forms;
- }
-
- protected Pair<Integer, List<WorkflowFormTO>> getForms(
- final TaskQuery query, final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- TaskQuery sortedQuery = query;
- for (OrderByClause clause : orderByClauses) {
- boolean ack = true;
- switch (clause.getField().trim()) {
- case "taskId":
- sortedQuery = sortedQuery.orderByTaskId();
- break;
-
- case "createTime":
- sortedQuery = sortedQuery.orderByTaskCreateTime();
- break;
-
- case "dueDate":
- sortedQuery = sortedQuery.orderByTaskDueDate();
- break;
-
- case "owner":
- sortedQuery = sortedQuery.orderByTaskOwner();
- break;
-
- default:
- LOG.warn("Form sort request by {}: unsupported, ignoring", clause.getField().trim());
- ack = false;
- }
- if (ack) {
- if (clause.getDirection() == OrderByClause.Direction.ASC) {
- sortedQuery = sortedQuery.asc();
- } else {
- sortedQuery = sortedQuery.desc();
- }
- }
- }
-
- List<WorkflowFormTO> result = sortedQuery.listPage(size * (page <= 0 ? 0 : page - 1), size).stream().
- map(task -> {
- if (task instanceof HistoricTaskInstance) {
- return getFormTO((HistoricTaskInstance) task);
- } else {
- return getFormTO(task);
- }
- }).collect(Collectors.toList());
-
- return Pair.of((int) query.count(), result);
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- Task task;
- try {
- task = engine.getTaskService().createTaskQuery().processInstanceId(workflowId).singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While reading form for workflow instance " + workflowId, e);
- }
-
- TaskFormData formData;
- try {
- formData = engine.getFormService().getTaskFormData(task.getId());
- } catch (FlowableException e) {
- LOG.debug("No form found for task {}", task.getId(), e);
- formData = null;
- }
-
- WorkflowFormTO result = null;
- if (formData != null && !formData.getFormProperties().isEmpty()) {
- result = getFormTO(task);
- }
-
- return result;
- }
-
- protected Pair<Task, TaskFormData> checkTask(final String taskId, final String authUser) {
- Task task;
- try {
- task = engine.getTaskService().createTaskQuery().taskId(taskId).singleResult();
- if (task == null) {
- throw new FlowableException("NULL result");
- }
- } catch (FlowableException e) {
- throw new NotFoundException("Flowable Task " + taskId, e);
- }
-
- TaskFormData formData;
- try {
- formData = engine.getFormService().getTaskFormData(task.getId());
- } catch (FlowableException e) {
- throw new NotFoundException("Form for Flowable Task " + taskId, e);
- }
-
- if (!adminUser.equals(authUser)) {
- User user = userDAO.findByUsername(authUser);
- if (user == null) {
- throw new NotFoundException("Syncope User " + authUser);
- }
- }
-
- return Pair.of(task, formData);
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- String authUser = AuthContextUtils.getUsername();
- Pair<Task, TaskFormData> checked = checkTask(taskId, authUser);
-
- if (!adminUser.equals(authUser)) {
- List<Task> tasksForUser = engine.getTaskService().createTaskQuery().taskId(taskId).taskCandidateUser(
- authUser).list();
- if (tasksForUser.isEmpty()) {
- throw new WorkflowException(
- new IllegalArgumentException(authUser + " is not candidate for task " + taskId));
- }
- }
-
- Task task;
- try {
- engine.getTaskService().setOwner(taskId, authUser);
- task = engine.getTaskService().createTaskQuery().taskId(taskId).singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While reading task " + taskId, e);
- }
-
- return getFormTO(task, checked.getValue());
- }
-
- private Map<String, String> getPropertiesForSubmit(final WorkflowFormTO form) {
- Map<String, String> props = new HashMap<>();
- form.getProperties().stream().
- filter(prop -> (prop.isWritable())).
- forEachOrdered(prop -> {
- props.put(prop.getId(), prop.getValue());
- });
-
- return Collections.unmodifiableMap(props);
- }
-
- @Override
- public WorkflowResult<UserPatch> submitForm(final WorkflowFormTO form) {
- String authUser = AuthContextUtils.getUsername();
- Pair<Task, TaskFormData> checked = checkTask(form.getTaskId(), authUser);
-
- if (!checked.getKey().getOwner().equals(authUser)) {
- throw new WorkflowException(new IllegalArgumentException("Task " + form.getTaskId() + " assigned to "
- + checked.getKey().getOwner() + " but submitted by " + authUser));
- }
-
- User user = userDAO.findByWorkflowId(checked.getKey().getProcessInstanceId());
- if (user == null) {
- throw new NotFoundException("User with workflow id " + checked.getKey().getProcessInstanceId());
- }
-
- Set<String> preTasks = getPerformedTasks(user);
- try {
- engine.getFormService().submitTaskFormData(form.getTaskId(), getPropertiesForSubmit(form));
- engine.getRuntimeService().setVariable(user.getWorkflowId(), FORM_SUBMITTER, authUser);
- } catch (FlowableException e) {
- throwException(e, "While submitting form for task " + form.getTaskId());
- }
-
- Set<String> postTasks = getPerformedTasks(user);
- postTasks.removeAll(preTasks);
- postTasks.add(form.getTaskId());
-
- updateStatus(user);
- User updated = userDAO.save(user);
-
- // see if there is any propagation to be done
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
-
- // fetch - if available - the encrypted password
- String clearPassword = null;
- String encryptedPwd = engine.getRuntimeService().getVariable(user.getWorkflowId(), ENCRYPTED_PWD, String.class);
- if (StringUtils.isNotBlank(encryptedPwd)) {
- clearPassword = decrypt(encryptedPwd);
- }
-
- // supports approval chains
- saveForFormSubmit(user, clearPassword, propByRes);
-
- UserPatch userPatch = engine.getRuntimeService().getVariable(user.getWorkflowId(), USER_PATCH, UserPatch.class);
- if (userPatch == null) {
- userPatch = new UserPatch();
- userPatch.setKey(updated.getKey());
- userPatch.setPassword(new PasswordPatch.Builder().onSyncope(true).value(clearPassword).build());
-
- if (propByRes != null) {
- userPatch.getPassword().getResources().addAll(propByRes.get(ResourceOperation.CREATE));
- }
- }
-
- return new WorkflowResult<>(userPatch, propByRes, postTasks);
- }
-
- protected void navigateAvailableTasks(final FlowElement flow, final List<String> availableTasks) {
- if (flow instanceof Gateway) {
- ((Gateway) flow).getOutgoingFlows().forEach(subflow -> navigateAvailableTasks(subflow, availableTasks));
- } else if (flow instanceof SequenceFlow) {
- availableTasks.add(((SequenceFlow) flow).getTargetRef());
- } else {
- LOG.debug("Unexpected flow found: {}", flow);
- }
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- List<String> availableTasks = new ArrayList<>();
- try {
- Task currentTask = engine.getTaskService().createTaskQuery().processInstanceId(workflowId).singleResult();
-
- Process process = engine.getRepositoryService().
- getBpmnModel(getProcessDefinitionByKey(WF_PROCESS_ID).getId()).getProcesses().get(0);
- process.getFlowElements().stream().
- filter(SequenceFlow.class::isInstance).
- map(SequenceFlow.class::cast).
- filter(sequenceFlow -> sequenceFlow.getSourceRef().equals(currentTask.getTaskDefinitionKey())).
- forEach(sequenceFlow -> {
- FlowElement target = process.getFlowElement(sequenceFlow.getTargetRef(), true);
- navigateAvailableTasks(target, availableTasks);
- });
- } catch (FlowableException e) {
- throw new WorkflowException("While reading available tasks for workflow instance " + workflowId, e);
- }
-
- return availableTasks.stream().map(input -> {
- WorkflowTaskTO workflowTaskTO = new WorkflowTaskTO();
- workflowTaskTO.setName(input);
- return workflowTaskTO;
- }).collect(Collectors.toList());
- }
-
- protected Model getModel(final ProcessDefinition procDef) {
- try {
- Model model = engine.getRepositoryService().createModelQuery().
- deploymentId(procDef.getDeploymentId()).singleResult();
- if (model == null) {
- throw new NotFoundException("Could not find Model for deployment " + procDef.getDeploymentId());
- }
- return model;
- } catch (Exception e) {
- throw new WorkflowException("While accessing process " + procDef.getKey(), e);
- }
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- try {
- return engine.getRepositoryService().createProcessDefinitionQuery().latestVersion().list().stream().
- map(procDef -> {
- WorkflowDefinitionTO defTO = new WorkflowDefinitionTO();
- defTO.setKey(procDef.getKey());
- defTO.setName(procDef.getName());
-
- try {
- defTO.setModelId(getModel(procDef).getId());
- } catch (NotFoundException e) {
- LOG.warn("No model found for definition {}, ignoring", procDef.getDeploymentId(), e);
- }
-
- defTO.setMain(WF_PROCESS_ID.equals(procDef.getKey()));
-
- return defTO;
- }).collect(Collectors.toList());
- } catch (FlowableException e) {
- throw new WorkflowException("While listing available process definitions", e);
- }
- }
-
- protected ProcessDefinition getProcessDefinitionByKey(final String key) {
- try {
- return engine.getRepositoryService().createProcessDefinitionQuery().
- processDefinitionKey(key).latestVersion().singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While accessing process " + key, e);
- }
-
- }
-
- protected ProcessDefinition getProcessDefinitionByDeploymentId(final String deploymentId) {
- try {
- return engine.getRepositoryService().createProcessDefinitionQuery().
- deploymentId(deploymentId).latestVersion().singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While accessing deployment " + deploymentId, e);
- }
-
- }
-
- protected void exportProcessModel(final String key, final OutputStream os) {
- Model model = getModel(getProcessDefinitionByKey(key));
-
- try {
- ObjectNode modelNode = (ObjectNode) OBJECT_MAPPER.readTree(model.getMetaInfo());
- modelNode.put(ModelDataJsonConstants.MODEL_ID, model.getId());
- modelNode.replace(MODEL_DATA_JSON_MODEL,
- OBJECT_MAPPER.readTree(engine.getRepositoryService().getModelEditorSource(model.getId())));
-
- os.write(modelNode.toString().getBytes());
- } catch (IOException e) {
- LOG.error("While exporting workflow definition {}", model.getId(), e);
- }
- }
-
- protected void exportProcessResource(final String deploymentId, final String resourceName, final OutputStream os) {
- try (InputStream procDefIS = engine.getRepositoryService().getResourceAsStream(deploymentId, resourceName)) {
- IOUtils.copy(procDefIS, os);
- } catch (IOException e) {
- LOG.error("While exporting {}", resourceName, e);
- }
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- switch (format) {
- case JSON:
- exportProcessModel(key, os);
- break;
-
- case XML:
- default:
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- exportProcessResource(procDef.getDeploymentId(), procDef.getResourceName(), os);
- }
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- if (procDef == null) {
- throw new NotFoundException("Workflow process definition for " + key);
- }
- exportProcessResource(procDef.getDeploymentId(), procDef.getDiagramResourceName(), os);
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- String resourceName = procDef == null ? key + ".bpmn20.xml" : procDef.getResourceName();
- Deployment deployment;
- switch (format) {
- case JSON:
- JsonNode definitionNode;
- try {
- definitionNode = OBJECT_MAPPER.readTree(definition);
- if (definitionNode.has(MODEL_DATA_JSON_MODEL)) {
- definitionNode = definitionNode.get(MODEL_DATA_JSON_MODEL);
- }
- if (!definitionNode.has(BpmnJsonConverter.EDITOR_CHILD_SHAPES)) {
- throw new IllegalArgumentException(
- "Could not find JSON node " + BpmnJsonConverter.EDITOR_CHILD_SHAPES);
- }
-
- BpmnModel bpmnModel = new BpmnJsonConverter().convertToBpmnModel(definitionNode);
- deployment = FlowableDeployUtils.deployDefinition(
- engine,
- resourceName,
- new BpmnXMLConverter().convertToXML(bpmnModel));
- } catch (Exception e) {
- throw new WorkflowException("While creating or updating process " + key, e);
- }
- break;
-
- case XML:
- default:
- deployment = FlowableDeployUtils.deployDefinition(
- engine,
- resourceName,
- definition.getBytes());
- }
-
- procDef = getProcessDefinitionByDeploymentId(deployment.getId());
- if (!key.equals(procDef.getKey())) {
- throw new WorkflowException("Mismatching key: expected " + key + ", found " + procDef.getKey());
- }
- FlowableDeployUtils.deployModel(engine, procDef);
- }
-
- @Override
- public void deleteDefinition(final String key) {
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- if (WF_PROCESS_ID.equals(procDef.getKey())) {
- throw new WorkflowException("Cannot delete the main process " + WF_PROCESS_ID);
- }
-
- try {
- engine.getRepositoryService().deleteDeployment(procDef.getDeploymentId());
- } catch (Exception e) {
- throw new WorkflowException("While deleting " + key, e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java
deleted file mode 100644
index b6a0fa6..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java
+++ /dev/null
@@ -1,31 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.springframework.transaction.annotation.Transactional;
-
-public class FlowableUtils {
-
- @Transactional(readOnly = true)
- public boolean isUserIngroup(final User user, final String groupName) {
- return user.getMemberships().stream().
- anyMatch(membership -> groupName != null && groupName.equals(membership.getRightEnd().getName()));
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java
deleted file mode 100644
index 81c2d88..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java
+++ /dev/null
@@ -1,35 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.apache.syncope.core.persistence.api.entity.Entity;
-import org.flowable.variable.service.impl.types.SerializableType;
-
-/**
- * Flowable variable type for handling Syncope entities as Flowable variables.
- * Main purpose: avoid Flowable to handle Syncope entities as JPA entities,
- * since this can cause troubles with transactions.
- */
-public class SyncopeEntitiesVariableType extends SerializableType {
-
- @Override
- public boolean isAbleToStore(final Object value) {
- return value instanceof Entity;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java
deleted file mode 100644
index b2387e5..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java
+++ /dev/null
@@ -1,89 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import org.apache.syncope.core.persistence.api.dao.GroupDAO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.flowable.idm.api.Group;
-import org.flowable.idm.engine.impl.GroupQueryImpl;
-import org.flowable.idm.engine.impl.persistence.entity.GroupEntity;
-import org.flowable.idm.engine.impl.persistence.entity.GroupEntityImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-public class SyncopeGroupQueryImpl extends GroupQueryImpl {
-
- private static final long serialVersionUID = -2595069675443343682L;
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private GroupDAO groupDAO;
-
- private List<Group> result;
-
- private Group fromSyncopeGroup(final String name) {
- GroupEntity group = new GroupEntityImpl();
- group.setId(name);
- return group;
- }
-
- private void execute() {
- if (id != null) {
- org.apache.syncope.core.persistence.api.entity.group.Group syncopeGroup = groupDAO.findByName(id);
- if (syncopeGroup == null) {
- result = Collections.emptyList();
- } else {
- result = Collections.singletonList(fromSyncopeGroup(syncopeGroup.getName()));
- }
- } else if (userId != null) {
- result = userDAO.findAllGroupNames(userDAO.findByUsername(userId)).stream().
- map(groupName -> fromSyncopeGroup(groupName)).
- collect(Collectors.toList());
- }
- }
-
- @Transactional(readOnly = true)
- @Override
- public long count() {
- checkQueryOk();
-
- this.resultType = ResultType.COUNT;
- if (result == null) {
- execute();
- }
- return result.size();
- }
-
- @Transactional(readOnly = true)
- @Override
- public List<Group> list() {
- checkQueryOk();
-
- this.resultType = ResultType.LIST;
- if (result == null) {
- execute();
- }
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java
deleted file mode 100644
index 7e0dff9..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java
+++ /dev/null
@@ -1,51 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.flowable.idm.api.GroupQuery;
-import org.flowable.idm.api.UserQuery;
-import org.flowable.idm.engine.impl.IdmIdentityServiceImpl;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.ConfigurableApplicationContext;
-
-public class SyncopeIdmIdentityService extends IdmIdentityServiceImpl implements ApplicationContextAware {
-
- private ConfigurableApplicationContext ctx;
-
- @Override
- public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
- this.ctx = (ConfigurableApplicationContext) ctx;
- }
-
- @Override
- public UserQuery createUserQuery() {
- return (UserQuery) ctx.getBeanFactory().
- createBean(SyncopeUserQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
- }
-
- @Override
- public GroupQuery createGroupQuery() {
- return (GroupQuery) ctx.getBeanFactory().
- createBean(SyncopeGroupQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java
deleted file mode 100644
index 71a6f57..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java
+++ /dev/null
@@ -1,26 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.flowable.common.engine.impl.interceptor.Session;
-
-public interface SyncopeSession extends Session {
-
- Class<?> getType();
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java
deleted file mode 100644
index f9f0550..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java
+++ /dev/null
@@ -1,46 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.flowable.common.engine.impl.interceptor.CommandContext;
-import org.flowable.common.engine.impl.interceptor.Session;
-import org.flowable.common.engine.impl.interceptor.SessionFactory;
-
-public class SyncopeSessionFactory implements SessionFactory {
-
- private SyncopeSession syncopeSession;
-
- @Override
- public Class<?> getSessionType() {
- return syncopeSession.getType();
- }
-
- @Override
- public Session openSession(final CommandContext cc) {
- return syncopeSession;
- }
-
- public SyncopeSession getSyncopeSession() {
- return syncopeSession;
- }
-
- public void setSyncopeSession(final SyncopeSession syncopeSession) {
- this.syncopeSession = syncopeSession;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java
deleted file mode 100644
index 6e8f0c7c7..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java
+++ /dev/null
@@ -1,101 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.syncope.core.persistence.api.dao.GroupDAO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.group.Group;
-import org.apache.syncope.core.persistence.api.entity.user.UMembership;
-import org.flowable.idm.api.User;
-import org.flowable.idm.engine.impl.UserQueryImpl;
-import org.flowable.idm.engine.impl.persistence.entity.UserEntity;
-import org.flowable.idm.engine.impl.persistence.entity.UserEntityImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-public class SyncopeUserQueryImpl extends UserQueryImpl {
-
- private static final long serialVersionUID = 4403344392227706318L;
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private GroupDAO groupDAO;
-
- private List<User> result;
-
- private User fromSyncopeUser(final org.apache.syncope.core.persistence.api.entity.user.User syncopeUser) {
- UserEntity user = new UserEntityImpl();
- user.setId(syncopeUser.getUsername());
- return user;
- }
-
- private void execute() {
- if (id != null) {
- org.apache.syncope.core.persistence.api.entity.user.User user = userDAO.findByUsername(id);
- if (user == null) {
- result = Collections.<User>emptyList();
- } else if (groupId == null || userDAO.findAllGroupNames(user).contains(groupId)) {
- result = Collections.singletonList(fromSyncopeUser(user));
- }
- } else if (groupId != null) {
- Group group = groupDAO.findByName(groupId);
- if (group == null) {
- result = Collections.<User>emptyList();
- } else {
- result = new ArrayList<>();
- List<UMembership> memberships = groupDAO.findUMemberships(group);
- memberships.stream().map(membership -> fromSyncopeUser(membership.getLeftEnd())).
- filter(user -> (!result.contains(user))).
- forEachOrdered(user -> {
- result.add(user);
- });
- }
- }
- }
-
- @Transactional(readOnly = true)
- @Override
- public long count() {
- checkQueryOk();
-
- this.resultType = ResultType.COUNT;
- if (result == null) {
- execute();
- }
- return result.size();
- }
-
- @Transactional(readOnly = true)
- @Override
- public List<User> list() {
- checkQueryOk();
-
- this.resultType = ResultType.LIST;
- if (result == null) {
- execute();
- }
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java
deleted file mode 100644
index 92e9aff..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java
+++ /dev/null
@@ -1,114 +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.
- */
-package org.apache.syncope.core.workflow.flowable.spring;
-
-import java.util.Collections;
-import java.util.Map;
-import javax.sql.DataSource;
-import org.apache.syncope.core.spring.security.AuthContextUtils;
-import org.flowable.engine.DynamicBpmnService;
-import org.flowable.engine.FormService;
-import org.flowable.engine.HistoryService;
-import org.flowable.engine.IdentityService;
-import org.flowable.engine.ManagementService;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.engine.ProcessEngineConfiguration;
-import org.flowable.engine.RepositoryService;
-import org.flowable.engine.RuntimeService;
-import org.flowable.engine.TaskService;
-import org.flowable.engine.impl.ProcessEngineImpl;
-
-/**
- * {@link ProcessEngine} delegating actual method invocation to the inner map of {@link ProcessEngine} instances,
- * one for each Syncope domain.
- */
-public class DomainProcessEngine implements ProcessEngine {
-
- private final Map<String, ProcessEngine> engines;
-
- public DomainProcessEngine(final Map<String, ProcessEngine> engines) {
- this.engines = Collections.synchronizedMap(engines);
- }
-
- public Map<String, ProcessEngine> getEngines() {
- return engines;
- }
-
- @Override
- public String getName() {
- return engines.get(AuthContextUtils.getDomain()).getName();
- }
-
- @Override
- public void close() {
- engines.values().forEach(engine -> {
- engine.close();
- });
- }
-
- @Override
- public RepositoryService getRepositoryService() {
- return engines.get(AuthContextUtils.getDomain()).getRepositoryService();
- }
-
- @Override
- public RuntimeService getRuntimeService() {
- return engines.get(AuthContextUtils.getDomain()).getRuntimeService();
- }
-
- @Override
- public FormService getFormService() {
- return engines.get(AuthContextUtils.getDomain()).getFormService();
- }
-
- @Override
- public TaskService getTaskService() {
- return engines.get(AuthContextUtils.getDomain()).getTaskService();
- }
-
- @Override
- public HistoryService getHistoryService() {
- return engines.get(AuthContextUtils.getDomain()).getHistoryService();
- }
-
- @Override
- public IdentityService getIdentityService() {
- return engines.get(AuthContextUtils.getDomain()).getIdentityService();
- }
-
- @Override
- public ManagementService getManagementService() {
- return engines.get(AuthContextUtils.getDomain()).getManagementService();
- }
-
- @Override
- public ProcessEngineConfiguration getProcessEngineConfiguration() {
- return engines.get(AuthContextUtils.getDomain()).getProcessEngineConfiguration();
- }
-
- @Override
- public DynamicBpmnService getDynamicBpmnService() {
- return engines.get(AuthContextUtils.getDomain()).getDynamicBpmnService();
- }
-
- public DataSource getDataSource() {
- ProcessEngineImpl engine = (ProcessEngineImpl) engines.get(AuthContextUtils.getDomain());
- return engine.getProcessEngineConfiguration().getDataSource();
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java
deleted file mode 100644
index ed6cd25..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java
+++ /dev/null
@@ -1,111 +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.
- */
-package org.apache.syncope.core.workflow.flowable.spring;
-
-import java.util.HashMap;
-import java.util.Map;
-import javax.sql.DataSource;
-import org.apache.commons.lang3.StringUtils;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.common.engine.impl.cfg.SpringBeanFactoryProxyMap;
-import org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants;
-import org.flowable.engine.impl.util.EngineServiceUtil;
-import org.flowable.idm.spring.SpringIdmEngineConfiguration;
-import org.flowable.spring.SpringExpressionManager;
-import org.flowable.spring.SpringProcessEngineConfiguration;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.FactoryBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.transaction.PlatformTransactionManager;
-
-/**
- * Spring factory for {@link DomainProcessEngine} which takes the provided {@link SpringProcessEngineConfiguration} as
- * template for each of the configured Syncope domains.
- */
-public class DomainProcessEngineFactoryBean
- implements FactoryBean<DomainProcessEngine>, DisposableBean, ApplicationContextAware {
-
- private ApplicationContext ctx;
-
- private DomainProcessEngine engine;
-
- @Override
- public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
- this.ctx = ctx;
- }
-
- @Override
- public DomainProcessEngine getObject() throws Exception {
- if (engine == null) {
- Map<String, ProcessEngine> engines = new HashMap<>();
-
- ctx.getBeansOfType(DataSource.class).forEach((key, dataSource) -> {
- if (!key.startsWith("local")) {
- String domain = StringUtils.substringBefore(key, DataSource.class.getSimpleName());
- PlatformTransactionManager transactionManager = ctx.getBean(
- domain + "TransactionManager", PlatformTransactionManager.class);
- Object entityManagerFactory = ctx.getBean(domain + "EntityManagerFactory");
-
- SpringProcessEngineConfiguration conf = ctx.getBean(SpringProcessEngineConfiguration.class);
- conf.setDataSource(dataSource);
- conf.setTransactionManager(transactionManager);
- conf.setTransactionsExternallyManaged(true);
- conf.setJpaEntityManagerFactory(entityManagerFactory);
- if (conf.getBeans() == null) {
- conf.setBeans(new SpringBeanFactoryProxyMap(ctx));
- }
- if (conf.getExpressionManager() == null) {
- conf.setExpressionManager(new SpringExpressionManager(ctx, conf.getBeans()));
- }
- if (EngineServiceUtil.getIdmEngineConfiguration(conf) == null) {
- conf.addEngineConfiguration(
- EngineConfigurationConstants.KEY_IDM_ENGINE_CONFIG,
- ctx.getBean(SpringIdmEngineConfiguration.class));
- }
-
- engines.put(domain, conf.buildProcessEngine());
- }
- });
-
- engine = new DomainProcessEngine(engines);
- }
-
- return engine;
- }
-
- @Override
- public Class<DomainProcessEngine> getObjectType() {
- return DomainProcessEngine.class;
- }
-
- @Override
- public boolean isSingleton() {
- return true;
- }
-
- @Override
- public void destroy() throws Exception {
- if (engine != null) {
- engine.close();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java
deleted file mode 100644
index b9f87ca..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java
+++ /dev/null
@@ -1,45 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.flowable.engine.ProcessEngine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * Abstract base class for Flowable's service tasks in Syncope, with Spring support.
- */
-@Component
-public abstract class AbstractFlowableServiceTask {
-
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractFlowableServiceTask.class);
-
- @Autowired
- protected ProcessEngine engine;
-
- @Transactional(rollbackFor = { Throwable.class })
- public void execute(final String executionId) {
- doExecute(executionId);
- }
-
- protected abstract void doExecute(final String executionId);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java
deleted file mode 100644
index 02ee77f..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java
+++ /dev/null
@@ -1,60 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.AnyOperations;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class AutoActivate extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Autowired
- private UserDAO userDAO;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- UserTO userTO = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_TO, UserTO.class);
- if (userTO != null && userTO.getKey() != null && user.getKey() != null) {
- user = userDAO.save(user);
-
- UserPatch userPatch = AnyOperations.diff(userTO, dataBinder.getUserTO(user, true), false);
- // don't mess with password, as the cleartext values was already properly saved
- userPatch.setPassword(null);
-
- dataBinder.update(user, userPatch);
-
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- }
-
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.PROPAGATE_ENABLE, Boolean.TRUE);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java
deleted file mode 100644
index be9bfec..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java
+++ /dev/null
@@ -1,52 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.core.persistence.api.entity.EntityFactory;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Create extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Autowired
- private EntityFactory entityFactory;
-
- @Override
- protected void doExecute(final String executionId) {
- UserTO userTO = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_TO, UserTO.class);
- Boolean storePassword = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.STORE_PASSWORD, Boolean.class);
- // create and set workflow id
- User user = entityFactory.newEntity(User.class);
- dataBinder.create(user, userTO, storePassword == null ? true : storePassword);
- user.setWorkflowId(executionId);
-
- // report user as result
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java
deleted file mode 100644
index d4efe09..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Delete extends AbstractFlowableServiceTask {
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
-
- // Do something with user...
- if (user != null) {
- user.checkToken("");
- }
-
- // remove user variable
- engine.getRuntimeService().removeVariable(executionId, FlowableUserWorkflowAdapter.USER);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java
deleted file mode 100644
index 08f6000..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java
+++ /dev/null
@@ -1,44 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.core.persistence.api.dao.ConfDAO;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class GenerateToken extends AbstractFlowableServiceTask {
-
- @Autowired
- private ConfDAO confDAO;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
-
- user.generateToken(
- confDAO.find("token.length", 256L).intValue(),
- confDAO.find("token.expireTime", 60L).intValue());
-
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- }
-}
[25/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
new file mode 100644
index 0000000..9565f99
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
@@ -0,0 +1,32 @@
+/*
+ * 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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum UserRequestFormPropertyType {
+
+ String,
+ Long,
+ Enum,
+ Date,
+ Boolean
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
----------------------------------------------------------------------
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
new file mode 100644
index 0000000..d23b1bc
--- /dev/null
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/WorkflowTasks.java
@@ -0,0 +1,47 @@
+/*
+ * 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.common.lib.types;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class WorkflowTasks {
+
+ private List<String> tasks;
+
+ public WorkflowTasks() {
+ this.tasks = new ArrayList<>();
+ }
+
+ public WorkflowTasks(final Collection<String> tasks) {
+ this();
+ this.tasks.addAll(tasks);
+ }
+
+ public List<String> getTasks() {
+ return tasks;
+ }
+
+ public void setTasks(final List<String> tasks) {
+ this.tasks = tasks;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/pom.xml b/ext/flowable/flowable-bpmn/pom.xml
new file mode 100644
index 0000000..a236d20
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/pom.xml
@@ -0,0 +1,87 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>2.1.2-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable BPMN</name>
+ <description>Apache Syncope Ext: Flowable BPMN</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-bpmn</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-email</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.javamail</groupId>
+ <artifactId>geronimo-javamail_1.4_mail</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-json-converter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.core</groupId>
+ <artifactId>syncope-core-workflow-java</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java
new file mode 100644
index 0000000..9247fd4
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/BpmnProcessManager.java
@@ -0,0 +1,65 @@
+/*
+ * 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.flowable.api;
+
+import java.io.OutputStream;
+import java.util.List;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+
+public interface BpmnProcessManager {
+
+ /**
+ * @return all available workflow processes.
+ */
+ List<BpmnProcessTO> getProcesses();
+
+ /**
+ * Export the process for the given key, in the requested format.
+ *
+ * @param key process key
+ * @param format export format
+ * @param os export stream
+ */
+ void exportProcess(String key, BpmnProcessFormat format, OutputStream os);
+
+ /**
+ * Export the process graphical representation for the given key (if available).
+ *
+ * @param key process key
+ * @param os export stream
+ */
+ void exportDiagram(String key, OutputStream os);
+
+ /**
+ * Import the process for the given key.
+ *
+ * @param key process key
+ * @param format import format
+ * @param process process
+ */
+ void importProcess(String key, BpmnProcessFormat format, String process);
+
+ /**
+ * Remove the process for the given key.
+ *
+ * @param key process key
+ */
+ void deleteProcess(String key);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java
new file mode 100644
index 0000000..b11b97c
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/UserRequestHandler.java
@@ -0,0 +1,108 @@
+/*
+ * 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.flowable.api;
+
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.event.AnyDeletedEvent;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.springframework.transaction.event.TransactionalEventListener;
+
+public interface UserRequestHandler {
+
+ /**
+ * Starts a new user request, for the given BPMN process and user.
+ *
+ * @param bpmnProcess BPMN process
+ * @param user user
+ * @return data about the started request service, including execution id
+ */
+ UserRequestTO start(String bpmnProcess, User user);
+
+ /**
+ * Parses the given execution id to find matching user request and owner.
+ *
+ * @param executionId execution id
+ * @return matching user request and owner
+ */
+ Pair<ProcessInstance, String> parse(String executionId);
+
+ /**
+ * Cancel a running user request.
+ *
+ * @param procInst process instance for user request
+ * @param reason reason to cancel the user request
+ */
+ void cancel(ProcessInstance procInst, String reason);
+
+ /**
+ * Cancel all running user requests for the given process definition id.
+ *
+ * @param processDefinitionId process definition id
+ */
+ void cancelByProcessDefinition(String processDefinitionId);
+
+ /**
+ * Cancel all running user requests for the user in the given delete event.
+ *
+ * @param event delete event
+ */
+ @TransactionalEventListener
+ void cancelByUser(AnyDeletedEvent event);
+
+ /**
+ * Get the forms for current workflow process instances matching the provided parameters.
+ *
+ * @param page result page
+ * @param size items per page
+ * @param orderByClauses sort conditions
+ * @return total number of forms, list of forms matching the provided parameters
+ */
+ Pair<Integer, List<UserRequestForm>> getForms(int page, int size, List<OrderByClause> orderByClauses);
+
+ /**
+ * Get forms for given user (if present).
+ *
+ * @param userKey user key
+ * @return form (if present), otherwise null
+ */
+ List<UserRequestForm> getForms(String userKey);
+
+ /**
+ * Claim a form for a given object.
+ *
+ * @param taskId Workflow task to which the form is associated
+ * @return updated form
+ */
+ UserRequestForm claimForm(String taskId);
+
+ /**
+ * Submit a form.
+ *
+ * @param form to be submitted
+ * @return user updated by this form submit
+ */
+ WorkflowResult<UserPatch> submitForm(UserRequestForm form);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java
new file mode 100644
index 0000000..6c9ef50
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/api/WorkflowTaskManager.java
@@ -0,0 +1,70 @@
+/*
+ * 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.flowable.api;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+
+public interface WorkflowTaskManager {
+
+ /**
+ * Gets variable value.
+ * Returns null when no variable value is found with the given name or when the value is set to null.
+ *
+ * @param <T> variable type
+ * @param executionId id of execution, cannot be null.
+ * @param variableName name of variable, cannot be null.
+ * @param variableClass class of variable, cannot be null.
+ * @return the variable value or null if the variable is undefined or the value of the variable is null.
+ * @throws org.flowable.common.engine.api.FlowableObjectNotFoundException
+ * when no execution is found for the given executionId.
+ * @throws ClassCastException
+ * when cannot cast variable to given class
+ */
+ <T> T getVariable(String executionId, String variableName, Class<T> variableClass);
+
+ /**
+ * Updates or create sa variable for an execution.
+ *
+ * @param executionId id of execution to set variable in, cannot be null.
+ * @param variableName name of variable to set, cannot be null.
+ * @param value value to set; when null is passed, the variable is not removed, only it's value will be set to null
+ * @throws org.flowable.common.engine.api.FlowableObjectNotFoundException
+ * when no execution is found for the given executionId.
+ */
+ void setVariable(String executionId, String variableName, Object value);
+
+ /**
+ * Get tasks available for execution, for given user.
+ *
+ * @param userKey user key
+ * @return available tasks
+ */
+ List<WorkflowTask> getAvailableTasks(String userKey);
+
+ /**
+ * Execute a task on an user.
+ *
+ * @param workflowTaskExecInput input for task execution
+ * @return user after task execution
+ */
+ WorkflowResult<String> executeNextTask(WorkflowTaskExecInput workflowTaskExecInput);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java
new file mode 100644
index 0000000..bca8b25
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableBpmnProcessManager.java
@@ -0,0 +1,212 @@
+/*
+ * 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.flowable.impl;
+
+import org.apache.syncope.core.flowable.api.BpmnProcessManager;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.dao.NotFoundException;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.bpmn.converter.BpmnXMLConverter;
+import org.flowable.bpmn.model.BpmnModel;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.editor.constants.ModelDataJsonConstants;
+import org.flowable.editor.language.json.converter.BpmnJsonConverter;
+import org.flowable.engine.repository.Deployment;
+import org.flowable.engine.repository.Model;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
+public class FlowableBpmnProcessManager implements BpmnProcessManager {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(BpmnProcessManager.class);
+
+ protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+ protected static final String MODEL_DATA_JSON_MODEL = "model";
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ protected Model getModel(final ProcessDefinition procDef) {
+ try {
+ Model model = engine.getRepositoryService().createModelQuery().
+ deploymentId(procDef.getDeploymentId()).singleResult();
+ if (model == null) {
+ throw new NotFoundException("Could not find Model for deployment " + procDef.getDeploymentId());
+ }
+ return model;
+ } catch (Exception e) {
+ throw new WorkflowException("While accessing process " + procDef.getKey(), e);
+ }
+ }
+
+ @Override
+ public List<BpmnProcessTO> getProcesses() {
+ try {
+ return engine.getRepositoryService().createProcessDefinitionQuery().latestVersion().list().stream().
+ map(procDef -> {
+ BpmnProcessTO defTO = new BpmnProcessTO();
+ defTO.setKey(procDef.getKey());
+ defTO.setName(procDef.getName());
+
+ try {
+ defTO.setModelId(getModel(procDef).getId());
+ } catch (NotFoundException e) {
+ LOG.warn("No model found for definition {}, ignoring", procDef.getDeploymentId(), e);
+ }
+
+ defTO.setUserWorkflow(FlowableRuntimeUtils.WF_PROCESS_ID.equals(procDef.getKey()));
+
+ return defTO;
+ }).collect(Collectors.toList());
+ } catch (FlowableException e) {
+ throw new WorkflowException("While listing available process definitions", e);
+ }
+ }
+
+ protected void exportProcessModel(final String key, final OutputStream os) {
+ Model model = getModel(FlowableRuntimeUtils.getLatestProcDefByKey(engine, key));
+
+ try {
+ ObjectNode modelNode = (ObjectNode) OBJECT_MAPPER.readTree(model.getMetaInfo());
+ modelNode.put(ModelDataJsonConstants.MODEL_ID, model.getId());
+ modelNode.replace(MODEL_DATA_JSON_MODEL,
+ OBJECT_MAPPER.readTree(engine.getRepositoryService().getModelEditorSource(model.getId())));
+
+ os.write(modelNode.toString().getBytes());
+ } catch (IOException e) {
+ LOG.error("While exporting workflow definition {}", model.getId(), e);
+ }
+ }
+
+ protected void exportProcessResource(final String deploymentId, final String resourceName, final OutputStream os) {
+ try (InputStream procDefIS = engine.getRepositoryService().getResourceAsStream(deploymentId, resourceName)) {
+ IOUtils.copy(procDefIS, os);
+ } catch (IOException e) {
+ LOG.error("While exporting {}", resourceName, e);
+ }
+ }
+
+ @Override
+ public void exportProcess(final String key, final BpmnProcessFormat format, final OutputStream os) {
+ switch (format) {
+ case JSON:
+ exportProcessModel(key, os);
+ break;
+
+ case XML:
+ default:
+ ProcessDefinition procDef = FlowableRuntimeUtils.getLatestProcDefByKey(engine, key);
+ if (procDef == null) {
+ throw new NotFoundException("Process Definition " + key);
+ }
+ exportProcessResource(procDef.getDeploymentId(), procDef.getResourceName(), os);
+ }
+ }
+
+ @Override
+ public void exportDiagram(final String key, final OutputStream os) {
+ ProcessDefinition procDef = FlowableRuntimeUtils.getLatestProcDefByKey(engine, key);
+ if (procDef == null) {
+ throw new NotFoundException("Workflow process definition for " + key);
+ }
+ exportProcessResource(procDef.getDeploymentId(), procDef.getDiagramResourceName(), os);
+ }
+
+ @Override
+ public void importProcess(final String key, final BpmnProcessFormat format, final String definition) {
+ ProcessDefinition procDef = FlowableRuntimeUtils.getLatestProcDefByKey(engine, key);
+ String resourceName = procDef == null ? key + ".bpmn20.xml" : procDef.getResourceName();
+ Deployment deployment;
+ switch (format) {
+ case JSON:
+ JsonNode definitionNode;
+ try {
+ definitionNode = OBJECT_MAPPER.readTree(definition);
+ if (definitionNode.has(MODEL_DATA_JSON_MODEL)) {
+ definitionNode = definitionNode.get(MODEL_DATA_JSON_MODEL);
+ }
+ if (!definitionNode.has(BpmnJsonConverter.EDITOR_CHILD_SHAPES)) {
+ throw new IllegalArgumentException(
+ "Could not find JSON node " + BpmnJsonConverter.EDITOR_CHILD_SHAPES);
+ }
+
+ BpmnModel bpmnModel = new BpmnJsonConverter().convertToBpmnModel(definitionNode);
+ deployment = FlowableDeployUtils.deployDefinition(
+ engine,
+ resourceName,
+ new BpmnXMLConverter().convertToXML(bpmnModel));
+ } catch (Exception e) {
+ throw new WorkflowException("While creating or updating process " + key, e);
+ }
+ break;
+
+ case XML:
+ default:
+ deployment = FlowableDeployUtils.deployDefinition(
+ engine,
+ resourceName,
+ definition.getBytes());
+ }
+
+ try {
+ procDef = engine.getRepositoryService().createProcessDefinitionQuery().
+ deploymentId(deployment.getId()).latestVersion().singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While accessing deployment " + deployment.getId(), e);
+ }
+ if (!key.equals(procDef.getKey())) {
+ throw new WorkflowException("Mismatching key: expected " + key + ", found " + procDef.getKey());
+ }
+ FlowableDeployUtils.deployModel(engine, procDef);
+ }
+
+ @Override
+ public void deleteProcess(final String key) {
+ if (FlowableRuntimeUtils.WF_PROCESS_ID.equals(key)) {
+ throw new WorkflowException("Cannot delete the main process " + FlowableRuntimeUtils.WF_PROCESS_ID);
+ }
+
+ try {
+ engine.getRepositoryService().createProcessDefinitionQuery().processDefinitionKey(key).list().
+ forEach(procDef -> {
+ engine.getRepositoryService().deleteModel(getModel(procDef).getId());
+ engine.getRepositoryService().deleteDeployment(procDef.getDeploymentId(), true);
+ });
+ } catch (Exception e) {
+ throw new WorkflowException("While deleting process " + key, e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
new file mode 100644
index 0000000..5af0188
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
@@ -0,0 +1,92 @@
+/*
+ * 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.flowable.impl;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.bpmn.converter.BpmnXMLConverter;
+import org.flowable.bpmn.model.BpmnModel;
+import org.flowable.editor.constants.ModelDataJsonConstants;
+import org.flowable.editor.language.json.converter.BpmnJsonConverter;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.repository.Deployment;
+import org.flowable.engine.repository.Model;
+import org.flowable.engine.repository.ProcessDefinition;
+
+public final class FlowableDeployUtils {
+
+ private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+ public static Deployment deployDefinition(
+ final ProcessEngine engine, final String resourceName, final byte[] definition) {
+
+ try {
+ return engine.getRepositoryService().createDeployment().
+ addInputStream(resourceName, new ByteArrayInputStream(definition)).deploy();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While importing " + resourceName, e);
+ }
+ }
+
+ public static void deployModel(final ProcessEngine engine, final ProcessDefinition procDef) {
+ XMLStreamReader xtr = null;
+ try (InputStream bpmnStream = engine.getRepositoryService().
+ getResourceAsStream(procDef.getDeploymentId(), procDef.getResourceName());
+ InputStreamReader isr = new InputStreamReader(bpmnStream)) {
+
+ xtr = XMLInputFactory.newInstance().createXMLStreamReader(isr);
+ BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
+
+ Model model = engine.getRepositoryService().newModel();
+ ObjectNode modelObjectNode = OBJECT_MAPPER.createObjectNode();
+ modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, procDef.getName());
+ model.setMetaInfo(modelObjectNode.toString());
+ model.setName(procDef.getName());
+ model.setDeploymentId(procDef.getDeploymentId());
+ model.setVersion(procDef.getVersion());
+
+ engine.getRepositoryService().saveModel(model);
+ engine.getRepositoryService().addModelEditorSource(
+ model.getId(),
+ new BpmnJsonConverter().convertToJson(bpmnModel).toString().getBytes());
+ } catch (Exception e) {
+ throw new WorkflowException("While importing " + procDef.getResourceName(), e);
+ } finally {
+ if (xtr != null) {
+ try {
+ xtr.close();
+ } catch (XMLStreamException e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ private FlowableDeployUtils() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java
new file mode 100644
index 0000000..12d8faa
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableRuntimeUtils.java
@@ -0,0 +1,225 @@
+/*
+ * 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.flowable.impl;
+
+import java.util.Base64;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
+import org.apache.syncope.core.persistence.api.attrvalue.validation.ParsingValidationException;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.history.HistoricActivityInstance;
+import org.flowable.engine.impl.RuntimeServiceImpl;
+import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.flowable.task.api.TaskQuery;
+import org.identityconnectors.common.security.EncryptorFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class FlowableRuntimeUtils {
+
+ private static final Logger LOG = LoggerFactory.getLogger(FlowableRuntimeUtils.class);
+
+ public static final String WF_PROCESS_ID = "userWorkflow";
+
+ public static final String USER = "user";
+
+ public static final String WF_EXECUTOR = "wfExecutor";
+
+ public static final String FORM_SUBMITTER = "formSubmitter";
+
+ public static final String USER_TO = "userTO";
+
+ public static final String ENABLED = "enabled";
+
+ public static final String USER_PATCH = "userPatch";
+
+ public static final String TASK = "task";
+
+ public static final String TOKEN = "token";
+
+ public static final String PASSWORD = "password";
+
+ public static final String PROP_BY_RESOURCE = "propByResource";
+
+ public static final String PROPAGATE_ENABLE = "propagateEnable";
+
+ public static final String ENCRYPTED_PWD = "encryptedPwd";
+
+ public static final String STORE_PASSWORD = "storePassword";
+
+ public static final String EVENT = "event";
+
+ public static String encrypt(final String clear) {
+ byte[] encrypted = EncryptorFactory.getInstance().getDefaultEncryptor().encrypt(clear.getBytes());
+ return Base64.getEncoder().encodeToString(encrypted);
+ }
+
+ public static String decrypt(final String crypted) {
+ byte[] decrypted = EncryptorFactory.getInstance().getDefaultEncryptor().
+ decrypt(Base64.getDecoder().decode(crypted));
+ return new String(decrypted);
+ }
+
+ public static String getWFProcBusinessKey(final String userKey) {
+ return FlowableRuntimeUtils.getProcBusinessKey(WF_PROCESS_ID, userKey);
+ }
+
+ public static String getWFProcInstID(final DomainProcessEngine engine, final String userKey) {
+ ProcessInstance procInst = engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceBusinessKey(getWFProcBusinessKey(userKey)).singleResult();
+ return procInst == null ? null : procInst.getId();
+ }
+
+ public static String getProcBusinessKey(final String processDefinitionId, final String userKey) {
+ return processDefinitionId + ":" + userKey;
+ }
+
+ public static ProcessDefinition getLatestProcDefByKey(final DomainProcessEngine engine, final String key) {
+ try {
+ return engine.getRepositoryService().createProcessDefinitionQuery().
+ processDefinitionKey(key).latestVersion().singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While accessing process " + key, e);
+ }
+ }
+
+ public static Set<String> getPerformedTasks(
+ final DomainProcessEngine engine, final String procInstID, final User user) {
+
+ return engine.getHistoryService().createHistoricActivityInstanceQuery().
+ executionId(procInstID).
+ list().stream().
+ map(HistoricActivityInstance::getActivityId).
+ collect(Collectors.toSet());
+ }
+
+ public static void updateStatus(final DomainProcessEngine engine, final String procInstID, final User user) {
+ List<Task> tasks = createTaskQuery(engine, false).processInstanceId(procInstID).list();
+ if (tasks.isEmpty() || tasks.size() > 1) {
+ LOG.warn("While setting user status: unexpected task number ({})", tasks.size());
+ } else {
+ user.setStatus(tasks.get(0).getTaskDefinitionKey());
+ }
+ }
+
+ public static List<ProcessInstance> getProcessInstances(final DomainProcessEngine engine, final String userKey) {
+ return engine.getRuntimeService().createNativeProcessInstanceQuery().
+ sql("SELECT ID_,PROC_INST_ID_ FROM " + engine.getManagementService().getTableName(ExecutionEntity.class)
+ + " WHERE BUSINESS_KEY_ LIKE '" + getProcBusinessKey("%", userKey) + "'"
+ + " AND PARENT_ID_ IS NULL").list();
+ }
+
+ public static TaskQuery createTaskQuery(final DomainProcessEngine engine, final boolean onlyFormTasks) {
+ SyncopeTaskQueryImpl taskQuery = new SyncopeTaskQueryImpl(
+ ((RuntimeServiceImpl) engine.getRuntimeService()).getCommandExecutor());
+ if (onlyFormTasks) {
+ taskQuery.taskWithFormKey();
+ }
+ return taskQuery;
+ }
+
+ public static String getFormTask(final DomainProcessEngine engine, final String procInstID) {
+ String result = null;
+
+ List<Task> tasks = createTaskQuery(engine, true).processInstanceId(procInstID).list();
+ if (tasks.isEmpty() || tasks.size() > 1) {
+ LOG.debug("While checking if form task: unexpected task number ({})", tasks.size());
+ } else {
+ result = tasks.get(0).getFormKey();
+ }
+
+ return result;
+ }
+
+ /**
+ * Saves resources to be propagated and password for later - after form submission - propagation.
+ *
+ * @param engine Flowable engine
+ * @param procInstID process instance id
+ * @param user user JPA entity
+ * @param userTO user transfer object
+ * @param password password
+ * @param enabled is user to be enabled or not?
+ * @param propByRes current propagation actions against resources
+ */
+ public static void saveForFormSubmit(
+ final DomainProcessEngine engine,
+ final String procInstID,
+ final User user,
+ final UserTO userTO,
+ final String password,
+ final Boolean enabled,
+ final PropagationByResource propByRes) {
+
+ String formTaskId = getFormTask(engine, procInstID);
+ if (formTaskId == null) {
+ return;
+ }
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.USER_TO, userTO);
+
+ if (password == null) {
+ String encryptedPwd = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD, String.class);
+ if (encryptedPwd != null) {
+ userTO.setPassword(decrypt(encryptedPwd));
+ }
+ } else {
+ userTO.setPassword(password);
+ engine.getRuntimeService().
+ setVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD, encrypt(password));
+ }
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.ENABLED, enabled);
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, propByRes);
+ if (propByRes != null) {
+ propByRes.clear();
+ }
+ }
+
+ public static void throwException(final FlowableException e, final String defaultMessage) {
+ if (e.getCause() != null) {
+ if (e.getCause().getCause() instanceof SyncopeClientException) {
+ throw (SyncopeClientException) e.getCause().getCause();
+ } else if (e.getCause().getCause() instanceof ParsingValidationException) {
+ throw (ParsingValidationException) e.getCause().getCause();
+ } else if (e.getCause().getCause() instanceof InvalidEntityException) {
+ throw (InvalidEntityException) e.getCause().getCause();
+ }
+ }
+
+ throw new WorkflowException(defaultMessage, e);
+ }
+
+ private FlowableRuntimeUtils() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java
new file mode 100644
index 0000000..1c198a8
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableUserRequestHandler.java
@@ -0,0 +1,574 @@
+/*
+ * 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.flowable.impl;
+
+import org.apache.syncope.core.flowable.api.UserRequestHandler;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import javax.annotation.Resource;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.PasswordPatch;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestFormProperty;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.common.lib.types.UserRequestFormPropertyType;
+import org.apache.syncope.core.flowable.api.WorkflowTaskManager;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.dao.NotFoundException;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.core.persistence.api.entity.EntityFactory;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.PropagationByResource;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.provisioning.api.event.AnyDeletedEvent;
+import org.apache.syncope.core.spring.BeanUtils;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.apache.syncope.core.workflow.api.WorkflowException;
+import org.flowable.common.engine.api.FlowableException;
+import org.flowable.engine.form.FormProperty;
+import org.flowable.engine.form.FormType;
+import org.flowable.engine.form.TaskFormData;
+import org.flowable.engine.history.HistoricActivityInstance;
+import org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.flowable.task.api.TaskQuery;
+import org.flowable.task.api.history.HistoricTaskInstance;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
+public class FlowableUserRequestHandler implements UserRequestHandler {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(UserRequestHandler.class);
+
+ protected static final String[] PROPERTY_IGNORE_PROPS = { "type" };
+
+ @Autowired
+ protected WorkflowTaskManager wfTaskManager;
+
+ @Autowired
+ protected UserDataBinder dataBinder;
+
+ @Resource(name = "adminUser")
+ protected String adminUser;
+
+ @Autowired
+ protected DomainProcessEngine engine;
+
+ @Autowired
+ protected UserDAO userDAO;
+
+ @Autowired
+ protected EntityFactory entityFactory;
+
+ protected User lazyLoad(final User user) {
+ // using BeanUtils to access all user's properties and trigger lazy loading - we are about to
+ // serialize a User instance for availability within workflow tasks, and this breaks transactions
+ BeanUtils.copyProperties(user, entityFactory.newEntity(User.class));
+ return user;
+ }
+
+ @Override
+ public UserRequestTO start(final String bpmnProcess, final User user) {
+ Map<String, Object> variables = new HashMap<>(2);
+ variables.put(FlowableRuntimeUtils.WF_EXECUTOR, AuthContextUtils.getUsername());
+ variables.put(FlowableRuntimeUtils.USER, lazyLoad(user));
+ variables.put(FlowableRuntimeUtils.USER_TO, dataBinder.getUserTO(user, true));
+
+ ProcessInstance procInst = null;
+ try {
+ procInst = engine.getRuntimeService().startProcessInstanceByKey(bpmnProcess, variables);
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(e, "While starting " + bpmnProcess + " instance");
+ }
+
+ engine.getRuntimeService().updateBusinessKey(
+ procInst.getProcessInstanceId(),
+ FlowableRuntimeUtils.getProcBusinessKey(bpmnProcess, user.getKey()));
+
+ UserRequestTO userRequestTO = new UserRequestTO();
+ userRequestTO.setProcessInstanceId(procInst.getProcessInstanceId());
+ userRequestTO.setExecutionId(procInst.getId());
+ userRequestTO.setBpmnProcess(bpmnProcess);
+ userRequestTO.setUser(user.getKey());
+ return userRequestTO;
+ }
+
+ @Override
+ public Pair<ProcessInstance, String> parse(final String executionId) {
+ ProcessInstance procInst = null;
+ try {
+ procInst = engine.getRuntimeService().
+ createProcessInstanceQuery().processInstanceId(executionId).singleResult();
+ } catch (FlowableException e) {
+ throw new NotFoundException("User request execution with id " + executionId);
+ }
+
+ return Pair.of(procInst, getUserKey(procInst.getProcessInstanceId()));
+ }
+
+ @Override
+ public void cancel(final ProcessInstance procInst, final String reason) {
+ if (FlowableRuntimeUtils.WF_PROCESS_ID.equals(procInst.getProcessDefinitionKey())) {
+ throw new WorkflowException(new IllegalArgumentException(
+ "Cannot cancel a " + FlowableRuntimeUtils.WF_PROCESS_ID + " execution"));
+ }
+
+ engine.getRuntimeService().deleteProcessInstance(procInst.getId(), reason);
+ }
+
+ @Override
+ public void cancelByProcessDefinition(final String processDefinitionId) {
+ engine.getRuntimeService().
+ createProcessInstanceQuery().processDefinitionId(processDefinitionId).list().
+ forEach(procInst -> {
+ engine.getRuntimeService().deleteProcessInstance(
+ procInst.getId(), "Cascade Delete process definition " + processDefinitionId);
+ });
+ }
+
+ @Override
+ public void cancelByUser(final AnyDeletedEvent event) {
+ if (AuthContextUtils.getDomain().equals(event.getDomain()) && event.getAnyTypeKind() == AnyTypeKind.USER) {
+ String username = event.getAnyName();
+ FlowableRuntimeUtils.getProcessInstances(engine, event.getAnyKey()).
+ forEach(procInst -> {
+ engine.getRuntimeService().deleteProcessInstance(
+ procInst.getId(), "Cascade Delete user " + username);
+ });
+ }
+ }
+
+ protected UserRequestFormPropertyType fromFlowableFormType(final FormType flowableFormType) {
+ UserRequestFormPropertyType result = UserRequestFormPropertyType.String;
+
+ if (null != flowableFormType.getName()) {
+ switch (flowableFormType.getName()) {
+ case "long":
+ result = UserRequestFormPropertyType.Long;
+ break;
+
+ case "enum":
+ result = UserRequestFormPropertyType.Enum;
+ break;
+
+ case "date":
+ result = UserRequestFormPropertyType.Date;
+ break;
+
+ case "boolean":
+ result = UserRequestFormPropertyType.Boolean;
+ break;
+
+ case "string":
+ default:
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ protected UserRequestForm getFormTO(final Task task) {
+ return getFormTO(task, engine.getFormService().getTaskFormData(task.getId()));
+ }
+
+ protected UserRequestForm getFormTO(final Task task, final TaskFormData fd) {
+ UserRequestForm formTO =
+ getFormTO(task.getProcessInstanceId(), task.getId(), fd.getFormKey(), fd.getFormProperties());
+ BeanUtils.copyProperties(task, formTO);
+
+ return formTO;
+ }
+
+ protected UserRequestForm getFormTO(final HistoricTaskInstance task) {
+ List<HistoricFormPropertyEntity> props = engine.getHistoryService().
+ createHistoricDetailQuery().taskId(task.getId()).list().stream().
+ filter(HistoricFormPropertyEntity.class::isInstance).
+ map(HistoricFormPropertyEntity.class::cast).
+ collect(Collectors.toList());
+
+ UserRequestForm formTO = getHistoricFormTO(
+ task.getProcessInstanceId(), task.getId(), task.getFormKey(), props);
+ BeanUtils.copyProperties(task, formTO);
+
+ HistoricActivityInstance historicActivityInstance = engine.getHistoryService().
+ createHistoricActivityInstanceQuery().
+ executionId(task.getExecutionId()).activityType("userTask").activityName(task.getName()).singleResult();
+
+ if (historicActivityInstance != null) {
+ formTO.setCreateTime(historicActivityInstance.getStartTime());
+ formTO.setDueDate(historicActivityInstance.getEndTime());
+ }
+
+ return formTO;
+ }
+
+ protected String getUserKey(final String procInstId) {
+ String procBusinessKey = engine.getRuntimeService().createProcessInstanceQuery().
+ processInstanceId(procInstId).singleResult().getBusinessKey();
+
+ return StringUtils.substringAfter(procBusinessKey, ":");
+ }
+
+ protected UserRequestForm getHistoricFormTO(
+ final String procInstID,
+ final String taskId,
+ final String formKey,
+ final List<HistoricFormPropertyEntity> props) {
+
+ UserRequestForm formTO = new UserRequestForm();
+
+ User user = userDAO.find(getUserKey(procInstID));
+ if (user == null) {
+ throw new NotFoundException("User for process instance id " + procInstID);
+ }
+ formTO.setUsername(user.getUsername());
+
+ formTO.setTaskId(taskId);
+ formTO.setFormKey(formKey);
+
+ formTO.setUserTO(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_TO, UserTO.class));
+ formTO.setUserPatch(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class));
+
+ formTO.getProperties().addAll(props.stream().map(prop -> {
+ UserRequestFormProperty propertyTO = new UserRequestFormProperty();
+ propertyTO.setId(prop.getPropertyId());
+ propertyTO.setName(prop.getPropertyId());
+ propertyTO.setValue(prop.getPropertyValue());
+ return propertyTO;
+ }).collect(Collectors.toList()));
+
+ return formTO;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected UserRequestForm getFormTO(
+ final String procInstID,
+ final String taskId,
+ final String formKey,
+ final List<FormProperty> props) {
+
+ UserRequestForm formTO = new UserRequestForm();
+
+ User user = userDAO.find(getUserKey(procInstID));
+ if (user == null) {
+ throw new NotFoundException("User for process instance id " + procInstID);
+ }
+ formTO.setUsername(user.getUsername());
+
+ formTO.setTaskId(taskId);
+ formTO.setFormKey(formKey);
+
+ formTO.setUserTO(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_TO, UserTO.class));
+ formTO.setUserPatch(engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class));
+
+ formTO.getProperties().addAll(props.stream().map(fProp -> {
+ UserRequestFormProperty propertyTO = new UserRequestFormProperty();
+ BeanUtils.copyProperties(fProp, propertyTO, PROPERTY_IGNORE_PROPS);
+ propertyTO.setType(fromFlowableFormType(fProp.getType()));
+ if (propertyTO.getType() == UserRequestFormPropertyType.Date) {
+ propertyTO.setDatePattern((String) fProp.getType().getInformation("datePattern"));
+ }
+ if (propertyTO.getType() == UserRequestFormPropertyType.Enum) {
+ propertyTO.getEnumValues().putAll((Map<String, String>) fProp.getType().getInformation("values"));
+ }
+ return propertyTO;
+ }).collect(Collectors.toList()));
+
+ return formTO;
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public Pair<Integer, List<UserRequestForm>> getForms(
+ final int page, final int size, final List<OrderByClause> orderByClauses) {
+
+ Pair<Integer, List<UserRequestForm>> forms = null;
+
+ TaskQuery formTaskQuery = FlowableRuntimeUtils.createTaskQuery(engine, true);
+
+ String authUser = AuthContextUtils.getUsername();
+ if (adminUser.equals(authUser)) {
+ forms = getForms(formTaskQuery, page, size, orderByClauses);
+ } else {
+ User user = userDAO.findByUsername(authUser);
+ if (user == null) {
+ throw new NotFoundException("Syncope User " + authUser);
+ }
+
+ forms = getForms(formTaskQuery.taskCandidateOrAssigned(user.getUsername()), page, size, orderByClauses);
+
+ List<String> candidateGroups = new ArrayList<>(userDAO.findAllGroupNames(user));
+ if (!candidateGroups.isEmpty()) {
+ forms = getForms(formTaskQuery.taskCandidateGroupIn(candidateGroups), page, size, orderByClauses);
+ }
+ }
+
+ return forms == null
+ ? Pair.of(0, Collections.<UserRequestForm>emptyList())
+ : forms;
+ }
+
+ protected Pair<Integer, List<UserRequestForm>> getForms(
+ final TaskQuery query, final int page, final int size, final List<OrderByClause> orderByClauses) {
+
+ TaskQuery sortedQuery = query;
+ for (OrderByClause clause : orderByClauses) {
+ boolean ack = true;
+ switch (clause.getField().trim()) {
+ case "taskId":
+ sortedQuery = sortedQuery.orderByTaskId();
+ break;
+
+ case "createTime":
+ sortedQuery = sortedQuery.orderByTaskCreateTime();
+ break;
+
+ case "dueDate":
+ sortedQuery = sortedQuery.orderByTaskDueDate();
+ break;
+
+ case "owner":
+ sortedQuery = sortedQuery.orderByTaskOwner();
+ break;
+
+ default:
+ LOG.warn("Form sort request by {}: unsupported, ignoring", clause.getField().trim());
+ ack = false;
+ }
+ if (ack) {
+ sortedQuery = clause.getDirection() == OrderByClause.Direction.ASC
+ ? sortedQuery.asc()
+ : sortedQuery.desc();
+ }
+ }
+
+ List<UserRequestForm> result = sortedQuery.listPage(size * (page <= 0 ? 0 : page - 1), size).stream().
+ map(task -> task instanceof HistoricTaskInstance
+ ? getFormTO((HistoricTaskInstance) task) : getFormTO(task)).
+ collect(Collectors.toList());
+
+ return Pair.of((int) query.count(), result);
+ }
+
+ @Override
+ public List<UserRequestForm> getForms(final String userKey) {
+ List<UserRequestForm> result = new ArrayList<>();
+ FlowableRuntimeUtils.getProcessInstances(engine, userKey).forEach(procInst -> {
+ Task task;
+ try {
+ task = FlowableRuntimeUtils.createTaskQuery(engine, true).
+ processInstanceId(procInst.getProcessInstanceId()).singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While reading form for process instance "
+ + procInst.getProcessInstanceId(), e);
+ }
+
+ if (task != null) {
+ TaskFormData formData;
+ try {
+ formData = engine.getFormService().getTaskFormData(task.getId());
+ } catch (FlowableException e) {
+ throw new WorkflowException("Error while getting form data for task " + task.getId(), e);
+ }
+ if (formData != null && !formData.getFormProperties().isEmpty()) {
+ result.add(getFormTO(task, formData));
+ }
+ }
+ });
+
+ return result;
+ }
+
+ protected Pair<Task, TaskFormData> checkTask(final String taskId, final String authUser) {
+ Task task;
+ try {
+ task = FlowableRuntimeUtils.createTaskQuery(engine, true).taskId(taskId).singleResult();
+ if (task == null) {
+ throw new FlowableException("NULL result");
+ }
+ } catch (FlowableException e) {
+ throw new NotFoundException("Flowable Task " + taskId, e);
+ }
+
+ TaskFormData formData;
+ try {
+ formData = engine.getFormService().getTaskFormData(task.getId());
+ } catch (FlowableException e) {
+ throw new NotFoundException("Form for Flowable Task " + taskId, e);
+ }
+
+ if (!adminUser.equals(authUser)) {
+ User user = userDAO.findByUsername(authUser);
+ if (user == null) {
+ throw new NotFoundException("Syncope User " + authUser);
+ }
+ }
+
+ return Pair.of(task, formData);
+ }
+
+ @Override
+ public UserRequestForm claimForm(final String taskId) {
+ String authUser = AuthContextUtils.getUsername();
+ Pair<Task, TaskFormData> checked = checkTask(taskId, authUser);
+
+ if (!adminUser.equals(authUser)) {
+ List<Task> tasksForUser = FlowableRuntimeUtils.createTaskQuery(engine, true).
+ taskId(taskId).taskCandidateUser(authUser).list();
+ if (tasksForUser.isEmpty()) {
+ throw new WorkflowException(
+ new IllegalArgumentException(authUser + " is not candidate for task " + taskId));
+ }
+ }
+
+ Task task;
+ try {
+ engine.getTaskService().setOwner(taskId, authUser);
+ task = FlowableRuntimeUtils.createTaskQuery(engine, true).taskId(taskId).singleResult();
+ } catch (FlowableException e) {
+ throw new WorkflowException("While reading task " + taskId, e);
+ }
+
+ return getFormTO(task, checked.getRight());
+ }
+
+ private Map<String, String> getPropertiesForSubmit(final UserRequestForm form) {
+ Map<String, String> props = new HashMap<>();
+ form.getProperties().stream().
+ filter(UserRequestFormProperty::isWritable).
+ forEach(prop -> {
+ props.put(prop.getId(), prop.getValue());
+ });
+ return Collections.unmodifiableMap(props);
+ }
+
+ @Override
+ public WorkflowResult<UserPatch> submitForm(final UserRequestForm form) {
+ String authUser = AuthContextUtils.getUsername();
+ Pair<Task, TaskFormData> checked = checkTask(form.getTaskId(), authUser);
+
+ if (!checked.getLeft().getOwner().equals(authUser)) {
+ throw new WorkflowException(new IllegalArgumentException("Task " + form.getTaskId() + " assigned to "
+ + checked.getLeft().getOwner() + " but submitted by " + authUser));
+ }
+
+ String procInstID = checked.getLeft().getProcessInstanceId();
+
+ User user = userDAO.find(getUserKey(procInstID));
+ if (user == null) {
+ throw new NotFoundException("User with key " + getUserKey(procInstID));
+ }
+
+ Set<String> preTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.TASK, "submit");
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.FORM_SUBMITTER, authUser);
+ engine.getRuntimeService().setVariable(procInstID, FlowableRuntimeUtils.USER, lazyLoad(user));
+ try {
+ engine.getFormService().submitTaskFormData(form.getTaskId(), getPropertiesForSubmit(form));
+ } catch (FlowableException e) {
+ FlowableRuntimeUtils.throwException(e, "While submitting form for task " + form.getTaskId());
+ }
+ Set<String> postTasks = FlowableRuntimeUtils.getPerformedTasks(engine, procInstID, user);
+ postTasks.removeAll(preTasks);
+ postTasks.add(form.getTaskId());
+ if (procInstID.equals(FlowableRuntimeUtils.getWFProcInstID(engine, user.getKey()))) {
+ FlowableRuntimeUtils.updateStatus(engine, procInstID, user);
+ }
+
+ user = userDAO.save(user);
+
+ UserPatch userPatch = null;
+ String clearPassword = null;
+ PropagationByResource propByRes = null;
+
+ ProcessInstance afterSubmitPI = engine.getRuntimeService().
+ createProcessInstanceQuery().processInstanceId(procInstID).singleResult();
+ if (afterSubmitPI != null) {
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.TASK);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.FORM_SUBMITTER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_TO);
+
+ // see if there is any propagation to be done
+ propByRes = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE, PropagationByResource.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.PROP_BY_RESOURCE);
+
+ // fetch - if available - the encrypted password
+ String encryptedPwd = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD, String.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.ENCRYPTED_PWD);
+ if (StringUtils.isNotBlank(encryptedPwd)) {
+ clearPassword = FlowableRuntimeUtils.decrypt(encryptedPwd);
+ }
+
+ Boolean enabled = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.ENABLED, Boolean.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.ENABLED);
+
+ // supports approval chains
+ FlowableRuntimeUtils.saveForFormSubmit(
+ engine,
+ procInstID,
+ user,
+ dataBinder.getUserTO(user, true),
+ clearPassword,
+ enabled,
+ propByRes);
+
+ userPatch = engine.getRuntimeService().
+ getVariable(procInstID, FlowableRuntimeUtils.USER_PATCH, UserPatch.class);
+ engine.getRuntimeService().removeVariable(procInstID, FlowableRuntimeUtils.USER_PATCH);
+ }
+ if (userPatch == null) {
+ userPatch = new UserPatch();
+ userPatch.setKey(user.getKey());
+ userPatch.setPassword(new PasswordPatch.Builder().onSyncope(true).value(clearPassword).build());
+
+ if (propByRes != null) {
+ userPatch.getPassword().getResources().addAll(propByRes.get(ResourceOperation.CREATE));
+ }
+ }
+
+ return new WorkflowResult<>(userPatch, propByRes, postTasks);
+ }
+}
[17/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
[SYNCOPE-1369] Flowable support refactored as extension + code review (now with variable cleanup)
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/3cabe08a
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/3cabe08a
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/3cabe08a
Branch: refs/heads/master
Commit: 3cabe08aab4db4a7fb5a9dedb471ac453e2ff713
Parents: 1161239
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Sep 25 14:16:59 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Sep 25 14:27:41 2018 +0200
----------------------------------------------------------------------
archetype/pom.xml | 4 -
.../archetype-resources/console/pom.xml | 87 +-
.../resources/archetype-resources/core/pom.xml | 4 +-
archetype/src/main/resources/meta-pom.xml | 6 -
.../syncope/client/cli/commands/info/Info.java | 12 -
.../client/cli/commands/info/InfoCommand.java | 4 -
.../cli/commands/info/InfoResultManager.java | 9 -
.../commands/self/AbstractWorkflowCommand.java | 27 -
.../cli/commands/self/WorkflowCommand.java | 97 --
.../commands/self/WorkflowExportDefinition.java | 61 -
.../commands/self/WorkflowExportDiagram.java | 70 -
.../commands/self/WorkflowResultManager.java | 25 -
.../self/WorkflowSyncopeOperations.java | 41 -
.../cli/src/main/resources/messages.properties | 1 -
.../client/cli/util/CommandUtilsTest.java | 2 +-
.../console/SyncopeConsoleApplication.java | 54 +-
.../client/console/annotations/Resource.java | 41 +
.../client/console/approvals/Approval.java | 206 ---
.../console/approvals/ApprovalDetails.java | 63 -
.../approvals/ApprovalDirectoryPanel.java | 358 -----
.../client/console/approvals/ApprovalModal.java | 82 -
.../client/console/commons/Constants.java | 2 -
.../init/ClassPathScanImplementationLookup.java | 56 +-
.../syncope/client/console/pages/Approvals.java | 41 -
.../syncope/client/console/pages/BasePage.java | 52 +-
.../console/pages/FlowableModelerPopupPage.java | 27 -
.../syncope/client/console/pages/Workflow.java | 64 -
.../console/panels/NewWorkflowProcess.java | 87 --
.../panels/ParametersDirectoryPanel.java | 1 -
.../client/console/panels/TogglePanel.java | 6 -
.../console/panels/WorkflowDirectoryPanel.java | 333 ----
.../resources/AbstractWorkflowResource.java | 51 -
.../console/resources/FilesystemResource.java | 79 -
.../resources/WorkflowDefGETResource.java | 58 -
.../resources/WorkflowDefPUTResource.java | 74 -
.../console/rest/UserWorkflowRestClient.java | 59 -
.../client/console/rest/WorkflowRestClient.java | 73 -
.../wicket/markup/html/form/ActionLink.java | 4 +-
.../html/form/ActionLinksTogglePanel.java | 8 +-
.../wicket/markup/html/form/ActionPanel.java | 2 +-
.../client/console/widgets/ApprovalsWidget.java | 128 --
.../client/console/widgets/ExtAlertWidget.java | 30 +
.../src/main/resources/console.properties | 3 -
.../client/console/approvals/Approval.html | 31 -
.../console/approvals/Approval.properties | 18 -
.../console/approvals/ApprovalDetails.html | 23 -
.../client/console/approvals/ApprovalModal.html | 23 -
.../console/approvals/ApprovalModal.properties | 17 -
.../approvals/ApprovalModal_it.properties | 17 -
.../approvals/ApprovalModal_ja.properties | 17 -
.../approvals/ApprovalModal_pt_BR.properties | 17 -
.../approvals/ApprovalModal_ru.properties | 17 -
.../console/approvals/Approval_it.properties | 18 -
.../console/approvals/Approval_ja.properties | 18 -
.../console/approvals/Approval_pt_BR.properties | 18 -
.../console/approvals/Approval_ru.properties | 20 -
.../syncope/client/console/pages/Approvals.html | 35 -
.../client/console/pages/Approvals.properties | 34 -
.../console/pages/Approvals_it.properties | 34 -
.../console/pages/Approvals_ja.properties | 34 -
.../console/pages/Approvals_pt_BR.properties | 34 -
.../console/pages/Approvals_ru.properties | 52 -
.../syncope/client/console/pages/BasePage.html | 5 +-
.../console/pages/FlowableModelerPopupPage.html | 28 -
.../syncope/client/console/pages/Workflow.html | 37 -
.../client/console/pages/Workflow.properties | 19 -
.../client/console/pages/Workflow_it.properties | 19 -
.../client/console/pages/Workflow_ja.properties | 19 -
.../console/pages/Workflow_pt_BR.properties | 19 -
.../client/console/pages/Workflow_ru.properties | 19 -
.../console/panels/NewWorkflowProcess.html | 32 -
.../console/panels/WorkflowDirectoryPanel.html | 23 -
.../client/console/panels/empty.bpmn20.xml | 49 -
.../markup/html/form/ActionPanel.properties | 6 +-
.../markup/html/form/ActionPanel_it.properties | 6 +-
.../markup/html/form/ActionPanel_ja.properties | 6 +-
.../html/form/ActionPanel_pt_BR.properties | 6 +-
.../markup/html/form/ActionPanel_ru.properties | 6 +-
.../console/widgets/ApprovalsWidget.properties | 21 -
.../widgets/ApprovalsWidget_it.properties | 21 -
.../widgets/ApprovalsWidget_ja.properties | 21 -
.../widgets/ApprovalsWidget_pt_BR.properties | 21 -
.../widgets/ApprovalsWidget_ru.properties | 22 -
.../enduser/SyncopeEnduserApplication.java | 10 +-
.../syncope/common/lib/PropertyUtils.java | 17 +-
.../lib/report/ReconciliationReportletConf.java | 1 -
.../common/lib/report/UserReportletConf.java | 1 -
.../common/lib/to/WorkflowDefinitionTO.java | 71 -
.../common/lib/to/WorkflowFormPropertyTO.java | 124 --
.../syncope/common/lib/to/WorkflowFormTO.java | 147 --
.../syncope/common/lib/to/WorkflowTaskTO.java | 40 -
.../common/lib/types/StandardEntitlement.java | 18 -
.../lib/types/WorkflowFormPropertyType.java | 32 -
.../syncope/common/lib/types/WorkflowTasks.java | 47 -
.../org/apache/syncope/common/lib/JSONTest.java | 10 +-
.../rest/api/beans/WorkflowFormQuery.java | 32 -
.../common/rest/api/service/AnyService.java | 3 +
.../api/service/SecurityQuestionService.java | 2 +-
.../rest/api/service/UserWorkflowService.java | 118 --
.../rest/api/service/WorkflowService.java | 121 --
.../core/logic/SecurityQuestionLogic.java | 6 +-
.../syncope/core/logic/UserWorkflowLogic.java | 137 --
.../syncope/core/logic/WorkflowLogic.java | 113 --
.../core/persistence/api/dao/AnyDAO.java | 2 -
.../core/persistence/api/entity/Any.java | 4 -
.../core/persistence/api/entity/user/User.java | 9 -
.../persistence/jpa/dao/AbstractAnyDAO.java | 18 -
.../persistence/jpa/dao/JPAAnyObjectDAO.java | 4 +-
.../core/persistence/jpa/dao/JPAGroupDAO.java | 4 +-
.../jpa/dao/JPASecurityQuestionDAO.java | 10 +-
.../core/persistence/jpa/dao/JPAUserDAO.java | 4 +-
.../persistence/jpa/entity/AbstractAny.java | 12 -
.../jpa/entity/JPAEntityFactory.java | 1 +
.../jpa/entity/JPASecurityQuestion.java | 47 -
.../persistence/jpa/entity/conf/JPAConf.java | 10 -
.../jpa/entity/user/JPASecurityQuestion.java | 48 +
.../persistence/jpa/entity/user/JPAUser.java | 45 -
...ltiJarAwarePersistenceUnitPostProcessor.java | 6 +-
.../main/resources/domains/MasterContent.xml | 15 +-
.../jpa/inner/ImplementationTest.java | 4 +-
.../persistence/jpa/inner/MultitenancyTest.java | 2 +-
.../persistence/jpa/inner/PlainSchemaTest.java | 2 +-
.../core/persistence/jpa/inner/TaskTest.java | 2 +-
.../test/resources/domains/MasterContent.xml | 27 +-
.../src/test/resources/domains/TwoContent.xml | 14 -
core/pom.xml | 1 -
.../provisioning/api/event/AnyDeletedEvent.java | 8 +
.../java/job/IdentityRecertification.java | 126 --
.../job/report/ReconciliationReportlet.java | 5 -
.../java/job/report/UserReportlet.java | 5 -
.../cxf/service/UserWorkflowServiceImpl.java | 70 -
.../rest/cxf/service/WorkflowServiceImpl.java | 83 -
.../core/spring/security/AuthContextUtils.java | 29 +-
.../core/spring/security/SecureRandomUtils.java | 4 +
core/upgrade/src/main/resources/schema.xml | 5 -
.../core/upgrade/GeneratedUpgradeSQLTest.java | 2 +-
core/upgrade/src/test/resources/syncopedb20.sql | 76 +-
.../workflow/api/AnyObjectWorkflowAdapter.java | 9 -
.../api/AnyObjectWorkflowDefinitionAdapter.java | 22 -
.../core/workflow/api/GroupWorkflowAdapter.java | 9 -
.../api/GroupWorkflowDefinitionAdapter.java | 22 -
.../core/workflow/api/UserWorkflowAdapter.java | 18 -
.../api/UserWorkflowDefinitionAdapter.java | 22 -
.../core/workflow/api/WorkflowAdapter.java | 50 -
.../workflow/api/WorkflowDefinitionAdapter.java | 64 -
.../workflow/api/WorkflowDefinitionFormat.java | 29 -
core/workflow-flowable/pom.xml | 82 -
.../flowable/FlowableDefinitionLoader.java | 92 --
.../workflow/flowable/FlowableDeployUtils.java | 92 --
.../flowable/FlowableUserWorkflowAdapter.java | 1035 -------------
.../core/workflow/flowable/FlowableUtils.java | 31 -
.../flowable/SyncopeEntitiesVariableType.java | 35 -
.../flowable/SyncopeGroupQueryImpl.java | 89 --
.../flowable/SyncopeIdmIdentityService.java | 51 -
.../core/workflow/flowable/SyncopeSession.java | 26 -
.../flowable/SyncopeSessionFactory.java | 46 -
.../workflow/flowable/SyncopeUserQueryImpl.java | 101 --
.../flowable/spring/DomainProcessEngine.java | 114 --
.../spring/DomainProcessEngineFactoryBean.java | 111 --
.../task/AbstractFlowableServiceTask.java | 45 -
.../workflow/flowable/task/AutoActivate.java | 60 -
.../core/workflow/flowable/task/Create.java | 52 -
.../core/workflow/flowable/task/Delete.java | 41 -
.../workflow/flowable/task/GenerateToken.java | 44 -
.../core/workflow/flowable/task/Notify.java | 65 -
.../workflow/flowable/task/PasswordReset.java | 71 -
.../core/workflow/flowable/task/Reactivate.java | 29 -
.../core/workflow/flowable/task/Recertify.java | 58 -
.../core/workflow/flowable/task/Suspend.java | 29 -
.../core/workflow/flowable/task/Update.java | 54 -
.../src/main/resources/userWorkflow.bpmn20.xml | 287 ----
.../src/main/resources/workflow.properties | 21 -
.../main/resources/workflowFlowableContext.xml | 63 -
.../java/AbstractAnyObjectWorkflowAdapter.java | 4 +-
.../java/AbstractGroupWorkflowAdapter.java | 3 +-
.../java/AbstractUserWorkflowAdapter.java | 16 +-
.../java/DefaultAnyObjectWorkflowAdapter.java | 68 -
.../java/DefaultGroupWorkflowAdapter.java | 67 -
.../java/DefaultUserWorkflowAdapter.java | 70 -
deb/console/pom.xml | 5 +
deb/core/pom.xml | 4 +-
docker/console/pom.xml | 4 -
docker/console/src/main/resources/Dockerfile | 1 -
.../main/resources/console.properties.template | 2 -
ext/camel/persistence-jpa/pom.xml | 2 +-
.../rest/api/service/CamelRouteService.java | 2 +-
.../client/ElasticsearchUtils.java | 4 +-
ext/flowable/client-console/pom.xml | 137 ++
.../client/console/approvals/Approval.java | 206 +++
.../console/approvals/ApprovalDetails.java | 63 +
.../approvals/ApprovalDirectoryPanel.java | 355 +++++
.../client/console/approvals/ApprovalModal.java | 82 +
.../syncope/client/console/pages/Approvals.java | 41 +
.../syncope/client/console/pages/Flowable.java | 67 +
.../console/pages/FlowableModelerPopupPage.java | 27 +
.../panels/BpmnProcessDirectoryPanel.java | 308 ++++
.../client/console/panels/NewBpmnProcess.java | 87 ++
.../resources/AbstractBpmnProcessResource.java | 51 +
.../resources/BpmnProcessGETResource.java | 56 +
.../resources/BpmnProcessPUTResource.java | 73 +
.../console/rest/BpmnProcessRestClient.java | 72 +
.../console/rest/UserRequestRestClient.java | 54 +
.../rest/UserWorkflowTaskRestClient.java | 34 +
.../client/console/widgets/ApprovalsWidget.java | 130 ++
.../src/main/resources/app-cfg.js | 25 +
.../client/console/approvals/Approval.html | 31 +
.../console/approvals/Approval.properties | 18 +
.../console/approvals/ApprovalDetails.html | 23 +
.../client/console/approvals/ApprovalModal.html | 23 +
.../console/approvals/ApprovalModal.properties | 17 +
.../approvals/ApprovalModal_it.properties | 17 +
.../approvals/ApprovalModal_ja.properties | 17 +
.../approvals/ApprovalModal_pt_BR.properties | 17 +
.../approvals/ApprovalModal_ru.properties | 17 +
.../console/approvals/Approval_it.properties | 18 +
.../console/approvals/Approval_ja.properties | 18 +
.../console/approvals/Approval_pt_BR.properties | 18 +
.../console/approvals/Approval_ru.properties | 20 +
.../syncope/client/console/pages/Approvals.html | 35 +
.../client/console/pages/Approvals.properties | 34 +
.../console/pages/Approvals_it.properties | 34 +
.../console/pages/Approvals_ja.properties | 34 +
.../console/pages/Approvals_pt_BR.properties | 34 +
.../console/pages/Approvals_ru.properties | 52 +
.../syncope/client/console/pages/Flowable.html | 37 +
.../client/console/pages/Flowable.properties | 19 +
.../console/pages/FlowableModelerPopupPage.html | 28 +
.../client/console/pages/Flowable_it.properties | 19 +
.../client/console/pages/Flowable_ja.properties | 19 +
.../console/pages/Flowable_pt_BR.properties | 19 +
.../client/console/pages/Flowable_ru.properties | 19 +
.../panels/BpmnProcessDirectoryPanel.html | 23 +
.../client/console/panels/NewBpmnProcess.html | 32 +
.../client/console/panels/empty.bpmn20.xml | 49 +
.../console/widgets/ApprovalsWidget.properties | 21 +
.../widgets/ApprovalsWidget_it.properties | 21 +
.../widgets/ApprovalsWidget_ja.properties | 21 +
.../widgets/ApprovalsWidget_pt_BR.properties | 21 +
.../widgets/ApprovalsWidget_ru.properties | 22 +
.../src/main/resources/save-model.html | 132 ++
.../src/main/resources/toolbar.js | 181 +++
.../src/main/resources/url-config.js | 39 +
ext/flowable/common-lib/pom.xml | 56 +
.../syncope/common/lib/to/BpmnProcessTO.java | 72 +
.../syncope/common/lib/to/UserRequestForm.java | 147 ++
.../common/lib/to/UserRequestFormProperty.java | 124 ++
.../syncope/common/lib/to/UserRequestTO.java | 70 +
.../syncope/common/lib/to/WorkflowTask.java | 40 +
.../common/lib/to/WorkflowTaskExecInput.java | 55 +
.../common/lib/types/BpmnProcessFormat.java | 29 +
.../common/lib/types/FlowableEntitlement.java | 76 +
.../lib/types/UserRequestFormPropertyType.java | 32 +
.../syncope/common/lib/types/WorkflowTasks.java | 47 +
ext/flowable/flowable-bpmn/pom.xml | 87 ++
.../core/flowable/api/BpmnProcessManager.java | 65 +
.../core/flowable/api/UserRequestHandler.java | 108 ++
.../core/flowable/api/WorkflowTaskManager.java | 70 +
.../impl/FlowableBpmnProcessManager.java | 212 +++
.../core/flowable/impl/FlowableDeployUtils.java | 92 ++
.../flowable/impl/FlowableRuntimeUtils.java | 225 +++
.../impl/FlowableUserRequestHandler.java | 574 +++++++
.../impl/FlowableUserWorkflowAdapter.java | 488 ++++++
.../flowable/impl/FlowableWorkflowUtils.java | 47 +
.../flowable/impl/SyncopeTaskQueryImpl.java | 49 +
.../flowable/support/DomainProcessEngine.java | 114 ++
.../DomainProcessEngineConfiguration.java | 32 +
.../support/DomainProcessEngineFactoryBean.java | 112 ++
.../support/SyncopeEntitiesVariableType.java | 35 +
.../flowable/support/SyncopeGroupQueryImpl.java | 89 ++
.../support/SyncopeIdmIdentityService.java | 51 +
.../core/flowable/support/SyncopeSession.java | 26 +
.../flowable/support/SyncopeSessionFactory.java | 46 +
.../flowable/support/SyncopeUserQueryImpl.java | 101 ++
.../task/AbstractFlowableServiceTask.java | 45 +
.../core/flowable/task/AutoActivate.java | 60 +
.../syncope/core/flowable/task/Create.java | 55 +
.../syncope/core/flowable/task/Delete.java | 41 +
.../core/flowable/task/GenerateToken.java | 44 +
.../syncope/core/flowable/task/Notify.java | 64 +
.../core/flowable/task/PasswordReset.java | 70 +
.../syncope/core/flowable/task/Reactivate.java | 29 +
.../syncope/core/flowable/task/Suspend.java | 29 +
.../syncope/core/flowable/task/Update.java | 58 +
.../org/apache/syncope/ext/flowable/Task.xml | 1418 ++++++++++++++++++
.../apache/syncope/ext/flowable/mappings.xml | 73 +
.../src/main/resources/userWorkflow.bpmn20.xml | 228 +++
.../src/main/resources/workflow.properties | 21 +
.../main/resources/workflowFlowableContext.xml | 62 +
ext/flowable/logic/pom.xml | 61 +
.../syncope/core/logic/BpmnProcessLogic.java | 73 +
.../syncope/core/logic/UserRequestLogic.java | 160 ++
.../core/logic/UserWorkflowTaskLogic.java | 91 ++
.../syncope/core/logic/init/FlowableLoader.java | 98 ++
ext/flowable/pom.xml | 49 +
ext/flowable/rest-api/pom.xml | 76 +
.../rest/api/beans/UserRequestFormQuery.java | 32 +
.../rest/api/service/BpmnProcessService.java | 108 ++
.../rest/api/service/UserRequestService.java | 125 ++
.../api/service/UserWorkflowTaskService.java | 67 +
ext/flowable/rest-cxf/pom.xml | 72 +
.../cxf/service/BpmnProcessServiceImpl.java | 82 +
.../cxf/service/UserRequestServiceImpl.java | 73 +
.../service/UserWorkflowTaskServiceImpl.java | 45 +
.../client/console/pages/OIDCClient.java | 3 +-
ext/oidcclient/persistence-jpa/pom.xml | 2 +-
.../rest/api/service/OIDCClientService.java | 2 +-
.../rest/api/service/OIDCProviderService.java | 2 +-
ext/pom.xml | 1 +
.../syncope/client/console/pages/SAML2SP.java | 2 +-
.../syncope/core/logic/init/SAML2SPLoader.java | 7 +-
ext/saml2sp/persistence-jpa/pom.xml | 2 +-
.../rest/api/service/SAML2IdPService.java | 2 +-
.../common/rest/api/service/SAML2SPService.java | 2 +-
.../client/console/pages/SCIMConfPage.java | 2 +-
.../rest/api/service/SCIMConfService.java | 2 +-
fit/console-reference/pom.xml | 65 +-
.../src/main/resources/app-cfg.js | 25 -
.../src/main/resources/console.properties | 3 -
.../src/main/resources/save-model.html | 132 --
.../src/main/resources/toolbar.js | 181 ---
.../src/main/resources/url-config.js | 39 -
.../src/test/resources/hotswap-agent.properties | 1 +
fit/core-reference/pom.xml | 16 +-
.../fit/core/reference/AssignDirectorGroup.java | 63 +
.../src/main/resources/all/workflow.properties | 2 +-
.../main/resources/all/workflowTestContext.xml | 27 +
.../resources/directorGroupRequest.bpmn20.xml | 104 ++
.../src/main/resources/userWorkflow.bpmn20.xml | 726 +++++----
.../org/apache/syncope/fit/AbstractITCase.java | 16 +-
.../apache/syncope/fit/FlowableDetector.java | 10 +-
.../syncope/fit/console/AjaxBrowseITCase.java | 7 -
.../syncope/fit/core/AuthenticationITCase.java | 10 +-
.../syncope/fit/core/BpmnProcessITCase.java | 72 +
.../syncope/fit/core/MultitenancyITCase.java | 4 +-
.../apache/syncope/fit/core/PullTaskITCase.java | 2 +-
.../org/apache/syncope/fit/core/RoleITCase.java | 7 +-
.../syncope/fit/core/SchedTaskITCase.java | 26 -
.../org/apache/syncope/fit/core/UserITCase.java | 6 +-
.../syncope/fit/core/UserRequestITCase.java | 144 ++
.../apache/syncope/fit/core/UserSelfITCase.java | 352 ++++-
.../syncope/fit/core/UserWorkflowITCase.java | 361 -----
.../apache/syncope/fit/core/WorkflowITCase.java | 74 -
.../src/test/resources/addFlowableToContent.xsl | 10 +-
.../src/test/resources/console.properties | 3 -
.../src/test/resources/hotswap-agent.properties | 11 +-
.../syncope/installer/files/ConsolePom.java | 86 +-
.../apache/syncope/installer/files/CorePom.java | 6 +-
.../installer/processes/ArchetypeProcess.java | 28 +-
.../installer/processes/ContainerProcess.java | 33 +-
.../main/resources/izpack/ProcessPanel.Spec.xml | 51 +-
.../main/resources/izpack/userInputLang.xml_eng | 1 -
.../main/resources/izpack/userInputLang.xml_ita | 1 -
.../src/main/resources/izpack/userInputSpec.xml | 3 -
pom.xml | 1 -
.../reference-guide/concepts/workflow.adoc | 55 -
.../workingwithapachesyncope/customization.adoc | 15 +-
.../configurationparameters.adoc | 2 -
.../systemadministration/flowablemodeler.adoc | 46 -
.../systemadministration.adoc | 2 -
359 files changed, 11558 insertions(+), 9696 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/archetype/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/pom.xml b/archetype/pom.xml
index 6c3435d..69abfae 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -244,10 +244,6 @@ under the License.
<targetPath>${project.build.outputDirectory}/archetype-resources/console/src/main/resources</targetPath>
<includes>
<include>log4j2.xml</include>
- <include>save-model.html</include>
- <include>app-cfg.js</include>
- <include>url-config.js</include>
- <include>toolbar.js</include>
</includes>
</resource>
<resource>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/archetype/src/main/resources/archetype-resources/console/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/archetype-resources/console/pom.xml b/archetype/src/main/resources/archetype-resources/console/pom.xml
index 51cec9b..fb5724c 100644
--- a/archetype/src/main/resources/archetype-resources/console/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/console/pom.xml
@@ -122,6 +122,12 @@ under the License.
<dependencies>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${syncope.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-client-console</artifactId>
<version>${syncope.version}</version>
@@ -144,90 +150,9 @@ under the License.
<artifactId>syncope-ext-scimv2-client-console</artifactId>
<version>${syncope.version}</version>
</dependency>
-
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-ui-modeler-app</artifactId>
- <type>war</type>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>setupFlowableModeler</id>
- <phase>process-resources</phase>
- <configuration>
- <target>
- <unzip src="${settings.localRepository}/org/flowable/flowable-ui-modeler-app/${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war"
- dest="${flowable-modeler.directory}">
- <patternset>
- <include name="WEB-INF/classes/static/**"/>
- <include name="WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar"/>
- </patternset>
- </unzip>
-
- <unzip src="${flowable-modeler.directory}/WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar"
- dest="${flowable-modeler.directory}">
- <patternset>
- <include name="stencilset_bpmn.json"/>
- </patternset>
- </unzip>
-
- <move todir="${flowable-modeler.directory}">
- <fileset dir="${flowable-modeler.directory}/WEB-INF/classes/static/">
- <include name="**"/>
- </fileset>
- </move>
- <delete dir="${flowable-modeler.directory}/WEB-INF"/>
-
- <replace file="${flowable-modeler.directory}/index.html"
- token="</head>"
- value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>"/>
- <replace file="${flowable-modeler.directory}/index.html"
- token=" ng-click="backToLanding()""
- value=" disabled="disabled""/>
- <replace file="${flowable-modeler.directory}/index.html"
- token="<ul class="nav navbar-nav" id="main-nav""
- value="<ul class="nav navbar-nav" id="main-nav" style="display: none;""/>
- <replace file="${flowable-modeler.directory}/index.html"
- token="<div class="pull-right"
- value="<div style="display: none;" class="pull-right"/>
- <replace file="${flowable-modeler.directory}/editor-app/editor.html"
- token="<div class="btn-group pull-right""
- value="<div style="display: none;" class="btn-group pull-right""/>
- <replace file="${flowable-modeler.directory}/editor-app/configuration/toolbar-default-actions.js"
- token="$location.path('/processes');"
- value="window.close();"/>
-
- <copy file="${basedir}/src/main/resources/app-cfg.js"
- todir="${flowable-modeler.directory}/scripts"
- overwrite="true"/>
- <copy file="${basedir}/src/main/resources/url-config.js"
- todir="${flowable-modeler.directory}/editor-app/configuration"
- overwrite="true"/>
- <copy file="${basedir}/src/main/resources/toolbar.js"
- todir="${flowable-modeler.directory}/editor-app/configuration"
- overwrite="true"/>
- <copy file="${basedir}/src/main/resources/save-model.html"
- todir="${flowable-modeler.directory}/editor-app/popups"
- overwrite="true"/>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
<resources>
<resource>
<directory>src/main/resources</directory>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/archetype/src/main/resources/archetype-resources/core/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/archetype-resources/core/pom.xml b/archetype/src/main/resources/archetype-resources/core/pom.xml
index f248d9a..f951894 100644
--- a/archetype/src/main/resources/archetype-resources/core/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/core/pom.xml
@@ -160,8 +160,8 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${syncope.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/archetype/src/main/resources/meta-pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/meta-pom.xml b/archetype/src/main/resources/meta-pom.xml
index 0b163ae..d68a0d0 100644
--- a/archetype/src/main/resources/meta-pom.xml
+++ b/archetype/src/main/resources/meta-pom.xml
@@ -69,12 +69,6 @@ under the License.
<artifactId>syncope-core-persistence-jpa</artifactId>
<version>${syncope.version}</version>
</dependency>
-
- <dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
- <version>${syncope.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.syncope.client</groupId>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
index 8167cc5..91cb879 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
@@ -82,18 +82,6 @@ public class Info {
}
}
- public void workflowAdapter() {
- try {
- infoResultManager.printWorkflowAdapter(
- platformInfo.getAnyObjectWorkflowAdapter(),
- platformInfo.getUserWorkflowAdapter(),
- platformInfo.getGroupWorkflowAdapter());
- } catch (final Exception ex) {
- LOG.error("Information error", ex);
- infoResultManager.genericError(ex.getMessage());
- }
- }
-
public void accountRules() {
platformInfo.getJavaImplInfo(ImplementationType.ACCOUNT_RULE).ifPresent(info -> {
try {
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
index 28559be..460d54a 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoCommand.java
@@ -52,9 +52,6 @@ public class InfoCommand extends AbstractCommand {
case PROVISIONING_MANAGER:
info.provisioningManager();
break;
- case WORKFLOW_ADAPTER:
- info.workflowAdapter();
- break;
case ACCOUNT_RULES:
info.accountRules();
break;
@@ -122,7 +119,6 @@ public class InfoCommand extends AbstractCommand {
PWD_RESET_WITH_SECURITY_QUESTION("--pwd-reset-with-question"),
SELF_REG_ALLOWED("--self-reg-allowed"),
PROVISIONING_MANAGER("--provisioning-manager-classes"),
- WORKFLOW_ADAPTER("--workflow-adapter-classes"),
ACCOUNT_RULES("--account-rules-classes"),
CONNID_LOCATION("--connid-locations"),
RECON_FILTER_BUILDERS("--reconciliation-filter-builders"),
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
index d19b0ae..65ba206 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
@@ -48,15 +48,6 @@ public class InfoResultManager extends CommonsResultManager {
"Group provisioning manager class: " + getGroupProvisioningManager);
}
- public void printWorkflowAdapter(final String anyObjectWorkflowAdapter,
- final String userWorkflowAdapter,
- final String groupWorkflowAdapter) {
- genericMessage(
- "Any object workflow adapter class: " + anyObjectWorkflowAdapter,
- "User workflow adapter class: " + userWorkflowAdapter,
- "Group workflow adapter class: " + groupWorkflowAdapter);
- }
-
public void printAccountRules(final Collection<String> rules) {
rules.forEach(accountRule -> {
genericMessage("Account rule: " + accountRule);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java
deleted file mode 100644
index b21abf3..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java
+++ /dev/null
@@ -1,27 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-public abstract class AbstractWorkflowCommand {
-
- protected final WorkflowResultManager workflowResultManager = new WorkflowResultManager();
-
- protected final WorkflowSyncopeOperations workflowSyncopeOperations = new WorkflowSyncopeOperations();
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java
deleted file mode 100644
index 215c865..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowCommand.java
+++ /dev/null
@@ -1,97 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.cli.Command;
-import org.apache.syncope.client.cli.Input;
-import org.apache.syncope.client.cli.commands.AbstractCommand;
-
-@Command(name = "workflow")
-public class WorkflowCommand extends AbstractCommand {
-
- private final WorkflowResultManager workflowResultManager = new WorkflowResultManager();
-
- @Override
- public void execute(final Input input) {
- if (StringUtils.isBlank(input.getOption())) {
- input.setOption(UserWorkflowOptions.HELP.getOptionName());
- }
-
- switch (UserWorkflowOptions.fromName(input.getOption())) {
- case EXPORT_DIAGRAM:
- new WorkflowExportDiagram(input).export();
- break;
- case EXPORT_DEFINITION:
- new WorkflowExportDefinition(input).export();
- break;
- case HELP:
- System.out.println(getHelpMessage());
- break;
- default:
- workflowResultManager.defaultOptionMessage(input.getOption(), getHelpMessage());
- }
- }
-
- @Override
- public String getHelpMessage() {
- return workflowResultManager.commandHelpMessage(getClass());
- }
-
- private enum UserWorkflowOptions {
-
- HELP("--help"),
- EXPORT_DIAGRAM("--export-diagram"),
- EXPORT_DEFINITION("--export-definition");
-
- private final String optionName;
-
- UserWorkflowOptions(final String optionName) {
- this.optionName = optionName;
- }
-
- public String getOptionName() {
- return optionName;
- }
-
- public boolean equalsOptionName(final String otherName) {
- return (otherName == null) ? false : optionName.equals(otherName);
- }
-
- public static UserWorkflowOptions fromName(final String name) {
- UserWorkflowOptions optionToReturn = HELP;
- for (final UserWorkflowOptions option : UserWorkflowOptions.values()) {
- if (option.equalsOptionName(name)) {
- optionToReturn = option;
- }
- }
- return optionToReturn;
- }
-
- public static List<String> toList() {
- final List<String> options = new ArrayList<>();
- for (final UserWorkflowOptions value : values()) {
- options.add(value.getOptionName());
- }
- return options;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
deleted file mode 100644
index b855ae0..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java
+++ /dev/null
@@ -1,61 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import javax.xml.ws.WebServiceException;
-import org.apache.syncope.client.cli.Input;
-import org.apache.syncope.client.cli.util.CommandUtils;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowExportDefinition extends AbstractWorkflowCommand {
-
- private static final Logger LOG = LoggerFactory.getLogger(WorkflowExportDefinition.class);
-
- private static final String EXPORT_HELP_MESSAGE = "workflow --export-definition {ANY-TYPE-KIND}\n";
-
- private final Input input;
-
- public WorkflowExportDefinition(final Input input) {
- this.input = input;
- }
-
- public void export() {
- if (input.parameterNumber() == 1) {
- try {
- workflowSyncopeOperations.exportDefinition(input.firstParameter());
- } catch (final SyncopeClientException | WebServiceException ex) {
- LOG.error("Error", ex);
- if (ex.getMessage().startsWith("NotFound")) {
- workflowResultManager.notFoundError("Workflow", input.firstParameter());
- } else {
- workflowResultManager.genericError(ex.getMessage());
- }
- } catch (final IllegalArgumentException ex) {
- LOG.error("Error", ex);
- workflowResultManager.typeNotValidError(
- "workflow", input.firstParameter(), CommandUtils.fromEnumToArray(AnyTypeKind.class));
- }
- } else {
- workflowResultManager.commandOptionError(EXPORT_HELP_MESSAGE);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
deleted file mode 100644
index 80b6e41..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDiagram.java
+++ /dev/null
@@ -1,70 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import javax.ws.rs.core.Response;
-import javax.xml.ws.WebServiceException;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.syncope.client.cli.Input;
-import org.apache.syncope.client.cli.util.CommandUtils;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-
-public class WorkflowExportDiagram extends AbstractWorkflowCommand {
-
- private static final String EXPORT_HELP_MESSAGE = "workflow --export-diagram {ANY-TYPE-KIND}\n";
-
- private final Input input;
-
- public WorkflowExportDiagram(final Input input) {
- this.input = input;
- }
-
- public void export() {
- if (input.parameterNumber() == 1) {
- try {
- final Response response = workflowSyncopeOperations.exportDiagram(input.firstParameter());
- final byte[] diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
- try (final OutputStream os = Files.newOutputStream(Paths.get("/tmp/diagram.png"))) {
- os.write(diagram);
- os.close();
- }
- workflowResultManager.genericMessage("Diagram created: /tmp/diagram.png");
- } catch (final SyncopeClientException | WebServiceException ex) {
- if (ex.getMessage().startsWith("NotFound")) {
- workflowResultManager.notFoundError("Workflow", input.firstParameter());
- } else {
- workflowResultManager.genericError(ex.getMessage());
- }
- } catch (final IllegalArgumentException ex) {
- workflowResultManager.typeNotValidError(
- "workflow", input.firstParameter(), CommandUtils.fromEnumToArray(AnyTypeKind.class));
- } catch (final IOException ex) {
- workflowResultManager.genericError(ex.getMessage());
- }
- } else {
- workflowResultManager.commandOptionError(EXPORT_HELP_MESSAGE);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java
deleted file mode 100644
index f46be07..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowResultManager.java
+++ /dev/null
@@ -1,25 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import org.apache.syncope.client.cli.commands.CommonsResultManager;
-
-public class WorkflowResultManager extends CommonsResultManager {
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
deleted file mode 100644
index 45025d4..0000000
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.syncope.client.cli.commands.self;
-
-import javax.ws.rs.core.Response;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.syncope.client.cli.SyncopeServices;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
-
-public class WorkflowSyncopeOperations {
-
- private static final String DEFAULT = "userWorkflow";
-
- private final WorkflowService workflowService = SyncopeServices.get(WorkflowService.class);
-
- public Response exportDiagram(final String anyType) {
- WebClient.client(workflowService).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
- return workflowService.exportDiagram(anyType, DEFAULT);
- }
-
- public Response exportDefinition(final String anyType) {
- return workflowService.get(anyType, DEFAULT);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/main/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/cli/src/main/resources/messages.properties b/client/cli/src/main/resources/messages.properties
index 48cdc15..7bd62fa 100644
--- a/client/cli/src/main/resources/messages.properties
+++ b/client/cli/src/main/resources/messages.properties
@@ -31,5 +31,4 @@ role.help.message=\nUsage: role [options]\n Options:\n --help \n --detail
schema.help.message=\nUsage: schema [options]\n Options:\n --help \n --details \n --list-all\n --list-plain\n --list-derived\n --list-virtual\n --read {SCHEMA-TYPE} {SCHEMA-KEY}\n Schema type: PLAIN / DERIVED / VIRTUAL\n --delete {SCHEMA-TYPE} {SCHEMA-KEY}\n Schema type: PLAIN / DERIVED / VIRTUAL\n
task.help.message=\nUsage: task [options]\n Options:\n --help \n --details\n --list\n Syntax: --list {TASK-TYPE} \n Task type: NOTIFICATION / PROPAGATION / PUSH / SCHEDULED / PULL\n --list-running-jobs \n --list-scheduled-jobs \n --read \n Syntax: --read {TASK-TYPE} {TASK-KEY}\n Task type: PROPAGATION / NOTIFICATION / SCHEDULED / PULL / PUSH\n --delete \n Syntax: --delete {TASK-KEY} {TASK-KEY} [...]\n --delete-all-prop\n --delete-execution \n Syntax: --delete-execution {TASK-EXEC-KEY} {TASK-EXEC-KEY} [...]\n --execute \n Syntax: --execute {TASK-KEY} {DRY-RUN}\n Dry run: true / false\n
user.help.message=\nUsage: user [options]\n Options:\n --help \n --details \n --list \n --get-user-key\n Syntax: --get-user-key {USERNAME}\n --get-username\n Syntax: --get-username {USER-KEY}\n --read-by-userkey \n Syntax: --read-by-userkey {USER-KEY} {USER-KEY} [...]\n --read-by-username\n Syntax: --read-by-username {USERNAME} {USERNAME} [...]\n --search-by-attribute \n Syntax: --search-by-attribute {REALM} {ATTR-NAME}={ATTR-VALUE}\n --search-by-role \n Syntax: --search-by-role {REALM} {ROLE-KEY}\n --search-by-resource \n Syntax: --search-by-resource {REALM} {RESOURCE-KEY}\n --delete \n Syntax: --delete {USER-KEY} {USER-KEY} [...]\n --delete-all \n Syntax: --delete-all {REALM}\n --delete-by-attribute \n Syntax: --delete-by-attribute {REALM} {ATTR-NAME}={ATTR-VALUE}\n
-workflow.help.message=\nUsage: workflow [options]\n Options:\n --help \n --export-diagram {ANY-TYPE-KIND}\n Any type kind: ANY_OBJECT / USER / GROUP\n --export-definition {ANY-TYPE-KIND}\n Any type kind: ANY_OBJECT / USER / GROUP\n
migrate.help.message=\nUsage: migrate [options]\n Options:\n --help \n --conf {SRC} {DST}\n Syncope 1.2.X content.xml SRC absolute path\n Syncope 2.0.X *Content.xml DST absolute path\n
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
----------------------------------------------------------------------
diff --git a/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java b/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
index 2b3c2ae..c752738 100644
--- a/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
+++ b/client/cli/src/test/java/org/apache/syncope/client/cli/util/CommandUtilsTest.java
@@ -49,6 +49,6 @@ public class CommandUtilsTest {
public void commands() throws Exception {
List<AbstractCommand> commands = CommandUtils.commands();
assertFalse(commands.isEmpty());
- assertEquals(21, commands.size());
+ assertEquals(20, commands.size());
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index 4ff40d2..cb866c0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -35,6 +35,7 @@ import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.annotations.Resource;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
import org.apache.syncope.client.console.init.ConsoleInitializer;
@@ -42,9 +43,6 @@ import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.pages.Dashboard;
import org.apache.syncope.client.console.pages.MustChangePassword;
import org.apache.syncope.client.console.pages.Login;
-import org.apache.syncope.client.console.resources.FilesystemResource;
-import org.apache.syncope.client.console.resources.WorkflowDefGETResource;
-import org.apache.syncope.client.console.resources.WorkflowDefPUTResource;
import org.apache.syncope.client.console.themes.AdminLTE;
import org.apache.syncope.client.lib.AnonymousAuthenticationHandler;
import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
@@ -61,6 +59,7 @@ import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDa
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.CsrfPreventionRequestCycleListener;
import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
import org.apache.wicket.request.resource.IResource;
import org.apache.wicket.request.resource.ResourceReference;
import org.apache.wicket.resource.DynamicJQueryResourceReference;
@@ -79,8 +78,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
Locale.ENGLISH, Locale.ITALIAN, new Locale("pt", "BR"), new Locale("ru"), Locale.JAPANESE
}));
- private static final String FLOWABLE_MODELER_CONTEXT = "flowable-modeler";
-
public static SyncopeConsoleApplication get() {
return (SyncopeConsoleApplication) WebApplication.get();
}
@@ -91,8 +88,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
private String anonymousKey;
- private String flowableModelerDirectory;
-
private String reconciliationReportKey;
private String scheme;
@@ -203,9 +198,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
mountPage("/login", getSignInPageClass());
- flowableModelerDirectory = props.getProperty("flowableModelerDirectory");
- Args.notNull(flowableModelerDirectory, "<flowableModelerDirectory>");
-
try {
reconciliationReportKey = props.getProperty("reconciliationReportKey");
} catch (NumberFormatException e) {
@@ -213,34 +205,24 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
}
Args.notNull(reconciliationReportKey, "<reconciliationReportKey>");
- mountResource("/" + FLOWABLE_MODELER_CONTEXT, new ResourceReference(FLOWABLE_MODELER_CONTEXT) {
+ for (Class<? extends AbstractResource> resource : lookup.getResources()) {
+ Resource annotation = resource.getAnnotation(Resource.class);
+ try {
+ AbstractResource instance = resource.getDeclaredConstructor().newInstance();
- private static final long serialVersionUID = -128426276529456602L;
+ mountResource(annotation.path(), new ResourceReference(annotation.key()) {
- @Override
- public IResource getResource() {
- return new FilesystemResource(FLOWABLE_MODELER_CONTEXT, flowableModelerDirectory);
- }
+ private static final long serialVersionUID = -128426276529456602L;
- });
- mountResource("/workflowDefGET", new ResourceReference("workflowDefGET") {
-
- private static final long serialVersionUID = -128426276529456602L;
-
- @Override
- public IResource getResource() {
- return new WorkflowDefGETResource();
- }
- });
- mountResource("/workflowDefPUT", new ResourceReference("workflowDefPUT") {
-
- private static final long serialVersionUID = -128426276529456602L;
-
- @Override
- public IResource getResource() {
- return new WorkflowDefPUTResource();
+ @Override
+ public IResource getResource() {
+ return instance;
+ }
+ });
+ } catch (Exception e) {
+ LOG.error("Could not instantiate {}", resource.getName(), e);
}
- });
+ }
// enable component path
if (getDebugSettings().isAjaxDebugModeEnabled()) {
@@ -282,10 +264,6 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
return anonymousKey;
}
- public String getFlowableModelerDirectory() {
- return flowableModelerDirectory;
- }
-
public String getReconciliationReportKey() {
return reconciliationReportKey;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java b/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java
new file mode 100644
index 0000000..ebdba59
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/annotations/Resource.java
@@ -0,0 +1,41 @@
+/*
+ * 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.client.console.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Resource {
+
+ /**
+ * @return string for {@link org.apache.wicket.request.resource.ResourceReference#ResourceReference}
+ */
+ String key();
+
+ /**
+ * @return path for{@link org.apache.wicket.protocol.http.WebApplication#mountResource}
+ */
+ String path();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
deleted file mode 100644
index c34fb00..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
+++ /dev/null
@@ -1,206 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.math.NumberUtils;
-import org.apache.commons.lang3.time.FastDateFormat;
-import org.apache.syncope.client.console.commons.MapChoiceRenderer;
-import org.apache.syncope.client.console.panels.MultilevelPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxSpinnerFieldPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDateTimeFieldPanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.list.ListView;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.LoadableDetachableModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class Approval extends Panel {
-
- private static final long serialVersionUID = -8847854414429745216L;
-
- protected static final Logger LOG = LoggerFactory.getLogger(Approval.class);
-
- public Approval(final PageReference pageRef, final WorkflowFormTO formTO) {
- super(MultilevelPanel.FIRST_LEVEL_ID);
-
- IModel<List<WorkflowFormPropertyTO>> formProps = new LoadableDetachableModel<List<WorkflowFormPropertyTO>>() {
-
- private static final long serialVersionUID = 3169142472626817508L;
-
- @Override
- protected List<WorkflowFormPropertyTO> load() {
- return formTO.getProperties();
- }
- };
-
- final ListView<WorkflowFormPropertyTO> propView = new ListView<WorkflowFormPropertyTO>("propView", formProps) {
-
- private static final long serialVersionUID = 9101744072914090143L;
-
- @Override
- @SuppressWarnings({ "unchecked", "rawtypes" })
- protected void populateItem(final ListItem<WorkflowFormPropertyTO> item) {
- final WorkflowFormPropertyTO prop = item.getModelObject();
-
- String label = StringUtils.isBlank(prop.getName()) ? prop.getId() : prop.getName();
-
- FieldPanel field;
- switch (prop.getType()) {
- case Boolean:
- field = new AjaxDropDownChoicePanel("value", label, new PropertyModel<String>(prop, "value") {
-
- private static final long serialVersionUID = -3743432456095828573L;
-
- @Override
- public String getObject() {
- return StringUtils.isBlank(prop.getValue())
- ? null
- : prop.getValue().equals("true") ? "Yes" : "No";
- }
-
- @Override
- public void setObject(final String object) {
- prop.setValue(String.valueOf(object.equalsIgnoreCase("yes")));
- }
-
- }, false).setChoices(Arrays.asList(new String[] { "Yes", "No" }));
- break;
-
- case Date:
- final FastDateFormat formatter = FastDateFormat.getInstance(prop.getDatePattern());
- field = new AjaxDateTimeFieldPanel("value", label, new PropertyModel<Date>(prop, "value") {
-
- private static final long serialVersionUID = -3743432456095828573L;
-
- @Override
- public Date getObject() {
- try {
- if (StringUtils.isBlank(prop.getValue())) {
- return null;
- } else {
- return formatter.parse(prop.getValue());
- }
- } catch (ParseException e) {
- LOG.error("Unparsable date: {}", prop.getValue(), e);
- return null;
- }
- }
-
- @Override
- public void setObject(final Date object) {
- prop.setValue(formatter.format(object));
- }
-
- }, prop.getDatePattern());
- break;
-
- case Enum:
- MapChoiceRenderer<String, String> enumCR = new MapChoiceRenderer<>(prop.getEnumValues());
-
- field = new AjaxDropDownChoicePanel(
- "value", label, new PropertyModel<String>(prop, "value"), false).
- setChoiceRenderer(enumCR).setChoices(new Model<ArrayList<String>>() {
-
- private static final long serialVersionUID = -858521070366432018L;
-
- @Override
- public ArrayList<String> getObject() {
- return new ArrayList<>(prop.getEnumValues().keySet());
- }
- });
- break;
-
- case Long:
- field = new AjaxSpinnerFieldPanel.Builder<Long>().build(
- "value",
- label,
- Long.class,
- new PropertyModel<Long>(prop, "value") {
-
- private static final long serialVersionUID = -7688359318035249200L;
-
- @Override
- public Long getObject() {
- return StringUtils.isBlank(prop.getValue())
- ? null
- : NumberUtils.toLong(prop.getValue());
- }
-
- @Override
- public void setObject(final Long object) {
- prop.setValue(String.valueOf(object));
- }
- });
- break;
-
- case String:
- default:
- field = new AjaxTextFieldPanel("value", label, new PropertyModel<>(prop, "value"), false);
- break;
- }
-
- field.setReadOnly(!prop.isWritable());
- if (prop.isRequired()) {
- field.addRequiredLabel();
- }
-
- item.add(field);
- }
- };
-
- AjaxLink<String> userDetails = new AjaxLink<String>("userDetails") {
-
- private static final long serialVersionUID = -4804368561204623354L;
-
- @Override
- public void onClick(final AjaxRequestTarget target) {
- viewDetails(target);
- }
- };
- MetaDataRoleAuthorizationStrategy.authorize(userDetails, ENABLE, StandardEntitlement.USER_READ);
-
- boolean enabled = formTO.getUserTO() != null;
- userDetails.setVisible(enabled).setEnabled(enabled);
-
- add(propView);
- add(userDetails);
- }
-
- protected abstract void viewDetails(final AjaxRequestTarget target);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
deleted file mode 100644
index ec9dbab..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
+++ /dev/null
@@ -1,63 +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.
- */
-package org.apache.syncope.client.console.approvals;
-
-import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
-import org.apache.syncope.client.console.panels.MultilevelPanel;
-import org.apache.syncope.client.console.rest.AnyTypeRestClient;
-import org.apache.syncope.client.console.wizards.AjaxWizard;
-import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
-import org.apache.syncope.common.lib.AnyOperations;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.wicket.PageReference;
-
-public class ApprovalDetails extends MultilevelPanel.SecondLevel {
-
- private static final long serialVersionUID = -8847854414429745216L;
-
- public ApprovalDetails(final PageReference pageRef, final WorkflowFormTO formTO) {
- super(MultilevelPanel.SECOND_LEVEL_ID);
-
- final UserTO newUserTO;
- final UserTO previousUserTO;
- if (formTO.getUserPatch() == null) {
- newUserTO = formTO.getUserTO();
- previousUserTO = null;
- } else if (formTO.getUserTO() == null) {
- // make it stronger by handling possible NPE
- previousUserTO = new UserTO();
- previousUserTO.setKey(formTO.getUserPatch().getKey());
- newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
- } else {
- formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
- newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
- previousUserTO = formTO.getUserTO();
- }
-
- add(new UserWizardBuilder(
- previousUserTO,
- newUserTO,
- new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
- new UserFormLayoutInfo(),
- pageRef).
- build(AjaxWizard.Mode.READONLY));
- }
-}
[12/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java
deleted file mode 100644
index d71d8c2..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUserWorkflowAdapter.java
+++ /dev/null
@@ -1,1035 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import javax.annotation.Resource;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.core.provisioning.api.PropagationByResource;
-import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.common.lib.types.WorkflowFormPropertyType;
-import org.apache.syncope.core.spring.security.AuthContextUtils;
-import org.apache.syncope.core.spring.BeanUtils;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
-import org.apache.syncope.core.persistence.api.attrvalue.validation.ParsingValidationException;
-import org.apache.syncope.core.persistence.api.dao.NotFoundException;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.flowable.spring.DomainProcessEngine;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.apache.syncope.core.workflow.api.WorkflowException;
-import org.apache.syncope.core.workflow.java.AbstractUserWorkflowAdapter;
-import org.flowable.bpmn.converter.BpmnXMLConverter;
-import org.flowable.bpmn.model.BpmnModel;
-import org.flowable.bpmn.model.FlowElement;
-import org.flowable.bpmn.model.Gateway;
-import org.flowable.bpmn.model.Process;
-import org.flowable.bpmn.model.SequenceFlow;
-import org.flowable.editor.constants.ModelDataJsonConstants;
-import org.flowable.editor.language.json.converter.BpmnJsonConverter;
-import org.flowable.common.engine.api.FlowableException;
-import org.flowable.engine.form.FormProperty;
-import org.flowable.engine.form.FormType;
-import org.flowable.engine.form.TaskFormData;
-import org.flowable.engine.history.HistoricActivityInstance;
-import org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity;
-import org.flowable.engine.repository.Deployment;
-import org.flowable.engine.repository.Model;
-import org.flowable.engine.repository.ProcessDefinition;
-import org.flowable.engine.runtime.ProcessInstance;
-import org.flowable.task.api.Task;
-import org.flowable.task.api.TaskQuery;
-import org.flowable.task.api.history.HistoricTaskInstance;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * <a href="http://www.flowable.org/">Flowable</a> based implementation.
- */
-public class FlowableUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
-
- protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
- protected static final String[] PROPERTY_IGNORE_PROPS = { "type" };
-
- public static final String WF_PROCESS_ID = "userWorkflow";
-
- public static final String USER = "user";
-
- public static final String WF_EXECUTOR = "wfExecutor";
-
- public static final String FORM_SUBMITTER = "formSubmitter";
-
- public static final String USER_TO = "userTO";
-
- public static final String ENABLED = "enabled";
-
- public static final String USER_PATCH = "userPatch";
-
- public static final String EMAIL_KIND = "emailKind";
-
- public static final String TASK = "task";
-
- public static final String TOKEN = "token";
-
- public static final String PASSWORD = "password";
-
- public static final String PROP_BY_RESOURCE = "propByResource";
-
- public static final String PROPAGATE_ENABLE = "propagateEnable";
-
- public static final String ENCRYPTED_PWD = "encryptedPwd";
-
- public static final String TASK_IS_FORM = "taskIsForm";
-
- public static final String MODEL_DATA_JSON_MODEL = "model";
-
- public static final String STORE_PASSWORD = "storePassword";
-
- public static final String EVENT = "event";
-
- @Resource(name = "adminUser")
- protected String adminUser;
-
- @Autowired
- protected DomainProcessEngine engine;
-
- @Override
- public String getPrefix() {
- return "ACT_";
- }
-
- protected void throwException(final FlowableException e, final String defaultMessage) {
- if (e.getCause() != null) {
- if (e.getCause().getCause() instanceof SyncopeClientException) {
- throw (SyncopeClientException) e.getCause().getCause();
- } else if (e.getCause().getCause() instanceof ParsingValidationException) {
- throw (ParsingValidationException) e.getCause().getCause();
- } else if (e.getCause().getCause() instanceof InvalidEntityException) {
- throw (InvalidEntityException) e.getCause().getCause();
- }
- }
-
- throw new WorkflowException(defaultMessage, e);
- }
-
- protected void updateStatus(final User user) {
- List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(user.getWorkflowId()).list();
- if (tasks.isEmpty() || tasks.size() > 1) {
- LOG.warn("While setting user status: unexpected task number ({})", tasks.size());
- } else {
- user.setStatus(tasks.get(0).getTaskDefinitionKey());
- }
- }
-
- protected String getFormTask(final User user) {
- String result = null;
-
- List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(user.getWorkflowId()).list();
- if (tasks.isEmpty() || tasks.size() > 1) {
- LOG.debug("While checking if form task: unexpected task number ({})", tasks.size());
- } else {
- try {
- TaskFormData formData = engine.getFormService().getTaskFormData(tasks.get(0).getId());
- if (formData != null && !formData.getFormProperties().isEmpty()) {
- result = tasks.get(0).getId();
- }
- } catch (FlowableException e) {
- LOG.warn("Could not get task form data", e);
- }
- }
-
- return result;
- }
-
- protected Set<String> getPerformedTasks(final User user) {
- final Set<String> result = new HashSet<>();
-
- engine.getHistoryService().createHistoricActivityInstanceQuery().executionId(user.getWorkflowId()).list().
- forEach((task) -> {
- result.add(task.getActivityId());
- });
-
- return result;
- }
-
- /**
- * Saves resources to be propagated and password for later - after form submission - propagation.
- *
- * @param user user
- * @param password password
- * @param propByRes current propagation actions against resources
- */
- protected void saveForFormSubmit(final User user, final String password, final PropagationByResource propByRes) {
- String formTaskId = getFormTask(user);
- if (formTaskId != null) {
- UserTO userTO = engine.getRuntimeService().getVariable(user.getWorkflowId(), USER_TO, UserTO.class);
- if (userTO != null) {
- userTO.setKey(user.getKey());
- userTO.setCreationDate(user.getCreationDate());
- userTO.setLastChangeDate(user.getLastChangeDate());
- if (password == null) {
- String encryptedPwd = engine.getRuntimeService().
- getVariable(user.getWorkflowId(), ENCRYPTED_PWD, String.class);
- if (encryptedPwd != null) {
- userTO.setPassword(decrypt(encryptedPwd));
- }
- } else {
- userTO.setPassword(password);
- }
-
- engine.getRuntimeService().setVariable(user.getWorkflowId(), USER_TO, userTO);
- }
-
- // SYNCOPE-238: This is needed to simplify the task query in this.getForms()
- engine.getTaskService().setVariableLocal(formTaskId, TASK_IS_FORM, Boolean.TRUE);
-
- engine.getRuntimeService().setVariable(user.getWorkflowId(), PROP_BY_RESOURCE, propByRes);
- if (propByRes != null) {
- propByRes.clear();
- }
-
- if (password != null) {
- engine.getRuntimeService().setVariable(user.getWorkflowId(), ENCRYPTED_PWD, encrypt(password));
- }
- }
- }
-
- public <T> T getVariable(final String executionId, final String variableName, final Class<T> variableClass) {
- return engine.getRuntimeService().getVariable(executionId, variableName, variableClass);
- }
-
- public void setVariable(final String executionId, final String variableName, final Object value) {
- engine.getRuntimeService().setVariable(executionId, variableName, value);
- }
-
- @Override
- protected WorkflowResult<Pair<String, Boolean>> doCreate(
- final UserTO userTO,
- final boolean disablePwdPolicyCheck,
- final Boolean enabled,
- final boolean storePassword) {
-
- Map<String, Object> variables = new HashMap<>();
- variables.put(WF_EXECUTOR, AuthContextUtils.getUsername());
- variables.put(USER_TO, userTO);
- variables.put(ENABLED, enabled);
- variables.put(STORE_PASSWORD, storePassword);
-
- ProcessInstance processInstance = null;
- try {
- processInstance = engine.getRuntimeService().startProcessInstanceByKey(WF_PROCESS_ID, variables);
- } catch (FlowableException e) {
- throwException(e, "While starting " + WF_PROCESS_ID + " instance");
- }
-
- User user = engine.getRuntimeService().getVariable(processInstance.getProcessInstanceId(), USER, User.class);
-
- Boolean updatedEnabled =
- engine.getRuntimeService().getVariable(processInstance.getProcessInstanceId(), ENABLED, Boolean.class);
- if (updatedEnabled != null) {
- user.setSuspended(!updatedEnabled);
- }
-
- // this will make UserValidator not to consider password policies at all
- if (disablePwdPolicyCheck) {
- user.removeClearPassword();
- }
-
- updateStatus(user);
- user = userDAO.save(user);
-
- Boolean propagateEnable = engine.getRuntimeService().getVariable(
- processInstance.getProcessInstanceId(), PROPAGATE_ENABLE, Boolean.class);
- if (propagateEnable == null) {
- propagateEnable = enabled;
- }
-
- PropagationByResource propByRes = new PropagationByResource();
- propByRes.set(ResourceOperation.CREATE, userDAO.findAllResourceKeys(user.getKey()));
-
- saveForFormSubmit(user, userTO.getPassword(), propByRes);
-
- Set<String> tasks = getPerformedTasks(user);
-
- return new WorkflowResult<>(Pair.of(user.getKey(), propagateEnable), propByRes, tasks);
- }
-
- protected Set<String> doExecuteTask(final User user, final String task, final Map<String, Object> moreVariables) {
- Set<String> preTasks = getPerformedTasks(user);
-
- Map<String, Object> variables = new HashMap<>();
- variables.put(WF_EXECUTOR, AuthContextUtils.getUsername());
- variables.put(TASK, task);
-
- // using BeanUtils to access all user's properties and trigger lazy loading - we are about to
- // serialize a User instance for availability within workflow tasks, and this breaks transactions
- BeanUtils.copyProperties(user, entityFactory.newEntity(User.class));
- variables.put(USER, user);
-
- if (moreVariables != null && !moreVariables.isEmpty()) {
- variables.putAll(moreVariables);
- }
-
- if (StringUtils.isBlank(user.getWorkflowId())) {
- throw new WorkflowException(new NotFoundException("Empty workflow id for " + user));
- }
-
- List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(user.getWorkflowId()).list();
- if (tasks.size() == 1) {
- try {
- engine.getTaskService().complete(tasks.get(0).getId(), variables);
- } catch (FlowableException e) {
- throwException(e, "While completing task '" + tasks.get(0).getName() + "' for " + user);
- }
- } else {
- LOG.warn("Expected a single task, found {}", tasks.size());
- }
-
- Set<String> postTasks = getPerformedTasks(user);
- postTasks.removeAll(preTasks);
- postTasks.add(task);
-
- return postTasks;
- }
-
- @Override
- protected WorkflowResult<String> doActivate(final User user, final String token) {
- Set<String> tasks = doExecuteTask(user, "activate", Collections.singletonMap(TOKEN, (Object) token));
-
- updateStatus(user);
- User updated = userDAO.save(user);
-
- return new WorkflowResult<>(updated.getKey(), null, tasks);
- }
-
- @Override
- protected WorkflowResult<Pair<UserPatch, Boolean>> doUpdate(final User user, final UserPatch userPatch) {
- Set<String> tasks = doExecuteTask(user, "update", Collections.singletonMap(USER_PATCH, (Object) userPatch));
-
- updateStatus(user);
- User updated = userDAO.save(user);
-
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
- saveForFormSubmit(
- updated, userPatch.getPassword() == null ? null : userPatch.getPassword().getValue(), propByRes);
-
- Boolean propagateEnable = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROPAGATE_ENABLE, Boolean.class);
-
- return new WorkflowResult<>(Pair.of(userPatch, propagateEnable), propByRes, tasks);
- }
-
- @Override
- public WorkflowResult<String> requestCertify(final User user) {
- String authUser = AuthContextUtils.getUsername();
- engine.getRuntimeService().setVariable(user.getWorkflowId(), FORM_SUBMITTER, authUser);
-
- 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);
- }
-
- @Override
- protected WorkflowResult<String> doReactivate(final User user) {
- Set<String> performedTasks = doExecuteTask(user, "reactivate", null);
- updateStatus(user);
-
- User updated = userDAO.save(user);
-
- return new WorkflowResult<>(updated.getKey(), null, performedTasks);
- }
-
- @Override
- protected void doRequestPasswordReset(final User user) {
- Map<String, Object> variables = new HashMap<>(2);
- variables.put(USER_TO, dataBinder.getUserTO(user, true));
- variables.put(EVENT, "requestPasswordReset");
-
- doExecuteTask(user, "requestPasswordReset", variables);
- userDAO.save(user);
- }
-
- @Override
- protected WorkflowResult<Pair<UserPatch, Boolean>> doConfirmPasswordReset(
- final User user, final String token, final String password) {
-
- Map<String, Object> variables = new HashMap<>(4);
- variables.put(TOKEN, token);
- variables.put(PASSWORD, password);
- variables.put(USER_TO, dataBinder.getUserTO(user, true));
- variables.put(EVENT, "confirmPasswordReset");
-
- Set<String> tasks = doExecuteTask(user, "confirmPasswordReset", variables);
-
- userDAO.save(user);
-
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
- UserPatch updatedPatch = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), USER_PATCH, UserPatch.class);
- Boolean propagateEnable = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROPAGATE_ENABLE, Boolean.class);
-
- return new WorkflowResult<>(Pair.of(updatedPatch, propagateEnable), propByRes, tasks);
- }
-
- @Override
- protected void doDelete(final User user) {
- doExecuteTask(user, "delete", null);
-
- PropagationByResource propByRes = new PropagationByResource();
- propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceKeys(user.getKey()));
-
- saveForFormSubmit(user, null, propByRes);
-
- if (engine.getRuntimeService().createProcessInstanceQuery().
- processInstanceId(user.getWorkflowId()).active().list().isEmpty()) {
-
- userDAO.delete(user.getKey());
-
- if (!engine.getHistoryService().createHistoricProcessInstanceQuery().
- processInstanceId(user.getWorkflowId()).list().isEmpty()) {
-
- engine.getHistoryService().deleteHistoricProcessInstance(user.getWorkflowId());
- }
- } else {
- updateStatus(user);
- userDAO.save(user);
- }
- }
-
- @Override
- public WorkflowResult<String> execute(final UserTO userTO, final String taskId) {
- User user = userDAO.authFind(userTO.getKey());
-
- Map<String, Object> variables = new HashMap<>();
- variables.put(USER_TO, userTO);
-
- Set<String> performedTasks = doExecuteTask(user, taskId, variables);
- updateStatus(user);
- User updated = userDAO.save(user);
-
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
-
- saveForFormSubmit(updated, userTO.getPassword(), propByRes);
-
- return new WorkflowResult<>(updated.getKey(), null, performedTasks);
- }
-
- protected WorkflowFormPropertyType fromFlowableFormType(final FormType flowableFormType) {
- WorkflowFormPropertyType result = WorkflowFormPropertyType.String;
-
- if ("string".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.String;
- }
- if ("long".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Long;
- }
- if ("enum".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Enum;
- }
- if ("date".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Date;
- }
- if ("boolean".equals(flowableFormType.getName())) {
- result = WorkflowFormPropertyType.Boolean;
- }
-
- return result;
- }
-
- protected WorkflowFormTO getFormTO(final Task task) {
- return getFormTO(task, engine.getFormService().getTaskFormData(task.getId()));
- }
-
- protected WorkflowFormTO getFormTO(final Task task, final TaskFormData fd) {
- WorkflowFormTO formTO =
- getFormTO(task.getProcessInstanceId(), task.getId(), fd.getFormKey(), fd.getFormProperties());
- BeanUtils.copyProperties(task, formTO);
-
- return formTO;
- }
-
- protected WorkflowFormTO getFormTO(final HistoricTaskInstance task) {
- final List<HistoricFormPropertyEntity> props = new ArrayList<>();
-
- engine.getHistoryService().createHistoricDetailQuery().taskId(task.getId()).list().stream().
- filter(historicDetail -> (historicDetail instanceof HistoricFormPropertyEntity)).
- forEachOrdered(historicDetail -> {
- props.add((HistoricFormPropertyEntity) historicDetail);
- });
-
- WorkflowFormTO formTO = getHistoricFormTO(
- task.getProcessInstanceId(), task.getId(), task.getFormKey(), props);
- BeanUtils.copyProperties(task, formTO);
-
- HistoricActivityInstance historicActivityInstance = engine.getHistoryService().
- createHistoricActivityInstanceQuery().
- executionId(task.getExecutionId()).activityType("userTask").activityName(task.getName()).singleResult();
-
- if (historicActivityInstance != null) {
- formTO.setCreateTime(historicActivityInstance.getStartTime());
- formTO.setDueDate(historicActivityInstance.getEndTime());
- }
-
- return formTO;
- }
-
- protected WorkflowFormTO getHistoricFormTO(
- final String processInstanceId,
- final String taskId,
- final String formKey,
- final List<HistoricFormPropertyEntity> props) {
-
- WorkflowFormTO formTO = new WorkflowFormTO();
-
- User user = userDAO.findByWorkflowId(processInstanceId);
- if (user == null) {
- throw new NotFoundException("User with workflow id " + processInstanceId);
- }
- formTO.setUsername(user.getUsername());
-
- formTO.setTaskId(taskId);
- formTO.setKey(formKey);
-
- formTO.setUserTO(engine.getRuntimeService().getVariable(processInstanceId, USER_TO, UserTO.class));
- formTO.setUserPatch(engine.getRuntimeService().getVariable(processInstanceId, USER_PATCH, UserPatch.class));
-
- props.stream().map(prop -> {
- WorkflowFormPropertyTO propertyTO = new WorkflowFormPropertyTO();
- propertyTO.setId(prop.getPropertyId());
- propertyTO.setName(prop.getPropertyId());
- propertyTO.setValue(prop.getPropertyValue());
- return propertyTO;
- }).forEachOrdered(propertyTO -> {
- formTO.getProperties().add(propertyTO);
- });
-
- return formTO;
- }
-
- @SuppressWarnings("unchecked")
- protected WorkflowFormTO getFormTO(
- final String processInstanceId,
- final String taskId,
- final String formKey,
- final List<FormProperty> properties) {
-
- WorkflowFormTO formTO = new WorkflowFormTO();
-
- User user = userDAO.findByWorkflowId(processInstanceId);
- if (user == null) {
- throw new NotFoundException("User with workflow id " + processInstanceId);
- }
- formTO.setUsername(user.getUsername());
-
- formTO.setTaskId(taskId);
- formTO.setKey(formKey);
-
- formTO.setUserTO(engine.getRuntimeService().getVariable(processInstanceId, USER_TO, UserTO.class));
- formTO.setUserPatch(engine.getRuntimeService().getVariable(processInstanceId, USER_PATCH, UserPatch.class));
-
- properties.stream().map(fProp -> {
- WorkflowFormPropertyTO propertyTO = new WorkflowFormPropertyTO();
- BeanUtils.copyProperties(fProp, propertyTO, PROPERTY_IGNORE_PROPS);
- propertyTO.setType(fromFlowableFormType(fProp.getType()));
- if (propertyTO.getType() == WorkflowFormPropertyType.Date) {
- propertyTO.setDatePattern((String) fProp.getType().getInformation("datePattern"));
- }
- if (propertyTO.getType() == WorkflowFormPropertyType.Enum) {
- propertyTO.getEnumValues().putAll((Map<String, String>) fProp.getType().getInformation("values"));
- }
- return propertyTO;
- }).forEachOrdered(propertyTO -> {
- formTO.getProperties().add(propertyTO);
- });
-
- return formTO;
- }
-
- @Transactional(readOnly = true)
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- Pair<Integer, List<WorkflowFormTO>> forms = null;
-
- String authUser = AuthContextUtils.getUsername();
- if (adminUser.equals(authUser)) {
- forms = getForms(engine.getTaskService().createTaskQuery().
- taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE), page, size, orderByClauses);
- } else {
- User user = userDAO.findByUsername(authUser);
- if (user == null) {
- throw new NotFoundException("Syncope User " + authUser);
- }
-
- forms = getForms(engine.getTaskService().createTaskQuery().
- taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE).
- taskCandidateOrAssigned(user.getUsername()), page, size, orderByClauses);
-
- List<String> candidateGroups = new ArrayList<>();
- userDAO.findAllGroupNames(user).forEach(group -> {
- candidateGroups.add(group);
- });
- if (!candidateGroups.isEmpty()) {
- forms = getForms(engine.getTaskService().createTaskQuery().
- taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE).
- taskCandidateGroupIn(candidateGroups), page, size, orderByClauses);
- }
- }
-
- return forms == null
- ? Pair.of(0, Collections.<WorkflowFormTO>emptyList())
- : forms;
- }
-
- protected Pair<Integer, List<WorkflowFormTO>> getForms(
- final TaskQuery query, final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- TaskQuery sortedQuery = query;
- for (OrderByClause clause : orderByClauses) {
- boolean ack = true;
- switch (clause.getField().trim()) {
- case "taskId":
- sortedQuery = sortedQuery.orderByTaskId();
- break;
-
- case "createTime":
- sortedQuery = sortedQuery.orderByTaskCreateTime();
- break;
-
- case "dueDate":
- sortedQuery = sortedQuery.orderByTaskDueDate();
- break;
-
- case "owner":
- sortedQuery = sortedQuery.orderByTaskOwner();
- break;
-
- default:
- LOG.warn("Form sort request by {}: unsupported, ignoring", clause.getField().trim());
- ack = false;
- }
- if (ack) {
- if (clause.getDirection() == OrderByClause.Direction.ASC) {
- sortedQuery = sortedQuery.asc();
- } else {
- sortedQuery = sortedQuery.desc();
- }
- }
- }
-
- List<WorkflowFormTO> result = sortedQuery.listPage(size * (page <= 0 ? 0 : page - 1), size).stream().
- map(task -> {
- if (task instanceof HistoricTaskInstance) {
- return getFormTO((HistoricTaskInstance) task);
- } else {
- return getFormTO(task);
- }
- }).collect(Collectors.toList());
-
- return Pair.of((int) query.count(), result);
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- Task task;
- try {
- task = engine.getTaskService().createTaskQuery().processInstanceId(workflowId).singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While reading form for workflow instance " + workflowId, e);
- }
-
- TaskFormData formData;
- try {
- formData = engine.getFormService().getTaskFormData(task.getId());
- } catch (FlowableException e) {
- LOG.debug("No form found for task {}", task.getId(), e);
- formData = null;
- }
-
- WorkflowFormTO result = null;
- if (formData != null && !formData.getFormProperties().isEmpty()) {
- result = getFormTO(task);
- }
-
- return result;
- }
-
- protected Pair<Task, TaskFormData> checkTask(final String taskId, final String authUser) {
- Task task;
- try {
- task = engine.getTaskService().createTaskQuery().taskId(taskId).singleResult();
- if (task == null) {
- throw new FlowableException("NULL result");
- }
- } catch (FlowableException e) {
- throw new NotFoundException("Flowable Task " + taskId, e);
- }
-
- TaskFormData formData;
- try {
- formData = engine.getFormService().getTaskFormData(task.getId());
- } catch (FlowableException e) {
- throw new NotFoundException("Form for Flowable Task " + taskId, e);
- }
-
- if (!adminUser.equals(authUser)) {
- User user = userDAO.findByUsername(authUser);
- if (user == null) {
- throw new NotFoundException("Syncope User " + authUser);
- }
- }
-
- return Pair.of(task, formData);
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- String authUser = AuthContextUtils.getUsername();
- Pair<Task, TaskFormData> checked = checkTask(taskId, authUser);
-
- if (!adminUser.equals(authUser)) {
- List<Task> tasksForUser = engine.getTaskService().createTaskQuery().taskId(taskId).taskCandidateUser(
- authUser).list();
- if (tasksForUser.isEmpty()) {
- throw new WorkflowException(
- new IllegalArgumentException(authUser + " is not candidate for task " + taskId));
- }
- }
-
- Task task;
- try {
- engine.getTaskService().setOwner(taskId, authUser);
- task = engine.getTaskService().createTaskQuery().taskId(taskId).singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While reading task " + taskId, e);
- }
-
- return getFormTO(task, checked.getValue());
- }
-
- private Map<String, String> getPropertiesForSubmit(final WorkflowFormTO form) {
- Map<String, String> props = new HashMap<>();
- form.getProperties().stream().
- filter(prop -> (prop.isWritable())).
- forEachOrdered(prop -> {
- props.put(prop.getId(), prop.getValue());
- });
-
- return Collections.unmodifiableMap(props);
- }
-
- @Override
- public WorkflowResult<UserPatch> submitForm(final WorkflowFormTO form) {
- String authUser = AuthContextUtils.getUsername();
- Pair<Task, TaskFormData> checked = checkTask(form.getTaskId(), authUser);
-
- if (!checked.getKey().getOwner().equals(authUser)) {
- throw new WorkflowException(new IllegalArgumentException("Task " + form.getTaskId() + " assigned to "
- + checked.getKey().getOwner() + " but submitted by " + authUser));
- }
-
- User user = userDAO.findByWorkflowId(checked.getKey().getProcessInstanceId());
- if (user == null) {
- throw new NotFoundException("User with workflow id " + checked.getKey().getProcessInstanceId());
- }
-
- Set<String> preTasks = getPerformedTasks(user);
- try {
- engine.getFormService().submitTaskFormData(form.getTaskId(), getPropertiesForSubmit(form));
- engine.getRuntimeService().setVariable(user.getWorkflowId(), FORM_SUBMITTER, authUser);
- } catch (FlowableException e) {
- throwException(e, "While submitting form for task " + form.getTaskId());
- }
-
- Set<String> postTasks = getPerformedTasks(user);
- postTasks.removeAll(preTasks);
- postTasks.add(form.getTaskId());
-
- updateStatus(user);
- User updated = userDAO.save(user);
-
- // see if there is any propagation to be done
- PropagationByResource propByRes = engine.getRuntimeService().getVariable(
- user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
-
- // fetch - if available - the encrypted password
- String clearPassword = null;
- String encryptedPwd = engine.getRuntimeService().getVariable(user.getWorkflowId(), ENCRYPTED_PWD, String.class);
- if (StringUtils.isNotBlank(encryptedPwd)) {
- clearPassword = decrypt(encryptedPwd);
- }
-
- // supports approval chains
- saveForFormSubmit(user, clearPassword, propByRes);
-
- UserPatch userPatch = engine.getRuntimeService().getVariable(user.getWorkflowId(), USER_PATCH, UserPatch.class);
- if (userPatch == null) {
- userPatch = new UserPatch();
- userPatch.setKey(updated.getKey());
- userPatch.setPassword(new PasswordPatch.Builder().onSyncope(true).value(clearPassword).build());
-
- if (propByRes != null) {
- userPatch.getPassword().getResources().addAll(propByRes.get(ResourceOperation.CREATE));
- }
- }
-
- return new WorkflowResult<>(userPatch, propByRes, postTasks);
- }
-
- protected void navigateAvailableTasks(final FlowElement flow, final List<String> availableTasks) {
- if (flow instanceof Gateway) {
- ((Gateway) flow).getOutgoingFlows().forEach(subflow -> navigateAvailableTasks(subflow, availableTasks));
- } else if (flow instanceof SequenceFlow) {
- availableTasks.add(((SequenceFlow) flow).getTargetRef());
- } else {
- LOG.debug("Unexpected flow found: {}", flow);
- }
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- List<String> availableTasks = new ArrayList<>();
- try {
- Task currentTask = engine.getTaskService().createTaskQuery().processInstanceId(workflowId).singleResult();
-
- Process process = engine.getRepositoryService().
- getBpmnModel(getProcessDefinitionByKey(WF_PROCESS_ID).getId()).getProcesses().get(0);
- process.getFlowElements().stream().
- filter(SequenceFlow.class::isInstance).
- map(SequenceFlow.class::cast).
- filter(sequenceFlow -> sequenceFlow.getSourceRef().equals(currentTask.getTaskDefinitionKey())).
- forEach(sequenceFlow -> {
- FlowElement target = process.getFlowElement(sequenceFlow.getTargetRef(), true);
- navigateAvailableTasks(target, availableTasks);
- });
- } catch (FlowableException e) {
- throw new WorkflowException("While reading available tasks for workflow instance " + workflowId, e);
- }
-
- return availableTasks.stream().map(input -> {
- WorkflowTaskTO workflowTaskTO = new WorkflowTaskTO();
- workflowTaskTO.setName(input);
- return workflowTaskTO;
- }).collect(Collectors.toList());
- }
-
- protected Model getModel(final ProcessDefinition procDef) {
- try {
- Model model = engine.getRepositoryService().createModelQuery().
- deploymentId(procDef.getDeploymentId()).singleResult();
- if (model == null) {
- throw new NotFoundException("Could not find Model for deployment " + procDef.getDeploymentId());
- }
- return model;
- } catch (Exception e) {
- throw new WorkflowException("While accessing process " + procDef.getKey(), e);
- }
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- try {
- return engine.getRepositoryService().createProcessDefinitionQuery().latestVersion().list().stream().
- map(procDef -> {
- WorkflowDefinitionTO defTO = new WorkflowDefinitionTO();
- defTO.setKey(procDef.getKey());
- defTO.setName(procDef.getName());
-
- try {
- defTO.setModelId(getModel(procDef).getId());
- } catch (NotFoundException e) {
- LOG.warn("No model found for definition {}, ignoring", procDef.getDeploymentId(), e);
- }
-
- defTO.setMain(WF_PROCESS_ID.equals(procDef.getKey()));
-
- return defTO;
- }).collect(Collectors.toList());
- } catch (FlowableException e) {
- throw new WorkflowException("While listing available process definitions", e);
- }
- }
-
- protected ProcessDefinition getProcessDefinitionByKey(final String key) {
- try {
- return engine.getRepositoryService().createProcessDefinitionQuery().
- processDefinitionKey(key).latestVersion().singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While accessing process " + key, e);
- }
-
- }
-
- protected ProcessDefinition getProcessDefinitionByDeploymentId(final String deploymentId) {
- try {
- return engine.getRepositoryService().createProcessDefinitionQuery().
- deploymentId(deploymentId).latestVersion().singleResult();
- } catch (FlowableException e) {
- throw new WorkflowException("While accessing deployment " + deploymentId, e);
- }
-
- }
-
- protected void exportProcessModel(final String key, final OutputStream os) {
- Model model = getModel(getProcessDefinitionByKey(key));
-
- try {
- ObjectNode modelNode = (ObjectNode) OBJECT_MAPPER.readTree(model.getMetaInfo());
- modelNode.put(ModelDataJsonConstants.MODEL_ID, model.getId());
- modelNode.replace(MODEL_DATA_JSON_MODEL,
- OBJECT_MAPPER.readTree(engine.getRepositoryService().getModelEditorSource(model.getId())));
-
- os.write(modelNode.toString().getBytes());
- } catch (IOException e) {
- LOG.error("While exporting workflow definition {}", model.getId(), e);
- }
- }
-
- protected void exportProcessResource(final String deploymentId, final String resourceName, final OutputStream os) {
- try (InputStream procDefIS = engine.getRepositoryService().getResourceAsStream(deploymentId, resourceName)) {
- IOUtils.copy(procDefIS, os);
- } catch (IOException e) {
- LOG.error("While exporting {}", resourceName, e);
- }
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- switch (format) {
- case JSON:
- exportProcessModel(key, os);
- break;
-
- case XML:
- default:
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- exportProcessResource(procDef.getDeploymentId(), procDef.getResourceName(), os);
- }
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- if (procDef == null) {
- throw new NotFoundException("Workflow process definition for " + key);
- }
- exportProcessResource(procDef.getDeploymentId(), procDef.getDiagramResourceName(), os);
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- String resourceName = procDef == null ? key + ".bpmn20.xml" : procDef.getResourceName();
- Deployment deployment;
- switch (format) {
- case JSON:
- JsonNode definitionNode;
- try {
- definitionNode = OBJECT_MAPPER.readTree(definition);
- if (definitionNode.has(MODEL_DATA_JSON_MODEL)) {
- definitionNode = definitionNode.get(MODEL_DATA_JSON_MODEL);
- }
- if (!definitionNode.has(BpmnJsonConverter.EDITOR_CHILD_SHAPES)) {
- throw new IllegalArgumentException(
- "Could not find JSON node " + BpmnJsonConverter.EDITOR_CHILD_SHAPES);
- }
-
- BpmnModel bpmnModel = new BpmnJsonConverter().convertToBpmnModel(definitionNode);
- deployment = FlowableDeployUtils.deployDefinition(
- engine,
- resourceName,
- new BpmnXMLConverter().convertToXML(bpmnModel));
- } catch (Exception e) {
- throw new WorkflowException("While creating or updating process " + key, e);
- }
- break;
-
- case XML:
- default:
- deployment = FlowableDeployUtils.deployDefinition(
- engine,
- resourceName,
- definition.getBytes());
- }
-
- procDef = getProcessDefinitionByDeploymentId(deployment.getId());
- if (!key.equals(procDef.getKey())) {
- throw new WorkflowException("Mismatching key: expected " + key + ", found " + procDef.getKey());
- }
- FlowableDeployUtils.deployModel(engine, procDef);
- }
-
- @Override
- public void deleteDefinition(final String key) {
- ProcessDefinition procDef = getProcessDefinitionByKey(key);
- if (WF_PROCESS_ID.equals(procDef.getKey())) {
- throw new WorkflowException("Cannot delete the main process " + WF_PROCESS_ID);
- }
-
- try {
- engine.getRepositoryService().deleteDeployment(procDef.getDeploymentId());
- } catch (Exception e) {
- throw new WorkflowException("While deleting " + key, e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java
deleted file mode 100644
index b6a0fa6..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableUtils.java
+++ /dev/null
@@ -1,31 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.springframework.transaction.annotation.Transactional;
-
-public class FlowableUtils {
-
- @Transactional(readOnly = true)
- public boolean isUserIngroup(final User user, final String groupName) {
- return user.getMemberships().stream().
- anyMatch(membership -> groupName != null && groupName.equals(membership.getRightEnd().getName()));
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java
deleted file mode 100644
index 81c2d88..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeEntitiesVariableType.java
+++ /dev/null
@@ -1,35 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.apache.syncope.core.persistence.api.entity.Entity;
-import org.flowable.variable.service.impl.types.SerializableType;
-
-/**
- * Flowable variable type for handling Syncope entities as Flowable variables.
- * Main purpose: avoid Flowable to handle Syncope entities as JPA entities,
- * since this can cause troubles with transactions.
- */
-public class SyncopeEntitiesVariableType extends SerializableType {
-
- @Override
- public boolean isAbleToStore(final Object value) {
- return value instanceof Entity;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java
deleted file mode 100644
index b2387e5..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeGroupQueryImpl.java
+++ /dev/null
@@ -1,89 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import org.apache.syncope.core.persistence.api.dao.GroupDAO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.flowable.idm.api.Group;
-import org.flowable.idm.engine.impl.GroupQueryImpl;
-import org.flowable.idm.engine.impl.persistence.entity.GroupEntity;
-import org.flowable.idm.engine.impl.persistence.entity.GroupEntityImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-public class SyncopeGroupQueryImpl extends GroupQueryImpl {
-
- private static final long serialVersionUID = -2595069675443343682L;
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private GroupDAO groupDAO;
-
- private List<Group> result;
-
- private Group fromSyncopeGroup(final String name) {
- GroupEntity group = new GroupEntityImpl();
- group.setId(name);
- return group;
- }
-
- private void execute() {
- if (id != null) {
- org.apache.syncope.core.persistence.api.entity.group.Group syncopeGroup = groupDAO.findByName(id);
- if (syncopeGroup == null) {
- result = Collections.emptyList();
- } else {
- result = Collections.singletonList(fromSyncopeGroup(syncopeGroup.getName()));
- }
- } else if (userId != null) {
- result = userDAO.findAllGroupNames(userDAO.findByUsername(userId)).stream().
- map(groupName -> fromSyncopeGroup(groupName)).
- collect(Collectors.toList());
- }
- }
-
- @Transactional(readOnly = true)
- @Override
- public long count() {
- checkQueryOk();
-
- this.resultType = ResultType.COUNT;
- if (result == null) {
- execute();
- }
- return result.size();
- }
-
- @Transactional(readOnly = true)
- @Override
- public List<Group> list() {
- checkQueryOk();
-
- this.resultType = ResultType.LIST;
- if (result == null) {
- execute();
- }
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java
deleted file mode 100644
index 7e0dff9..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeIdmIdentityService.java
+++ /dev/null
@@ -1,51 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.flowable.idm.api.GroupQuery;
-import org.flowable.idm.api.UserQuery;
-import org.flowable.idm.engine.impl.IdmIdentityServiceImpl;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.ConfigurableApplicationContext;
-
-public class SyncopeIdmIdentityService extends IdmIdentityServiceImpl implements ApplicationContextAware {
-
- private ConfigurableApplicationContext ctx;
-
- @Override
- public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
- this.ctx = (ConfigurableApplicationContext) ctx;
- }
-
- @Override
- public UserQuery createUserQuery() {
- return (UserQuery) ctx.getBeanFactory().
- createBean(SyncopeUserQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
- }
-
- @Override
- public GroupQuery createGroupQuery() {
- return (GroupQuery) ctx.getBeanFactory().
- createBean(SyncopeGroupQueryImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java
deleted file mode 100644
index 71a6f57..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSession.java
+++ /dev/null
@@ -1,26 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.flowable.common.engine.impl.interceptor.Session;
-
-public interface SyncopeSession extends Session {
-
- Class<?> getType();
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java
deleted file mode 100644
index f9f0550..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeSessionFactory.java
+++ /dev/null
@@ -1,46 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import org.flowable.common.engine.impl.interceptor.CommandContext;
-import org.flowable.common.engine.impl.interceptor.Session;
-import org.flowable.common.engine.impl.interceptor.SessionFactory;
-
-public class SyncopeSessionFactory implements SessionFactory {
-
- private SyncopeSession syncopeSession;
-
- @Override
- public Class<?> getSessionType() {
- return syncopeSession.getType();
- }
-
- @Override
- public Session openSession(final CommandContext cc) {
- return syncopeSession;
- }
-
- public SyncopeSession getSyncopeSession() {
- return syncopeSession;
- }
-
- public void setSyncopeSession(final SyncopeSession syncopeSession) {
- this.syncopeSession = syncopeSession;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java
deleted file mode 100644
index 6e8f0c7c7..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/SyncopeUserQueryImpl.java
+++ /dev/null
@@ -1,101 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.syncope.core.persistence.api.dao.GroupDAO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.group.Group;
-import org.apache.syncope.core.persistence.api.entity.user.UMembership;
-import org.flowable.idm.api.User;
-import org.flowable.idm.engine.impl.UserQueryImpl;
-import org.flowable.idm.engine.impl.persistence.entity.UserEntity;
-import org.flowable.idm.engine.impl.persistence.entity.UserEntityImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-public class SyncopeUserQueryImpl extends UserQueryImpl {
-
- private static final long serialVersionUID = 4403344392227706318L;
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private GroupDAO groupDAO;
-
- private List<User> result;
-
- private User fromSyncopeUser(final org.apache.syncope.core.persistence.api.entity.user.User syncopeUser) {
- UserEntity user = new UserEntityImpl();
- user.setId(syncopeUser.getUsername());
- return user;
- }
-
- private void execute() {
- if (id != null) {
- org.apache.syncope.core.persistence.api.entity.user.User user = userDAO.findByUsername(id);
- if (user == null) {
- result = Collections.<User>emptyList();
- } else if (groupId == null || userDAO.findAllGroupNames(user).contains(groupId)) {
- result = Collections.singletonList(fromSyncopeUser(user));
- }
- } else if (groupId != null) {
- Group group = groupDAO.findByName(groupId);
- if (group == null) {
- result = Collections.<User>emptyList();
- } else {
- result = new ArrayList<>();
- List<UMembership> memberships = groupDAO.findUMemberships(group);
- memberships.stream().map(membership -> fromSyncopeUser(membership.getLeftEnd())).
- filter(user -> (!result.contains(user))).
- forEachOrdered(user -> {
- result.add(user);
- });
- }
- }
- }
-
- @Transactional(readOnly = true)
- @Override
- public long count() {
- checkQueryOk();
-
- this.resultType = ResultType.COUNT;
- if (result == null) {
- execute();
- }
- return result.size();
- }
-
- @Transactional(readOnly = true)
- @Override
- public List<User> list() {
- checkQueryOk();
-
- this.resultType = ResultType.LIST;
- if (result == null) {
- execute();
- }
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java
deleted file mode 100644
index 92e9aff..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngine.java
+++ /dev/null
@@ -1,114 +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.
- */
-package org.apache.syncope.core.workflow.flowable.spring;
-
-import java.util.Collections;
-import java.util.Map;
-import javax.sql.DataSource;
-import org.apache.syncope.core.spring.security.AuthContextUtils;
-import org.flowable.engine.DynamicBpmnService;
-import org.flowable.engine.FormService;
-import org.flowable.engine.HistoryService;
-import org.flowable.engine.IdentityService;
-import org.flowable.engine.ManagementService;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.engine.ProcessEngineConfiguration;
-import org.flowable.engine.RepositoryService;
-import org.flowable.engine.RuntimeService;
-import org.flowable.engine.TaskService;
-import org.flowable.engine.impl.ProcessEngineImpl;
-
-/**
- * {@link ProcessEngine} delegating actual method invocation to the inner map of {@link ProcessEngine} instances,
- * one for each Syncope domain.
- */
-public class DomainProcessEngine implements ProcessEngine {
-
- private final Map<String, ProcessEngine> engines;
-
- public DomainProcessEngine(final Map<String, ProcessEngine> engines) {
- this.engines = Collections.synchronizedMap(engines);
- }
-
- public Map<String, ProcessEngine> getEngines() {
- return engines;
- }
-
- @Override
- public String getName() {
- return engines.get(AuthContextUtils.getDomain()).getName();
- }
-
- @Override
- public void close() {
- engines.values().forEach(engine -> {
- engine.close();
- });
- }
-
- @Override
- public RepositoryService getRepositoryService() {
- return engines.get(AuthContextUtils.getDomain()).getRepositoryService();
- }
-
- @Override
- public RuntimeService getRuntimeService() {
- return engines.get(AuthContextUtils.getDomain()).getRuntimeService();
- }
-
- @Override
- public FormService getFormService() {
- return engines.get(AuthContextUtils.getDomain()).getFormService();
- }
-
- @Override
- public TaskService getTaskService() {
- return engines.get(AuthContextUtils.getDomain()).getTaskService();
- }
-
- @Override
- public HistoryService getHistoryService() {
- return engines.get(AuthContextUtils.getDomain()).getHistoryService();
- }
-
- @Override
- public IdentityService getIdentityService() {
- return engines.get(AuthContextUtils.getDomain()).getIdentityService();
- }
-
- @Override
- public ManagementService getManagementService() {
- return engines.get(AuthContextUtils.getDomain()).getManagementService();
- }
-
- @Override
- public ProcessEngineConfiguration getProcessEngineConfiguration() {
- return engines.get(AuthContextUtils.getDomain()).getProcessEngineConfiguration();
- }
-
- @Override
- public DynamicBpmnService getDynamicBpmnService() {
- return engines.get(AuthContextUtils.getDomain()).getDynamicBpmnService();
- }
-
- public DataSource getDataSource() {
- ProcessEngineImpl engine = (ProcessEngineImpl) engines.get(AuthContextUtils.getDomain());
- return engine.getProcessEngineConfiguration().getDataSource();
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java
deleted file mode 100644
index ed6cd25..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/spring/DomainProcessEngineFactoryBean.java
+++ /dev/null
@@ -1,111 +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.
- */
-package org.apache.syncope.core.workflow.flowable.spring;
-
-import java.util.HashMap;
-import java.util.Map;
-import javax.sql.DataSource;
-import org.apache.commons.lang3.StringUtils;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.common.engine.impl.cfg.SpringBeanFactoryProxyMap;
-import org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants;
-import org.flowable.engine.impl.util.EngineServiceUtil;
-import org.flowable.idm.spring.SpringIdmEngineConfiguration;
-import org.flowable.spring.SpringExpressionManager;
-import org.flowable.spring.SpringProcessEngineConfiguration;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.FactoryBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.transaction.PlatformTransactionManager;
-
-/**
- * Spring factory for {@link DomainProcessEngine} which takes the provided {@link SpringProcessEngineConfiguration} as
- * template for each of the configured Syncope domains.
- */
-public class DomainProcessEngineFactoryBean
- implements FactoryBean<DomainProcessEngine>, DisposableBean, ApplicationContextAware {
-
- private ApplicationContext ctx;
-
- private DomainProcessEngine engine;
-
- @Override
- public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
- this.ctx = ctx;
- }
-
- @Override
- public DomainProcessEngine getObject() throws Exception {
- if (engine == null) {
- Map<String, ProcessEngine> engines = new HashMap<>();
-
- ctx.getBeansOfType(DataSource.class).forEach((key, dataSource) -> {
- if (!key.startsWith("local")) {
- String domain = StringUtils.substringBefore(key, DataSource.class.getSimpleName());
- PlatformTransactionManager transactionManager = ctx.getBean(
- domain + "TransactionManager", PlatformTransactionManager.class);
- Object entityManagerFactory = ctx.getBean(domain + "EntityManagerFactory");
-
- SpringProcessEngineConfiguration conf = ctx.getBean(SpringProcessEngineConfiguration.class);
- conf.setDataSource(dataSource);
- conf.setTransactionManager(transactionManager);
- conf.setTransactionsExternallyManaged(true);
- conf.setJpaEntityManagerFactory(entityManagerFactory);
- if (conf.getBeans() == null) {
- conf.setBeans(new SpringBeanFactoryProxyMap(ctx));
- }
- if (conf.getExpressionManager() == null) {
- conf.setExpressionManager(new SpringExpressionManager(ctx, conf.getBeans()));
- }
- if (EngineServiceUtil.getIdmEngineConfiguration(conf) == null) {
- conf.addEngineConfiguration(
- EngineConfigurationConstants.KEY_IDM_ENGINE_CONFIG,
- ctx.getBean(SpringIdmEngineConfiguration.class));
- }
-
- engines.put(domain, conf.buildProcessEngine());
- }
- });
-
- engine = new DomainProcessEngine(engines);
- }
-
- return engine;
- }
-
- @Override
- public Class<DomainProcessEngine> getObjectType() {
- return DomainProcessEngine.class;
- }
-
- @Override
- public boolean isSingleton() {
- return true;
- }
-
- @Override
- public void destroy() throws Exception {
- if (engine != null) {
- engine.close();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java
deleted file mode 100644
index b9f87ca..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AbstractFlowableServiceTask.java
+++ /dev/null
@@ -1,45 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.flowable.engine.ProcessEngine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * Abstract base class for Flowable's service tasks in Syncope, with Spring support.
- */
-@Component
-public abstract class AbstractFlowableServiceTask {
-
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractFlowableServiceTask.class);
-
- @Autowired
- protected ProcessEngine engine;
-
- @Transactional(rollbackFor = { Throwable.class })
- public void execute(final String executionId) {
- doExecute(executionId);
- }
-
- protected abstract void doExecute(final String executionId);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java
deleted file mode 100644
index 02ee77f..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/AutoActivate.java
+++ /dev/null
@@ -1,60 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.AnyOperations;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class AutoActivate extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Autowired
- private UserDAO userDAO;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- UserTO userTO = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_TO, UserTO.class);
- if (userTO != null && userTO.getKey() != null && user.getKey() != null) {
- user = userDAO.save(user);
-
- UserPatch userPatch = AnyOperations.diff(userTO, dataBinder.getUserTO(user, true), false);
- // don't mess with password, as the cleartext values was already properly saved
- userPatch.setPassword(null);
-
- dataBinder.update(user, userPatch);
-
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- }
-
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.PROPAGATE_ENABLE, Boolean.TRUE);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java
deleted file mode 100644
index be9bfec..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Create.java
+++ /dev/null
@@ -1,52 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.core.persistence.api.entity.EntityFactory;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Create extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Autowired
- private EntityFactory entityFactory;
-
- @Override
- protected void doExecute(final String executionId) {
- UserTO userTO = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_TO, UserTO.class);
- Boolean storePassword = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.STORE_PASSWORD, Boolean.class);
- // create and set workflow id
- User user = entityFactory.newEntity(User.class);
- dataBinder.create(user, userTO, storePassword == null ? true : storePassword);
- user.setWorkflowId(executionId);
-
- // report user as result
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java
deleted file mode 100644
index d4efe09..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Delete.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Delete extends AbstractFlowableServiceTask {
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
-
- // Do something with user...
- if (user != null) {
- user.checkToken("");
- }
-
- // remove user variable
- engine.getRuntimeService().removeVariable(executionId, FlowableUserWorkflowAdapter.USER);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java
deleted file mode 100644
index 08f6000..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/GenerateToken.java
+++ /dev/null
@@ -1,44 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.core.persistence.api.dao.ConfDAO;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class GenerateToken extends AbstractFlowableServiceTask {
-
- @Autowired
- private ConfDAO confDAO;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
-
- user.generateToken(
- confDAO.find("token.length", 256L).intValue(),
- confDAO.find("token.expireTime", 60L).intValue());
-
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- }
-}
[28/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java
deleted file mode 100644
index 687424e..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java
+++ /dev/null
@@ -1,65 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AuditElements;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.notification.NotificationManager;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * General-purpose notification task for usage within workflow.
- * It requires a pre-existing <tt>Notification</tt> with category <tt>CUSTOM</tt> and result <tt>SUCCESS</tt>.
- * An <tt>event</tt> workflow variable needs to be provided as well.
- */
-@Component
-public class Notify extends AbstractFlowableServiceTask {
-
- @Autowired
- private NotificationManager notificationManager;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- UserTO userTO = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_TO, UserTO.class);
- String event = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.EVENT, String.class);
-
- if (StringUtils.isNotBlank(event)) {
- notificationManager.createTasks(
- AuditElements.EventCategoryType.CUSTOM,
- null,
- null,
- event,
- AuditElements.Result.SUCCESS,
- userTO,
- null,
- user.getToken());
- } else {
- LOG.debug("Not sending any notification since no event was found");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java
deleted file mode 100644
index 017fcc6..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java
+++ /dev/null
@@ -1,71 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.core.provisioning.api.PropagationByResource;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.api.WorkflowException;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class PasswordReset extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- String token = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.TOKEN, String.class);
- String password = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.PASSWORD, String.class);
-
- if (!user.checkToken(token)) {
- throw new WorkflowException(new IllegalArgumentException("Wrong token: " + token + " for " + user));
- }
-
- user.removeToken();
-
- UserPatch userPatch = new UserPatch();
- userPatch.setKey(user.getKey());
- userPatch.setPassword(new PasswordPatch.Builder().
- onSyncope(true).
- resources(userDAO.findAllResourceKeys(user.getKey())).
- value(password).build());
-
- PropagationByResource propByRes = dataBinder.update(user, userPatch);
-
- // report updated user and propagation by resource as result
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER_PATCH, userPatch);
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.PROP_BY_RESOURCE, propByRes);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java
deleted file mode 100644
index 0052b5a..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java
+++ /dev/null
@@ -1,29 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class Reactivate extends AbstractFlowableServiceTask {
-
- @Override
- protected void doExecute(final String executionId) {
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java
deleted file mode 100644
index 6099e0c..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.syncope.core.workflow.flowable.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.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Recertify extends AbstractFlowableServiceTask {
-
- @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, FlowableUserWorkflowAdapter.USER, User.class);
- String submitter = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.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/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java
deleted file mode 100644
index 189d619..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java
+++ /dev/null
@@ -1,29 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class Suspend extends AbstractFlowableServiceTask {
-
- @Override
- protected void doExecute(final String executionId) {
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java
deleted file mode 100644
index 757d009..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java
+++ /dev/null
@@ -1,54 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.provisioning.api.PropagationByResource;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Update extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Autowired
- private UserDAO userDAO;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- UserPatch userPatch = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_PATCH, UserPatch.class);
-
- user = userDAO.save(user);
-
- PropagationByResource propByRes = dataBinder.update(user, userPatch);
-
- // report updated user and propagation by resource as result
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.PROP_BY_RESOURCE, propByRes);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml b/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml
deleted file mode 100644
index 20690f3..0000000
--- a/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml
+++ /dev/null
@@ -1,287 +0,0 @@
-<?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:flowable="http://flowable.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://www.flowable.org/processdef">
-
- <process id="userWorkflow" name="User Workflow" isExecutable="true">
- <startEvent id="theStart"/>
- <sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
- <serviceTask id="create" name="Create" flowable:expression="#{create.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow2" sourceRef="create" targetRef="activate"/>
- <scriptTask id="activate" name="Activate" scriptFormat="groovy" flowable:autoStoreVariables="false">
- <script>execution.setVariable("propagateEnable", Boolean.TRUE);</script>
- </scriptTask>
- <sequenceFlow id="flow3" sourceRef="activate" targetRef="active"/>
- <userTask id="active" name="Active"/>
- <sequenceFlow id="flow8" sourceRef="active" targetRef="activeGw"/>
- <exclusiveGateway id="activeGw"/>
- <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>
- <serviceTask id="update" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" sourceRef="update" targetRef="active"/>
- <serviceTask id="suspend" name="Suspend" flowable: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" flowable:expression="#{reactivate.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
-
- <serviceTask id="generateToken4PasswordReset" name="Generate Token" flowable:expression="#{generateToken.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" sourceRef="generateToken4PasswordReset" targetRef="notify4RequestPasswordReset"/>
- <serviceTask id="notify4RequestPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" sourceRef="notify4RequestPasswordReset" targetRef="active"/>
-
- <serviceTask id="checkToken4ConfirmPasswordReset" name="Check token, remove and update password" flowable:expression="#{passwordReset.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" sourceRef="checkToken4ConfirmPasswordReset" targetRef="notify4ConfirmPasswordReset"/>
- <serviceTask id="notify4ConfirmPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" sourceRef="notify4ConfirmPasswordReset" targetRef="active"/>
-
- <serviceTask id="delete" name="Delete" flowable:expression="#{delete.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
- <!-- Recertification tasks -->
- <userTask id="recertificationRequest" name="Recertification Request" flowable:formKey="recertify">
- <extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
- <flowable:formProperty id="approve" name="Recertify?" type="boolean" required="true"/>
- <flowable:formProperty id="rejectReason" name="Reason for not recertifying" type="string" variable="rejectReason"/>
- </extensionElements>
- </userTask>
- <serviceTask id="recertify-task" name="Recertify" flowable: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">
- <omgdc:Bounds height="35.0" width="35.0" x="540.0" y="521.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
- <omgdc:Bounds height="60.0" width="100.0" x="620.0" y="509.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
- <omgdc:Bounds height="80.0" width="100.0" x="828.0" y="500.0"></omgdc:Bounds>
- </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>
- </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>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="update" id="BPMNShape_update">
- <omgdc:Bounds height="60.0" width="100.0" x="1370.0" y="615.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
- <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="370.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspended" id="BPMNShape_suspended">
- <omgdc:Bounds height="60.0" width="100.0" x="1640.0" y="370.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
- <omgdc:Bounds height="40.0" width="40.0" x="1820.0" y="380.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="reactivate" id="BPMNShape_reactivate">
- <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="290.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="604.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="750.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="664.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="810.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
- <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="438.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recertificationRequest" id="BPMNShape_recertificationRequest">
- <omgdc:Bounds height="80.0" width="100.0" x="1370.0" y="375.0"></omgdc:Bounds>
- </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"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
- <omgdc:Bounds height="40.0" width="40.0" x="1178.0" y="475.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
- <omgdc:Bounds height="35.0" width="35.0" x="2080.0" y="451.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="575.0" y="538.0"></omgdi:waypoint>
- <omgdi:waypoint x="620.0" y="539.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
- <omgdi:waypoint x="720.0" y="539.0"></omgdi:waypoint>
- <omgdi:waypoint x="828.0" y="540.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
- <omgdi:waypoint x="928.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1030.0" y="541.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
- <omgdi:waypoint x="1130.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1400.0" y="540.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
- <omgdi:waypoint x="1420.0" y="560.0"></omgdi:waypoint>
- <omgdi:waypoint x="1420.0" y="615.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="430.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="498.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1575.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1575.0" y="604.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1785.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1785.0" y="664.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" id="BPMNEdge_sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C">
- <omgdi:waypoint x="1370.0" y="645.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="645.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
- <omgdi:waypoint x="1590.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="400.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
- <omgdi:waypoint x="1740.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1820.0" y="400.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
- <omgdi:waypoint x="1860.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1902.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1902.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1940.0" y="320.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
- <omgdi:waypoint x="1860.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="438.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
- <omgdi:waypoint x="1990.0" y="290.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="261.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="261.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="511.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" id="BPMNEdge_sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7">
- <omgdi:waypoint x="1575.0" y="685.0"></omgdi:waypoint>
- <omgdi:waypoint x="1575.0" y="750.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" id="BPMNEdge_sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F">
- <omgdi:waypoint x="1515.0" y="790.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="790.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" id="BPMNEdge_sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6">
- <omgdi:waypoint x="1785.0" y="745.0"></omgdi:waypoint>
- <omgdi:waypoint x="1785.0" y="810.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" id="BPMNEdge_sid-A37806A7-6B7B-48A2-BB37-DAE640231144">
- <omgdi:waypoint x="1725.0" y="850.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="850.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow99" id="BPMNEdge_flow99">
- <omgdi:waypoint x="2040.0" y="468.0"></omgdi:waypoint>
- <omgdi:waypoint x="2080.0" y="468.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-request-start-flow" id="BPMNEdge_recert-request-start-flow">
- <omgdi:waypoint x="1420.0" y="520.0"></omgdi:waypoint>
- <omgdi:waypoint x="1420.0" y="455.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
- <omgdi:waypoint x="1370.0" y="415.0"></omgdi:waypoint>
- <omgdi:waypoint x="1330.0" y="415.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
- <omgdi:waypoint x="1280.0" y="455.0"></omgdi:waypoint>
- <omgdi:waypoint x="1280.0" y="495.0"></omgdi:waypoint>
- <omgdi:waypoint x="1218.0" y="495.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
- <omgdi:waypoint x="1198.0" y="515.0"></omgdi:waypoint>
- <omgdi:waypoint x="1194.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1130.0" y="541.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
- <omgdi:waypoint x="1198.0" y="475.0"></omgdi:waypoint>
- <omgdi:waypoint x="1198.0" y="313.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="313.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="370.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
-</definitions>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/resources/workflow.properties b/core/workflow-flowable/src/main/resources/workflow.properties
deleted file mode 100644
index 36af01c..0000000
--- a/core/workflow-flowable/src/main/resources/workflow.properties
+++ /dev/null
@@ -1,21 +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.
-wf.directory=${conf.directory}
-historyLevel=activity
-uwfAdapter=org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter
-gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter
-awfAdapter=org.apache.syncope.core.workflow.java.DefaultAnyObjectWorkflowAdapter
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml b/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml
deleted file mode 100644
index 394a5b8..0000000
--- a/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd">
-
- <bean id="userWorkflowDef" class="org.apache.syncope.core.spring.ResourceWithFallbackLoader">
- <property name="primary" value="file:${wf.directory}/userWorkflow.bpmn20.xml"/>
- <property name="fallback" value="classpath:userWorkflow.bpmn20.xml"/>
- </bean>
-
- <bean id="flowableUtils" class="org.apache.syncope.core.workflow.flowable.FlowableUtils"/>
-
- <bean id="syncopeIdmIdentityService" class="org.apache.syncope.core.workflow.flowable.SyncopeIdmIdentityService"/>
- <bean id="syncopeIdmEngineConfiguration" class="org.flowable.idm.spring.SpringIdmEngineConfiguration">
- <property name="idmIdentityService" ref="syncopeIdmIdentityService"/>
- </bean>
- <bean id="syncopeIdmEngineConfigurator" class="org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator">
- <property name="idmEngineConfiguration" ref="syncopeIdmEngineConfiguration"/>
- </bean>
-
- <bean class="org.flowable.spring.SpringProcessEngineConfiguration" scope="prototype">
- <property name="databaseSchemaUpdate" value="true"/>
-
- <property name="jpaHandleTransaction" value="true"/>
- <property name="jpaCloseEntityManager" value="false"/>
-
- <property name="history" value="${historyLevel}"/>
-
- <property name="idmEngineConfigurator" ref="syncopeIdmEngineConfigurator"/>
- <property name="customPreVariableTypes">
- <list>
- <bean class="org.apache.syncope.core.workflow.flowable.SyncopeEntitiesVariableType"/>
- </list>
- </property>
- </bean>
-
- <bean class="org.apache.syncope.core.workflow.flowable.spring.DomainProcessEngineFactoryBean"/>
-
- <context:component-scan base-package="org.apache.syncope.core.workflow.flowable"/>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
index f502fb3..c647b6f 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
@@ -26,14 +26,12 @@ import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
import org.apache.syncope.core.provisioning.api.data.AnyObjectDataBinder;
import org.apache.syncope.core.workflow.api.AnyObjectWorkflowAdapter;
-import org.apache.syncope.core.workflow.api.AnyObjectWorkflowDefinitionAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
-public abstract class AbstractAnyObjectWorkflowAdapter
- implements AnyObjectWorkflowAdapter, AnyObjectWorkflowDefinitionAdapter {
+public abstract class AbstractAnyObjectWorkflowAdapter implements AnyObjectWorkflowAdapter {
@Autowired
protected AnyObjectDataBinder dataBinder;
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
index 153fb8a..f48749d 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
@@ -26,13 +26,12 @@ import org.apache.syncope.core.persistence.api.entity.group.Group;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
import org.apache.syncope.core.provisioning.api.data.GroupDataBinder;
import org.apache.syncope.core.workflow.api.GroupWorkflowAdapter;
-import org.apache.syncope.core.workflow.api.GroupWorkflowDefinitionAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
-public abstract class AbstractGroupWorkflowAdapter implements GroupWorkflowAdapter, GroupWorkflowDefinitionAdapter {
+public abstract class AbstractGroupWorkflowAdapter implements GroupWorkflowAdapter {
@Autowired
protected GroupDataBinder dataBinder;
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
index 3094147..45fc4f1 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.util.Base64;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.UserPatch;
@@ -29,8 +28,6 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
import org.apache.syncope.core.workflow.api.UserWorkflowAdapter;
-import org.apache.syncope.core.workflow.api.UserWorkflowDefinitionAdapter;
-import org.identityconnectors.common.security.EncryptorFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,7 +35,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
-public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter, UserWorkflowDefinitionAdapter {
+public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter {
protected static final Logger LOG = LoggerFactory.getLogger(UserWorkflowAdapter.class);
@@ -51,17 +48,6 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
@Autowired
protected EntityFactory entityFactory;
- protected String encrypt(final String clear) {
- byte[] encrypted = EncryptorFactory.getInstance().getDefaultEncryptor().encrypt(clear.getBytes());
- return Base64.getEncoder().encodeToString(encrypted);
- }
-
- protected String decrypt(final String crypted) {
- byte[] decrypted = EncryptorFactory.getInstance().getDefaultEncryptor().
- decrypt(Base64.getDecoder().decode(crypted));
- return new String(decrypted);
- }
-
@Override
public String getPrefix() {
return null;
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
index 6cd0468..b6c8d67 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
@@ -18,22 +18,12 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.AnyObjectPatch;
import org.apache.syncope.common.lib.to.AnyObjectTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
import org.apache.syncope.core.provisioning.api.PropagationByResource;
import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.apache.syncope.core.workflow.api.WorkflowException;
/**
* Simple implementation basically not involving any workflow engine.
@@ -62,62 +52,4 @@ public class DefaultAnyObjectWorkflowAdapter extends AbstractAnyObjectWorkflowAd
protected void doDelete(final AnyObject anyObject) {
anyObjectDAO.delete(anyObject);
}
-
- @Override
- public WorkflowResult<String> execute(final AnyObjectTO anyObject, final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- return Pair.of(0, Collections.<WorkflowFormTO>emptyList());
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- return null;
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public WorkflowResult<AnyObjectPatch> submitForm(final WorkflowFormTO form) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- return Collections.emptyList();
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void deleteDefinition(final String key) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
index c10a3aa..f4a9722 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
@@ -18,22 +18,12 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.GroupPatch;
import org.apache.syncope.common.lib.to.GroupTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
import org.apache.syncope.core.provisioning.api.PropagationByResource;
import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
import org.apache.syncope.core.persistence.api.entity.group.Group;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.apache.syncope.core.workflow.api.WorkflowException;
/**
* Simple implementation basically not involving any workflow engine.
@@ -62,61 +52,4 @@ public class DefaultGroupWorkflowAdapter extends AbstractGroupWorkflowAdapter {
protected void doDelete(final Group group) {
groupDAO.delete(group);
}
-
- @Override
- public WorkflowResult<String> execute(final GroupTO group, final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- return Pair.of(0, Collections.<WorkflowFormTO>emptyList());
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- return null;
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public WorkflowResult<GroupPatch> submitForm(final WorkflowFormTO form) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- return Collections.emptyList();
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void deleteDefinition(final String key) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 ebb3445..acbe859 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
@@ -18,23 +18,15 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.PasswordPatch;
import org.apache.syncope.common.lib.patch.UserPatch;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
import org.apache.syncope.core.provisioning.api.PropagationByResource;
import org.apache.syncope.common.lib.types.ResourceOperation;
import org.apache.syncope.core.persistence.api.dao.ConfDAO;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
import org.apache.syncope.core.persistence.api.entity.user.User;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
import org.apache.syncope.core.workflow.api.WorkflowException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -150,66 +142,4 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
protected void doDelete(final User user) {
userDAO.delete(user);
}
-
- @Override
- public WorkflowResult<String> execute(final UserTO userTO, final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- return Pair.of(0, Collections.<WorkflowFormTO>emptyList());
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- return null;
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public WorkflowResult<UserPatch> submitForm(final WorkflowFormTO form) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- return Collections.emptyList();
- }
-
- @Override
- public WorkflowResult<String> requestCertify(final User user) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void deleteDefinition(final String key) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/deb/console/pom.xml
----------------------------------------------------------------------
diff --git a/deb/console/pom.xml b/deb/console/pom.xml
index 0c4df9e..5ffdcd2 100644
--- a/deb/console/pom.xml
+++ b/deb/console/pom.xml
@@ -45,6 +45,11 @@ under the License.
</dependency>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-client-console</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/deb/core/pom.xml
----------------------------------------------------------------------
diff --git a/deb/core/pom.xml b/deb/core/pom.xml
index bca6640..47341d4 100644
--- a/deb/core/pom.xml
+++ b/deb/core/pom.xml
@@ -55,8 +55,8 @@ under the License.
</dependency>
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/docker/console/pom.xml
----------------------------------------------------------------------
diff --git a/docker/console/pom.xml b/docker/console/pom.xml
index 886fcaa..a7b630c 100644
--- a/docker/console/pom.xml
+++ b/docker/console/pom.xml
@@ -67,10 +67,6 @@ under the License.
<configuration>
<target>
<copy file="${basedir}/../../deb/console/target/apache-syncope-console-${project.version}.deb" todir="${project.build.directory}/classes" overwrite="true" />
-
- <copy todir="${project.build.directory}/classes/flowable-modeler">
- <fileset dir="${basedir}/../../fit/console-reference/target/flowable-modeler" />
- </copy>
</target>
</configuration>
<goals>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/docker/console/src/main/resources/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/console/src/main/resources/Dockerfile b/docker/console/src/main/resources/Dockerfile
index 9294ae5..8875218 100644
--- a/docker/console/src/main/resources/Dockerfile
+++ b/docker/console/src/main/resources/Dockerfile
@@ -23,7 +23,6 @@ RUN set -x
COPY *.deb /tmp/
COPY *.properties.template /etc/apache-syncope/
-COPY flowable-modeler/ /etc/apache-syncope/flowable-modeler/
COPY build.sh /tmp
RUN chmod 755 /tmp/build.sh && sync && /tmp/build.sh && rm /tmp/build.sh
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/docker/console/src/main/resources/console.properties.template
----------------------------------------------------------------------
diff --git a/docker/console/src/main/resources/console.properties.template b/docker/console/src/main/resources/console.properties.template
index b043aab..8789cb5 100644
--- a/docker/console/src/main/resources/console.properties.template
+++ b/docker/console/src/main/resources/console.properties.template
@@ -33,8 +33,6 @@ maxWaitTimeOnApplyChanges=30
csrf=true
-flowableModelerDirectory=/etc/apache-syncope/flowable-modeler
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/camel/persistence-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/ext/camel/persistence-jpa/pom.xml b/ext/camel/persistence-jpa/pom.xml
index 6f36570..b1cffcb 100644
--- a/ext/camel/persistence-jpa/pom.xml
+++ b/ext/camel/persistence-jpa/pom.xml
@@ -117,7 +117,7 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>sqlgenr</id>
+ <id>sqlgen</id>
<phase>process-classes</phase>
<goals>
<goal>sql</goal>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
index 020b4a2..8010544 100644
--- a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
+++ b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
@@ -44,7 +44,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for Camel routes.
*/
-@Tag(name = "CamelRoutes")
+@Tag(name = "Camel")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
----------------------------------------------------------------------
diff --git a/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java b/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
index c3f296f..a66f1d2 100644
--- a/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
+++ b/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
@@ -140,9 +140,7 @@ public class ElasticsearchUtils {
User user = ((User) any);
builder = builder.
field("username", user.getUsername()).
- field("lastLoginDate", user.getLastLoginDate()).
- field("lastRecertification", user.getLastRecertification()).
- field("lastRecertificator", user.getLastRecertificator());
+ field("lastLoginDate", user.getLastLoginDate());
List<Object> roles = userDAO.findAllRoles(user).stream().
map(r -> r.getKey()).collect(Collectors.toList());
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/pom.xml b/ext/flowable/client-console/pom.xml
new file mode 100644
index 0000000..6f8020f
--- /dev/null
+++ b/ext/flowable/client-console/pom.xml
@@ -0,0 +1,137 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>2.1.2-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable Client Console</name>
+ <description>Apache Syncope Ext: Flowable Client Console</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <flowable-modeler.directory>${project.build.directory}/classes/META-INF/resources/flowable-modeler</flowable-modeler.directory>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.client</groupId>
+ <artifactId>syncope-client-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-ui-modeler-app</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>setupFlowableModeler</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <unzip src="${settings.localRepository}/org/flowable/flowable-ui-modeler-app/${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war" dest="${flowable-modeler.directory}">
+ <patternset>
+ <include name="WEB-INF/classes/static/**" />
+ <include name="WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" />
+ </patternset>
+ </unzip>
+
+ <unzip src="${flowable-modeler.directory}/WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" dest="${flowable-modeler.directory}">
+ <patternset>
+ <include name="stencilset_bpmn.json" />
+ </patternset>
+ </unzip>
+
+ <move todir="${flowable-modeler.directory}">
+ <fileset dir="${flowable-modeler.directory}/WEB-INF/classes/static/">
+ <include name="**" />
+ </fileset>
+ </move>
+ <delete dir="${flowable-modeler.directory}/WEB-INF" />
+
+ <replace file="${flowable-modeler.directory}/index.html" token="</head>" value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>" />
+ <replace file="${flowable-modeler.directory}/index.html" token=" ng-click="backToLanding()"" value=" disabled="disabled"" />
+ <replace file="${flowable-modeler.directory}/index.html" token="<ul class="nav navbar-nav" id="main-nav"" value="<ul class="nav navbar-nav" id="main-nav" style="display: none;"" />
+ <replace file="${flowable-modeler.directory}/index.html" token="<div class="pull-right" value="<div style="display: none;" class="pull-right" />
+ <replace file="${flowable-modeler.directory}/editor-app/editor.html" token="<div class="btn-group pull-right"" value="<div style="display: none;" class="btn-group pull-right"" />
+ <replace file="${flowable-modeler.directory}/editor-app/configuration/toolbar-default-actions.js" token="$location.path('/processes');" value="window.close();" />
+
+ <copy file="${basedir}/src/main/resources/app-cfg.js" todir="${flowable-modeler.directory}/scripts" overwrite="true" />
+ <copy file="${basedir}/src/main/resources/url-config.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
+ <copy file="${basedir}/src/main/resources/toolbar.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
+ <copy file="${basedir}/src/main/resources/save-model.html" todir="${flowable-modeler.directory}/editor-app/popups" overwrite="true" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
new file mode 100644
index 0000000..3bea1a9
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
@@ -0,0 +1,206 @@
+/*
+ * 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.client.console.approvals;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.commons.lang3.time.FastDateFormat;
+import org.apache.syncope.client.console.commons.MapChoiceRenderer;
+import org.apache.syncope.client.console.panels.MultilevelPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxSpinnerFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDateTimeFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
+import org.apache.syncope.common.lib.to.UserRequestFormProperty;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class Approval extends Panel {
+
+ private static final long serialVersionUID = -8847854414429745216L;
+
+ protected static final Logger LOG = LoggerFactory.getLogger(Approval.class);
+
+ public Approval(final PageReference pageRef, final UserRequestForm formTO) {
+ super(MultilevelPanel.FIRST_LEVEL_ID);
+
+ IModel<List<UserRequestFormProperty>> formProps = new LoadableDetachableModel<List<UserRequestFormProperty>>() {
+
+ private static final long serialVersionUID = 3169142472626817508L;
+
+ @Override
+ protected List<UserRequestFormProperty> load() {
+ return formTO.getProperties();
+ }
+ };
+
+ ListView<UserRequestFormProperty> propView = new ListView<UserRequestFormProperty>("propView", formProps) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected void populateItem(final ListItem<UserRequestFormProperty> item) {
+ final UserRequestFormProperty prop = item.getModelObject();
+
+ String label = StringUtils.isBlank(prop.getName()) ? prop.getId() : prop.getName();
+
+ FieldPanel field;
+ switch (prop.getType()) {
+ case Boolean:
+ field = new AjaxDropDownChoicePanel("value", label, new PropertyModel<String>(prop, "value") {
+
+ private static final long serialVersionUID = -3743432456095828573L;
+
+ @Override
+ public String getObject() {
+ return StringUtils.isBlank(prop.getValue())
+ ? null
+ : prop.getValue().equals("true") ? "Yes" : "No";
+ }
+
+ @Override
+ public void setObject(final String object) {
+ prop.setValue(String.valueOf(object.equalsIgnoreCase("yes")));
+ }
+
+ }, false).setChoices(Arrays.asList(new String[] { "Yes", "No" }));
+ break;
+
+ case Date:
+ final FastDateFormat formatter = FastDateFormat.getInstance(prop.getDatePattern());
+ field = new AjaxDateTimeFieldPanel("value", label, new PropertyModel<Date>(prop, "value") {
+
+ private static final long serialVersionUID = -3743432456095828573L;
+
+ @Override
+ public Date getObject() {
+ try {
+ if (StringUtils.isBlank(prop.getValue())) {
+ return null;
+ } else {
+ return formatter.parse(prop.getValue());
+ }
+ } catch (ParseException e) {
+ LOG.error("Unparsable date: {}", prop.getValue(), e);
+ return null;
+ }
+ }
+
+ @Override
+ public void setObject(final Date object) {
+ prop.setValue(formatter.format(object));
+ }
+
+ }, prop.getDatePattern());
+ break;
+
+ case Enum:
+ MapChoiceRenderer<String, String> enumCR = new MapChoiceRenderer<>(prop.getEnumValues());
+
+ field = new AjaxDropDownChoicePanel(
+ "value", label, new PropertyModel<String>(prop, "value"), false).
+ setChoiceRenderer(enumCR).setChoices(new Model<ArrayList<String>>() {
+
+ private static final long serialVersionUID = -858521070366432018L;
+
+ @Override
+ public ArrayList<String> getObject() {
+ return new ArrayList<>(prop.getEnumValues().keySet());
+ }
+ });
+ break;
+
+ case Long:
+ field = new AjaxSpinnerFieldPanel.Builder<Long>().build(
+ "value",
+ label,
+ Long.class,
+ new PropertyModel<Long>(prop, "value") {
+
+ private static final long serialVersionUID = -7688359318035249200L;
+
+ @Override
+ public Long getObject() {
+ return StringUtils.isBlank(prop.getValue())
+ ? null
+ : NumberUtils.toLong(prop.getValue());
+ }
+
+ @Override
+ public void setObject(final Long object) {
+ prop.setValue(String.valueOf(object));
+ }
+ });
+ break;
+
+ case String:
+ default:
+ field = new AjaxTextFieldPanel("value", label, new PropertyModel<>(prop, "value"), false);
+ break;
+ }
+
+ field.setReadOnly(!prop.isWritable());
+ if (prop.isRequired()) {
+ field.addRequiredLabel();
+ }
+
+ item.add(field);
+ }
+ };
+
+ AjaxLink<String> userDetails = new AjaxLink<String>("userDetails") {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ viewDetails(target);
+ }
+ };
+ MetaDataRoleAuthorizationStrategy.authorize(userDetails, ENABLE, StandardEntitlement.USER_READ);
+
+ boolean enabled = formTO.getUserTO() != null;
+ userDetails.setVisible(enabled).setEnabled(enabled);
+
+ add(propView);
+ add(userDetails);
+ }
+
+ protected abstract void viewDetails(final AjaxRequestTarget target);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
new file mode 100644
index 0000000..9606824
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
@@ -0,0 +1,63 @@
+/*
+ * 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.client.console.approvals;
+
+import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
+import org.apache.syncope.client.console.panels.MultilevelPanel;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.wizards.AjaxWizard;
+import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
+import org.apache.syncope.common.lib.AnyOperations;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.wicket.PageReference;
+
+public class ApprovalDetails extends MultilevelPanel.SecondLevel {
+
+ private static final long serialVersionUID = -8847854414429745216L;
+
+ public ApprovalDetails(final PageReference pageRef, final UserRequestForm formTO) {
+ super(MultilevelPanel.SECOND_LEVEL_ID);
+
+ final UserTO newUserTO;
+ final UserTO previousUserTO;
+ if (formTO.getUserPatch() == null) {
+ newUserTO = formTO.getUserTO();
+ previousUserTO = null;
+ } else if (formTO.getUserTO() == null) {
+ // make it stronger by handling possible NPE
+ previousUserTO = new UserTO();
+ previousUserTO.setKey(formTO.getUserPatch().getKey());
+ newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
+ } else {
+ formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
+ newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
+ previousUserTO = formTO.getUserTO();
+ }
+
+ add(new UserWizardBuilder(
+ previousUserTO,
+ newUserTO,
+ new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
+ new UserFormLayoutInfo(),
+ pageRef).
+ build(AjaxWizard.Mode.READONLY));
+ }
+}
[11/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java
deleted file mode 100644
index 687424e..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java
+++ /dev/null
@@ -1,65 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AuditElements;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.notification.NotificationManager;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * General-purpose notification task for usage within workflow.
- * It requires a pre-existing <tt>Notification</tt> with category <tt>CUSTOM</tt> and result <tt>SUCCESS</tt>.
- * An <tt>event</tt> workflow variable needs to be provided as well.
- */
-@Component
-public class Notify extends AbstractFlowableServiceTask {
-
- @Autowired
- private NotificationManager notificationManager;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- UserTO userTO = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_TO, UserTO.class);
- String event = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.EVENT, String.class);
-
- if (StringUtils.isNotBlank(event)) {
- notificationManager.createTasks(
- AuditElements.EventCategoryType.CUSTOM,
- null,
- null,
- event,
- AuditElements.Result.SUCCESS,
- userTO,
- null,
- user.getToken());
- } else {
- LOG.debug("Not sending any notification since no event was found");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java
deleted file mode 100644
index 017fcc6..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/PasswordReset.java
+++ /dev/null
@@ -1,71 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.core.provisioning.api.PropagationByResource;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.api.WorkflowException;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class PasswordReset extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- String token = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.TOKEN, String.class);
- String password = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.PASSWORD, String.class);
-
- if (!user.checkToken(token)) {
- throw new WorkflowException(new IllegalArgumentException("Wrong token: " + token + " for " + user));
- }
-
- user.removeToken();
-
- UserPatch userPatch = new UserPatch();
- userPatch.setKey(user.getKey());
- userPatch.setPassword(new PasswordPatch.Builder().
- onSyncope(true).
- resources(userDAO.findAllResourceKeys(user.getKey())).
- value(password).build());
-
- PropagationByResource propByRes = dataBinder.update(user, userPatch);
-
- // report updated user and propagation by resource as result
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER_PATCH, userPatch);
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.PROP_BY_RESOURCE, propByRes);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java
deleted file mode 100644
index 0052b5a..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Reactivate.java
+++ /dev/null
@@ -1,29 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class Reactivate extends AbstractFlowableServiceTask {
-
- @Override
- protected void doExecute(final String executionId) {
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java
deleted file mode 100644
index 6099e0c..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Recertify.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.syncope.core.workflow.flowable.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.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Recertify extends AbstractFlowableServiceTask {
-
- @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, FlowableUserWorkflowAdapter.USER, User.class);
- String submitter = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.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/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java
deleted file mode 100644
index 189d619..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Suspend.java
+++ /dev/null
@@ -1,29 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class Suspend extends AbstractFlowableServiceTask {
-
- @Override
- protected void doExecute(final String executionId) {
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java
deleted file mode 100644
index 757d009..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Update.java
+++ /dev/null
@@ -1,54 +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.
- */
-package org.apache.syncope.core.workflow.flowable.task;
-
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.provisioning.api.PropagationByResource;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
-import org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Update extends AbstractFlowableServiceTask {
-
- @Autowired
- private UserDataBinder dataBinder;
-
- @Autowired
- private UserDAO userDAO;
-
- @Override
- protected void doExecute(final String executionId) {
- User user = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER, User.class);
- UserPatch userPatch = engine.getRuntimeService().
- getVariable(executionId, FlowableUserWorkflowAdapter.USER_PATCH, UserPatch.class);
-
- user = userDAO.save(user);
-
- PropagationByResource propByRes = dataBinder.update(user, userPatch);
-
- // report updated user and propagation by resource as result
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.USER, user);
- engine.getRuntimeService().setVariable(executionId, FlowableUserWorkflowAdapter.PROP_BY_RESOURCE, propByRes);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml b/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml
deleted file mode 100644
index 20690f3..0000000
--- a/core/workflow-flowable/src/main/resources/userWorkflow.bpmn20.xml
+++ /dev/null
@@ -1,287 +0,0 @@
-<?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:flowable="http://flowable.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://www.flowable.org/processdef">
-
- <process id="userWorkflow" name="User Workflow" isExecutable="true">
- <startEvent id="theStart"/>
- <sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
- <serviceTask id="create" name="Create" flowable:expression="#{create.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow2" sourceRef="create" targetRef="activate"/>
- <scriptTask id="activate" name="Activate" scriptFormat="groovy" flowable:autoStoreVariables="false">
- <script>execution.setVariable("propagateEnable", Boolean.TRUE);</script>
- </scriptTask>
- <sequenceFlow id="flow3" sourceRef="activate" targetRef="active"/>
- <userTask id="active" name="Active"/>
- <sequenceFlow id="flow8" sourceRef="active" targetRef="activeGw"/>
- <exclusiveGateway id="activeGw"/>
- <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>
- <serviceTask id="update" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" sourceRef="update" targetRef="active"/>
- <serviceTask id="suspend" name="Suspend" flowable: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" flowable:expression="#{reactivate.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
-
- <serviceTask id="generateToken4PasswordReset" name="Generate Token" flowable:expression="#{generateToken.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" sourceRef="generateToken4PasswordReset" targetRef="notify4RequestPasswordReset"/>
- <serviceTask id="notify4RequestPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" sourceRef="notify4RequestPasswordReset" targetRef="active"/>
-
- <serviceTask id="checkToken4ConfirmPasswordReset" name="Check token, remove and update password" flowable:expression="#{passwordReset.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" sourceRef="checkToken4ConfirmPasswordReset" targetRef="notify4ConfirmPasswordReset"/>
- <serviceTask id="notify4ConfirmPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" sourceRef="notify4ConfirmPasswordReset" targetRef="active"/>
-
- <serviceTask id="delete" name="Delete" flowable:expression="#{delete.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
- <!-- Recertification tasks -->
- <userTask id="recertificationRequest" name="Recertification Request" flowable:formKey="recertify">
- <extensionElements>
- <flowable:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
- <flowable:formProperty id="approve" name="Recertify?" type="boolean" required="true"/>
- <flowable:formProperty id="rejectReason" name="Reason for not recertifying" type="string" variable="rejectReason"/>
- </extensionElements>
- </userTask>
- <serviceTask id="recertify-task" name="Recertify" flowable: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">
- <omgdc:Bounds height="35.0" width="35.0" x="540.0" y="521.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
- <omgdc:Bounds height="60.0" width="100.0" x="620.0" y="509.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
- <omgdc:Bounds height="80.0" width="100.0" x="828.0" y="500.0"></omgdc:Bounds>
- </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>
- </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>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="update" id="BPMNShape_update">
- <omgdc:Bounds height="60.0" width="100.0" x="1370.0" y="615.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
- <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="370.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspended" id="BPMNShape_suspended">
- <omgdc:Bounds height="60.0" width="100.0" x="1640.0" y="370.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
- <omgdc:Bounds height="40.0" width="40.0" x="1820.0" y="380.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="reactivate" id="BPMNShape_reactivate">
- <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="290.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="604.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="750.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="664.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
- <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="810.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
- <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="438.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recertificationRequest" id="BPMNShape_recertificationRequest">
- <omgdc:Bounds height="80.0" width="100.0" x="1370.0" y="375.0"></omgdc:Bounds>
- </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"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="recert-condition" id="BPMNShape_recert-condition">
- <omgdc:Bounds height="40.0" width="40.0" x="1178.0" y="475.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
- <omgdc:Bounds height="35.0" width="35.0" x="2080.0" y="451.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="575.0" y="538.0"></omgdi:waypoint>
- <omgdi:waypoint x="620.0" y="539.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
- <omgdi:waypoint x="720.0" y="539.0"></omgdi:waypoint>
- <omgdi:waypoint x="828.0" y="540.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
- <omgdi:waypoint x="928.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1030.0" y="541.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
- <omgdi:waypoint x="1130.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1400.0" y="540.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
- <omgdi:waypoint x="1420.0" y="560.0"></omgdi:waypoint>
- <omgdi:waypoint x="1420.0" y="615.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="430.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="498.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1575.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1575.0" y="604.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
- <omgdi:waypoint x="1440.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1785.0" y="540.0"></omgdi:waypoint>
- <omgdi:waypoint x="1785.0" y="664.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" id="BPMNEdge_sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C">
- <omgdi:waypoint x="1370.0" y="645.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="645.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
- <omgdi:waypoint x="1590.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1640.0" y="400.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
- <omgdi:waypoint x="1740.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1820.0" y="400.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
- <omgdi:waypoint x="1860.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1902.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1902.0" y="320.0"></omgdi:waypoint>
- <omgdi:waypoint x="1940.0" y="320.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
- <omgdi:waypoint x="1860.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="400.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="438.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
- <omgdi:waypoint x="1990.0" y="290.0"></omgdi:waypoint>
- <omgdi:waypoint x="1990.0" y="261.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="261.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="511.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" id="BPMNEdge_sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7">
- <omgdi:waypoint x="1575.0" y="685.0"></omgdi:waypoint>
- <omgdi:waypoint x="1575.0" y="750.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" id="BPMNEdge_sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F">
- <omgdi:waypoint x="1515.0" y="790.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="790.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" id="BPMNEdge_sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6">
- <omgdi:waypoint x="1785.0" y="745.0"></omgdi:waypoint>
- <omgdi:waypoint x="1785.0" y="810.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" id="BPMNEdge_sid-A37806A7-6B7B-48A2-BB37-DAE640231144">
- <omgdi:waypoint x="1725.0" y="850.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="850.0"></omgdi:waypoint>
- <omgdi:waypoint x="1080.0" y="571.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow99" id="BPMNEdge_flow99">
- <omgdi:waypoint x="2040.0" y="468.0"></omgdi:waypoint>
- <omgdi:waypoint x="2080.0" y="468.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-request-start-flow" id="BPMNEdge_recert-request-start-flow">
- <omgdi:waypoint x="1420.0" y="520.0"></omgdi:waypoint>
- <omgdi:waypoint x="1420.0" y="455.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow1" id="BPMNEdge_recert-flow1">
- <omgdi:waypoint x="1370.0" y="415.0"></omgdi:waypoint>
- <omgdi:waypoint x="1330.0" y="415.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-flow2" id="BPMNEdge_recert-flow2">
- <omgdi:waypoint x="1280.0" y="455.0"></omgdi:waypoint>
- <omgdi:waypoint x="1280.0" y="495.0"></omgdi:waypoint>
- <omgdi:waypoint x="1218.0" y="495.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-approved-flow" id="BPMNEdge_recert-approved-flow">
- <omgdi:waypoint x="1198.0" y="515.0"></omgdi:waypoint>
- <omgdi:waypoint x="1194.0" y="541.0"></omgdi:waypoint>
- <omgdi:waypoint x="1130.0" y="541.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="recert-denied-flow" id="BPMNEdge_recert-denied-flow">
- <omgdi:waypoint x="1198.0" y="475.0"></omgdi:waypoint>
- <omgdi:waypoint x="1198.0" y="313.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="313.0"></omgdi:waypoint>
- <omgdi:waypoint x="1540.0" y="370.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
-</definitions>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/resources/workflow.properties b/core/workflow-flowable/src/main/resources/workflow.properties
deleted file mode 100644
index 36af01c..0000000
--- a/core/workflow-flowable/src/main/resources/workflow.properties
+++ /dev/null
@@ -1,21 +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.
-wf.directory=${conf.directory}
-historyLevel=activity
-uwfAdapter=org.apache.syncope.core.workflow.flowable.FlowableUserWorkflowAdapter
-gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter
-awfAdapter=org.apache.syncope.core.workflow.java.DefaultAnyObjectWorkflowAdapter
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml b/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml
deleted file mode 100644
index 394a5b8..0000000
--- a/core/workflow-flowable/src/main/resources/workflowFlowableContext.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd">
-
- <bean id="userWorkflowDef" class="org.apache.syncope.core.spring.ResourceWithFallbackLoader">
- <property name="primary" value="file:${wf.directory}/userWorkflow.bpmn20.xml"/>
- <property name="fallback" value="classpath:userWorkflow.bpmn20.xml"/>
- </bean>
-
- <bean id="flowableUtils" class="org.apache.syncope.core.workflow.flowable.FlowableUtils"/>
-
- <bean id="syncopeIdmIdentityService" class="org.apache.syncope.core.workflow.flowable.SyncopeIdmIdentityService"/>
- <bean id="syncopeIdmEngineConfiguration" class="org.flowable.idm.spring.SpringIdmEngineConfiguration">
- <property name="idmIdentityService" ref="syncopeIdmIdentityService"/>
- </bean>
- <bean id="syncopeIdmEngineConfigurator" class="org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator">
- <property name="idmEngineConfiguration" ref="syncopeIdmEngineConfiguration"/>
- </bean>
-
- <bean class="org.flowable.spring.SpringProcessEngineConfiguration" scope="prototype">
- <property name="databaseSchemaUpdate" value="true"/>
-
- <property name="jpaHandleTransaction" value="true"/>
- <property name="jpaCloseEntityManager" value="false"/>
-
- <property name="history" value="${historyLevel}"/>
-
- <property name="idmEngineConfigurator" ref="syncopeIdmEngineConfigurator"/>
- <property name="customPreVariableTypes">
- <list>
- <bean class="org.apache.syncope.core.workflow.flowable.SyncopeEntitiesVariableType"/>
- </list>
- </property>
- </bean>
-
- <bean class="org.apache.syncope.core.workflow.flowable.spring.DomainProcessEngineFactoryBean"/>
-
- <context:component-scan base-package="org.apache.syncope.core.workflow.flowable"/>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
index f502fb3..c647b6f 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
@@ -26,14 +26,12 @@ import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
import org.apache.syncope.core.provisioning.api.data.AnyObjectDataBinder;
import org.apache.syncope.core.workflow.api.AnyObjectWorkflowAdapter;
-import org.apache.syncope.core.workflow.api.AnyObjectWorkflowDefinitionAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
-public abstract class AbstractAnyObjectWorkflowAdapter
- implements AnyObjectWorkflowAdapter, AnyObjectWorkflowDefinitionAdapter {
+public abstract class AbstractAnyObjectWorkflowAdapter implements AnyObjectWorkflowAdapter {
@Autowired
protected AnyObjectDataBinder dataBinder;
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
index 153fb8a..f48749d 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
@@ -26,13 +26,12 @@ import org.apache.syncope.core.persistence.api.entity.group.Group;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
import org.apache.syncope.core.provisioning.api.data.GroupDataBinder;
import org.apache.syncope.core.workflow.api.GroupWorkflowAdapter;
-import org.apache.syncope.core.workflow.api.GroupWorkflowDefinitionAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
-public abstract class AbstractGroupWorkflowAdapter implements GroupWorkflowAdapter, GroupWorkflowDefinitionAdapter {
+public abstract class AbstractGroupWorkflowAdapter implements GroupWorkflowAdapter {
@Autowired
protected GroupDataBinder dataBinder;
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
index 3094147..45fc4f1 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.util.Base64;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.UserPatch;
@@ -29,8 +28,6 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
import org.apache.syncope.core.workflow.api.UserWorkflowAdapter;
-import org.apache.syncope.core.workflow.api.UserWorkflowDefinitionAdapter;
-import org.identityconnectors.common.security.EncryptorFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,7 +35,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Throwable.class })
-public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter, UserWorkflowDefinitionAdapter {
+public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter {
protected static final Logger LOG = LoggerFactory.getLogger(UserWorkflowAdapter.class);
@@ -51,17 +48,6 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
@Autowired
protected EntityFactory entityFactory;
- protected String encrypt(final String clear) {
- byte[] encrypted = EncryptorFactory.getInstance().getDefaultEncryptor().encrypt(clear.getBytes());
- return Base64.getEncoder().encodeToString(encrypted);
- }
-
- protected String decrypt(final String crypted) {
- byte[] decrypted = EncryptorFactory.getInstance().getDefaultEncryptor().
- decrypt(Base64.getDecoder().decode(crypted));
- return new String(decrypted);
- }
-
@Override
public String getPrefix() {
return null;
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
index 6cd0468..b6c8d67 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
@@ -18,22 +18,12 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.AnyObjectPatch;
import org.apache.syncope.common.lib.to.AnyObjectTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
import org.apache.syncope.core.provisioning.api.PropagationByResource;
import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.apache.syncope.core.workflow.api.WorkflowException;
/**
* Simple implementation basically not involving any workflow engine.
@@ -62,62 +52,4 @@ public class DefaultAnyObjectWorkflowAdapter extends AbstractAnyObjectWorkflowAd
protected void doDelete(final AnyObject anyObject) {
anyObjectDAO.delete(anyObject);
}
-
- @Override
- public WorkflowResult<String> execute(final AnyObjectTO anyObject, final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- return Pair.of(0, Collections.<WorkflowFormTO>emptyList());
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- return null;
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public WorkflowResult<AnyObjectPatch> submitForm(final WorkflowFormTO form) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- return Collections.emptyList();
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void deleteDefinition(final String key) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
index c10a3aa..f4a9722 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
@@ -18,22 +18,12 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.GroupPatch;
import org.apache.syncope.common.lib.to.GroupTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
import org.apache.syncope.core.provisioning.api.PropagationByResource;
import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
import org.apache.syncope.core.persistence.api.entity.group.Group;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.apache.syncope.core.workflow.api.WorkflowException;
/**
* Simple implementation basically not involving any workflow engine.
@@ -62,61 +52,4 @@ public class DefaultGroupWorkflowAdapter extends AbstractGroupWorkflowAdapter {
protected void doDelete(final Group group) {
groupDAO.delete(group);
}
-
- @Override
- public WorkflowResult<String> execute(final GroupTO group, final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- return Pair.of(0, Collections.<WorkflowFormTO>emptyList());
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- return null;
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public WorkflowResult<GroupPatch> submitForm(final WorkflowFormTO form) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- return Collections.emptyList();
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void deleteDefinition(final String key) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 ebb3445..acbe859 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
@@ -18,23 +18,15 @@
*/
package org.apache.syncope.core.workflow.java;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.patch.PasswordPatch;
import org.apache.syncope.common.lib.patch.UserPatch;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
import org.apache.syncope.core.provisioning.api.PropagationByResource;
import org.apache.syncope.common.lib.types.ResourceOperation;
import org.apache.syncope.core.persistence.api.dao.ConfDAO;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
import org.apache.syncope.core.persistence.api.entity.user.User;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
import org.apache.syncope.core.workflow.api.WorkflowException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -150,66 +142,4 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
protected void doDelete(final User user) {
userDAO.delete(user);
}
-
- @Override
- public WorkflowResult<String> execute(final UserTO userTO, final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public Pair<Integer, List<WorkflowFormTO>> getForms(
- final int page, final int size, final List<OrderByClause> orderByClauses) {
-
- return Pair.of(0, Collections.<WorkflowFormTO>emptyList());
- }
-
- @Override
- public WorkflowFormTO getForm(final String workflowId) {
- return null;
- }
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public WorkflowResult<UserPatch> submitForm(final WorkflowFormTO form) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String workflowId) {
- return Collections.emptyList();
- }
-
- @Override
- public WorkflowResult<String> requestCertify(final User user) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public List<WorkflowDefinitionTO> getDefinitions() {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDefinition(final String key, final WorkflowDefinitionFormat format, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void exportDiagram(final String key, final OutputStream os) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void importDefinition(final String key, final WorkflowDefinitionFormat format, final String definition) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
-
- @Override
- public void deleteDefinition(final String key) {
- throw new WorkflowException(new UnsupportedOperationException("Not supported."));
- }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/deb/console/pom.xml
----------------------------------------------------------------------
diff --git a/deb/console/pom.xml b/deb/console/pom.xml
index c895bde..adef93c 100644
--- a/deb/console/pom.xml
+++ b/deb/console/pom.xml
@@ -45,6 +45,11 @@ under the License.
</dependency>
<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-client-console</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/deb/core/pom.xml
----------------------------------------------------------------------
diff --git a/deb/core/pom.xml b/deb/core/pom.xml
index dde4170..910cc30 100644
--- a/deb/core/pom.xml
+++ b/deb/core/pom.xml
@@ -55,8 +55,8 @@ under the License.
</dependency>
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/docker/console/pom.xml
----------------------------------------------------------------------
diff --git a/docker/console/pom.xml b/docker/console/pom.xml
index 45d64a8..211e5af 100644
--- a/docker/console/pom.xml
+++ b/docker/console/pom.xml
@@ -67,10 +67,6 @@ under the License.
<configuration>
<target>
<copy file="${basedir}/../../deb/console/target/apache-syncope-console-${project.version}.deb" todir="${project.build.directory}/classes" overwrite="true" />
-
- <copy todir="${project.build.directory}/classes/flowable-modeler">
- <fileset dir="${basedir}/../../fit/console-reference/target/flowable-modeler" />
- </copy>
</target>
</configuration>
<goals>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/docker/console/src/main/resources/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/console/src/main/resources/Dockerfile b/docker/console/src/main/resources/Dockerfile
index 9294ae5..8875218 100644
--- a/docker/console/src/main/resources/Dockerfile
+++ b/docker/console/src/main/resources/Dockerfile
@@ -23,7 +23,6 @@ RUN set -x
COPY *.deb /tmp/
COPY *.properties.template /etc/apache-syncope/
-COPY flowable-modeler/ /etc/apache-syncope/flowable-modeler/
COPY build.sh /tmp
RUN chmod 755 /tmp/build.sh && sync && /tmp/build.sh && rm /tmp/build.sh
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/docker/console/src/main/resources/console.properties.template
----------------------------------------------------------------------
diff --git a/docker/console/src/main/resources/console.properties.template b/docker/console/src/main/resources/console.properties.template
index b043aab..8789cb5 100644
--- a/docker/console/src/main/resources/console.properties.template
+++ b/docker/console/src/main/resources/console.properties.template
@@ -33,8 +33,6 @@ maxWaitTimeOnApplyChanges=30
csrf=true
-flowableModelerDirectory=/etc/apache-syncope/flowable-modeler
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/camel/persistence-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/ext/camel/persistence-jpa/pom.xml b/ext/camel/persistence-jpa/pom.xml
index 87d3923..33a1efc 100644
--- a/ext/camel/persistence-jpa/pom.xml
+++ b/ext/camel/persistence-jpa/pom.xml
@@ -117,7 +117,7 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>sqlgenr</id>
+ <id>sqlgen</id>
<phase>process-classes</phase>
<goals>
<goal>sql</goal>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
index 020b4a2..8010544 100644
--- a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
+++ b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
@@ -44,7 +44,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for Camel routes.
*/
-@Tag(name = "CamelRoutes")
+@Tag(name = "Camel")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
----------------------------------------------------------------------
diff --git a/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java b/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
index c3f296f..a66f1d2 100644
--- a/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
+++ b/ext/elasticsearch/client-elasticsearch/src/main/java/org/apache/syncope/ext/elasticsearch/client/ElasticsearchUtils.java
@@ -140,9 +140,7 @@ public class ElasticsearchUtils {
User user = ((User) any);
builder = builder.
field("username", user.getUsername()).
- field("lastLoginDate", user.getLastLoginDate()).
- field("lastRecertification", user.getLastRecertification()).
- field("lastRecertificator", user.getLastRecertificator());
+ field("lastLoginDate", user.getLastLoginDate());
List<Object> roles = userDAO.findAllRoles(user).stream().
map(r -> r.getKey()).collect(Collectors.toList());
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/pom.xml b/ext/flowable/client-console/pom.xml
new file mode 100644
index 0000000..ef2e989
--- /dev/null
+++ b/ext/flowable/client-console/pom.xml
@@ -0,0 +1,137 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable Client Console</name>
+ <description>Apache Syncope Ext: Flowable Client Console</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <flowable-modeler.directory>${project.build.directory}/classes/META-INF/resources/flowable-modeler</flowable-modeler.directory>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.client</groupId>
+ <artifactId>syncope-client-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-ui-modeler-app</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>setupFlowableModeler</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <unzip src="${settings.localRepository}/org/flowable/flowable-ui-modeler-app/${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war" dest="${flowable-modeler.directory}">
+ <patternset>
+ <include name="WEB-INF/classes/static/**" />
+ <include name="WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" />
+ </patternset>
+ </unzip>
+
+ <unzip src="${flowable-modeler.directory}/WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar" dest="${flowable-modeler.directory}">
+ <patternset>
+ <include name="stencilset_bpmn.json" />
+ </patternset>
+ </unzip>
+
+ <move todir="${flowable-modeler.directory}">
+ <fileset dir="${flowable-modeler.directory}/WEB-INF/classes/static/">
+ <include name="**" />
+ </fileset>
+ </move>
+ <delete dir="${flowable-modeler.directory}/WEB-INF" />
+
+ <replace file="${flowable-modeler.directory}/index.html" token="</head>" value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>" />
+ <replace file="${flowable-modeler.directory}/index.html" token=" ng-click="backToLanding()"" value=" disabled="disabled"" />
+ <replace file="${flowable-modeler.directory}/index.html" token="<ul class="nav navbar-nav" id="main-nav"" value="<ul class="nav navbar-nav" id="main-nav" style="display: none;"" />
+ <replace file="${flowable-modeler.directory}/index.html" token="<div class="pull-right" value="<div style="display: none;" class="pull-right" />
+ <replace file="${flowable-modeler.directory}/editor-app/editor.html" token="<div class="btn-group pull-right"" value="<div style="display: none;" class="btn-group pull-right"" />
+ <replace file="${flowable-modeler.directory}/editor-app/configuration/toolbar-default-actions.js" token="$location.path('/processes');" value="window.close();" />
+
+ <copy file="${basedir}/src/main/resources/app-cfg.js" todir="${flowable-modeler.directory}/scripts" overwrite="true" />
+ <copy file="${basedir}/src/main/resources/url-config.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
+ <copy file="${basedir}/src/main/resources/toolbar.js" todir="${flowable-modeler.directory}/editor-app/configuration" overwrite="true" />
+ <copy file="${basedir}/src/main/resources/save-model.html" todir="${flowable-modeler.directory}/editor-app/popups" overwrite="true" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
new file mode 100644
index 0000000..3bea1a9
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/Approval.java
@@ -0,0 +1,206 @@
+/*
+ * 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.client.console.approvals;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.commons.lang3.time.FastDateFormat;
+import org.apache.syncope.client.console.commons.MapChoiceRenderer;
+import org.apache.syncope.client.console.panels.MultilevelPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxSpinnerFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDateTimeFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
+import org.apache.syncope.common.lib.to.UserRequestFormProperty;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class Approval extends Panel {
+
+ private static final long serialVersionUID = -8847854414429745216L;
+
+ protected static final Logger LOG = LoggerFactory.getLogger(Approval.class);
+
+ public Approval(final PageReference pageRef, final UserRequestForm formTO) {
+ super(MultilevelPanel.FIRST_LEVEL_ID);
+
+ IModel<List<UserRequestFormProperty>> formProps = new LoadableDetachableModel<List<UserRequestFormProperty>>() {
+
+ private static final long serialVersionUID = 3169142472626817508L;
+
+ @Override
+ protected List<UserRequestFormProperty> load() {
+ return formTO.getProperties();
+ }
+ };
+
+ ListView<UserRequestFormProperty> propView = new ListView<UserRequestFormProperty>("propView", formProps) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected void populateItem(final ListItem<UserRequestFormProperty> item) {
+ final UserRequestFormProperty prop = item.getModelObject();
+
+ String label = StringUtils.isBlank(prop.getName()) ? prop.getId() : prop.getName();
+
+ FieldPanel field;
+ switch (prop.getType()) {
+ case Boolean:
+ field = new AjaxDropDownChoicePanel("value", label, new PropertyModel<String>(prop, "value") {
+
+ private static final long serialVersionUID = -3743432456095828573L;
+
+ @Override
+ public String getObject() {
+ return StringUtils.isBlank(prop.getValue())
+ ? null
+ : prop.getValue().equals("true") ? "Yes" : "No";
+ }
+
+ @Override
+ public void setObject(final String object) {
+ prop.setValue(String.valueOf(object.equalsIgnoreCase("yes")));
+ }
+
+ }, false).setChoices(Arrays.asList(new String[] { "Yes", "No" }));
+ break;
+
+ case Date:
+ final FastDateFormat formatter = FastDateFormat.getInstance(prop.getDatePattern());
+ field = new AjaxDateTimeFieldPanel("value", label, new PropertyModel<Date>(prop, "value") {
+
+ private static final long serialVersionUID = -3743432456095828573L;
+
+ @Override
+ public Date getObject() {
+ try {
+ if (StringUtils.isBlank(prop.getValue())) {
+ return null;
+ } else {
+ return formatter.parse(prop.getValue());
+ }
+ } catch (ParseException e) {
+ LOG.error("Unparsable date: {}", prop.getValue(), e);
+ return null;
+ }
+ }
+
+ @Override
+ public void setObject(final Date object) {
+ prop.setValue(formatter.format(object));
+ }
+
+ }, prop.getDatePattern());
+ break;
+
+ case Enum:
+ MapChoiceRenderer<String, String> enumCR = new MapChoiceRenderer<>(prop.getEnumValues());
+
+ field = new AjaxDropDownChoicePanel(
+ "value", label, new PropertyModel<String>(prop, "value"), false).
+ setChoiceRenderer(enumCR).setChoices(new Model<ArrayList<String>>() {
+
+ private static final long serialVersionUID = -858521070366432018L;
+
+ @Override
+ public ArrayList<String> getObject() {
+ return new ArrayList<>(prop.getEnumValues().keySet());
+ }
+ });
+ break;
+
+ case Long:
+ field = new AjaxSpinnerFieldPanel.Builder<Long>().build(
+ "value",
+ label,
+ Long.class,
+ new PropertyModel<Long>(prop, "value") {
+
+ private static final long serialVersionUID = -7688359318035249200L;
+
+ @Override
+ public Long getObject() {
+ return StringUtils.isBlank(prop.getValue())
+ ? null
+ : NumberUtils.toLong(prop.getValue());
+ }
+
+ @Override
+ public void setObject(final Long object) {
+ prop.setValue(String.valueOf(object));
+ }
+ });
+ break;
+
+ case String:
+ default:
+ field = new AjaxTextFieldPanel("value", label, new PropertyModel<>(prop, "value"), false);
+ break;
+ }
+
+ field.setReadOnly(!prop.isWritable());
+ if (prop.isRequired()) {
+ field.addRequiredLabel();
+ }
+
+ item.add(field);
+ }
+ };
+
+ AjaxLink<String> userDetails = new AjaxLink<String>("userDetails") {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ viewDetails(target);
+ }
+ };
+ MetaDataRoleAuthorizationStrategy.authorize(userDetails, ENABLE, StandardEntitlement.USER_READ);
+
+ boolean enabled = formTO.getUserTO() != null;
+ userDetails.setVisible(enabled).setEnabled(enabled);
+
+ add(propView);
+ add(userDetails);
+ }
+
+ protected abstract void viewDetails(final AjaxRequestTarget target);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
----------------------------------------------------------------------
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
new file mode 100644
index 0000000..9606824
--- /dev/null
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
@@ -0,0 +1,63 @@
+/*
+ * 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.client.console.approvals;
+
+import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
+import org.apache.syncope.client.console.panels.MultilevelPanel;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.wizards.AjaxWizard;
+import org.apache.syncope.client.console.wizards.any.UserWizardBuilder;
+import org.apache.syncope.common.lib.AnyOperations;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.wicket.PageReference;
+
+public class ApprovalDetails extends MultilevelPanel.SecondLevel {
+
+ private static final long serialVersionUID = -8847854414429745216L;
+
+ public ApprovalDetails(final PageReference pageRef, final UserRequestForm formTO) {
+ super(MultilevelPanel.SECOND_LEVEL_ID);
+
+ final UserTO newUserTO;
+ final UserTO previousUserTO;
+ if (formTO.getUserPatch() == null) {
+ newUserTO = formTO.getUserTO();
+ previousUserTO = null;
+ } else if (formTO.getUserTO() == null) {
+ // make it stronger by handling possible NPE
+ previousUserTO = new UserTO();
+ previousUserTO.setKey(formTO.getUserPatch().getKey());
+ newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());
+ } else {
+ formTO.getUserTO().setKey(formTO.getUserPatch().getKey());
+ newUserTO = AnyOperations.patch(formTO.getUserTO(), formTO.getUserPatch());
+ previousUserTO = formTO.getUserTO();
+ }
+
+ add(new UserWizardBuilder(
+ previousUserTO,
+ newUserTO,
+ new AnyTypeRestClient().read(AnyTypeKind.USER.name()).getClasses(),
+ new UserFormLayoutInfo(),
+ pageRef).
+ build(AjaxWizard.Mode.READONLY));
+ }
+}
[05/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml b/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml
new file mode 100644
index 0000000..5a9f1bd
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/userWorkflow.bpmn20.xml
@@ -0,0 +1,228 @@
+<?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:flowable="http://flowable.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://www.flowable.org/processdef">
+
+ <process id="userWorkflow" name="User Workflow" isExecutable="true">
+ <startEvent id="theStart"/>
+ <sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
+ <serviceTask id="create" name="Create" flowable:expression="#{create.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow2" sourceRef="create" targetRef="activate"/>
+ <scriptTask id="activate" name="Activate" scriptFormat="groovy" flowable:autoStoreVariables="false">
+ <script><![CDATA[execution.setVariable("propagateEnable", Boolean.TRUE);]]></script>
+ </scriptTask>
+ <sequenceFlow id="flow3" sourceRef="activate" targetRef="active"/>
+ <userTask id="active" name="Active"/>
+ <sequenceFlow id="flow8" sourceRef="active" targetRef="activeGw"/>
+ <exclusiveGateway id="activeGw"/>
+ <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>
+ <serviceTask id="update" name="Update" flowable:expression="#{update.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" sourceRef="update" targetRef="active"/>
+ <serviceTask id="suspend" name="Suspend" flowable: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" flowable:expression="#{reactivate.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
+ <serviceTask id="generateToken4PasswordReset" name="Generate Token" flowable:expression="#{generateToken.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" sourceRef="generateToken4PasswordReset" targetRef="notify4RequestPasswordReset"/>
+ <serviceTask id="notify4RequestPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" sourceRef="notify4RequestPasswordReset" targetRef="active"/>
+ <serviceTask id="checkToken4ConfirmPasswordReset" name="Check token, remove and update password" flowable:expression="#{passwordReset.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" sourceRef="checkToken4ConfirmPasswordReset" targetRef="notify4ConfirmPasswordReset"/>
+ <serviceTask id="notify4ConfirmPasswordReset" name="Notification" flowable:expression="#{notify.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" sourceRef="notify4ConfirmPasswordReset" targetRef="active"/>
+ <serviceTask id="delete" name="Delete" flowable: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="540.0" y="521.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
+ <omgdc:Bounds height="60.0" width="100.0" x="620.0" y="509.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
+ <omgdc:Bounds height="80.0" width="100.0" x="828.0" y="500.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="update" id="BPMNShape_update">
+ <omgdc:Bounds height="60.0" width="100.0" x="1370.0" y="615.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
+ <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="370.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspended" id="BPMNShape_suspended">
+ <omgdc:Bounds height="60.0" width="100.0" x="1640.0" y="370.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
+ <omgdc:Bounds height="40.0" width="40.0" x="1820.0" y="380.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="reactivate" id="BPMNShape_reactivate">
+ <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="290.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="604.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1515.0" y="750.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="664.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
+ <omgdc:Bounds height="81.0" width="121.0" x="1725.0" y="810.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
+ <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="438.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:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
+ <omgdi:waypoint x="1420.0" y="559.9405090390104"/>
+ <omgdi:waypoint x="1420.0" y="615.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
+ <omgdi:waypoint x="1859.9433544303797" y="400.0"/>
+ <omgdi:waypoint x="1990.0" y="400.0"/>
+ <omgdi:waypoint x="1990.0" y="438.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
+ <omgdi:waypoint x="1439.947267871352" y="540.0"/>
+ <omgdi:waypoint x="1785.0" y="540.0"/>
+ <omgdi:waypoint x="1785.3768996960487" y="664.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C" id="BPMNEdge_sid-EA22026A-25F0-4ED0-AB6E-9CE9CE74623C">
+ <omgdi:waypoint x="1370.0" y="645.0"/>
+ <omgdi:waypoint x="1080.0" y="645.0"/>
+ <omgdi:waypoint x="1080.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
+ <omgdi:waypoint x="1859.9339371980675" y="400.0"/>
+ <omgdi:waypoint x="1902.0" y="400.0"/>
+ <omgdi:waypoint x="1902.0" y="320.0"/>
+ <omgdi:waypoint x="1939.9999999999768" y="320.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
+ <omgdi:waypoint x="1439.9482503069637" y="540.0"/>
+ <omgdi:waypoint x="1990.0" y="540.0"/>
+ <omgdi:waypoint x="1990.0" y="497.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7" id="BPMNEdge_sid-7F78CE07-A7A1-467F-BB4B-40FB234AEFF7">
+ <omgdi:waypoint x="1575.5" y="684.9499999999999"/>
+ <omgdi:waypoint x="1575.5" y="750.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="569.9448521215137" y="536.3898700596537"/>
+ <omgdi:waypoint x="620.0" y="537.6956521739131"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+ <omgdi:waypoint x="719.9499999999825" y="539.2401442307691"/>
+ <omgdi:waypoint x="827.9999999999945" y="539.7596153846154"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+ <omgdi:waypoint x="927.9499999999819" y="540.2472772277227"/>
+ <omgdi:waypoint x="1029.9999999999911" y="540.7524752475248"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
+ <omgdi:waypoint x="1439.943568665287" y="540.0"/>
+ <omgdi:waypoint x="1575.0" y="540.0"/>
+ <omgdi:waypoint x="1575.3062200956938" y="604.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6" id="BPMNEdge_sid-3E9FE01D-CC60-4A95-B356-CA0DC000FAD6">
+ <omgdi:waypoint x="1785.5" y="744.9499999999999"/>
+ <omgdi:waypoint x="1785.5" y="810.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+ <omgdi:waypoint x="1589.95" y="400.0"/>
+ <omgdi:waypoint x="1640.0" y="400.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F" id="BPMNEdge_sid-CF9ACA40-7750-47C3-A508-7250D24D4F1F">
+ <omgdi:waypoint x="1514.9999999999554" y="790.438950554995"/>
+ <omgdi:waypoint x="1080.0" y="790.0"/>
+ <omgdi:waypoint x="1080.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+ <omgdi:waypoint x="1129.9499999999914" y="540.8529411764707"/>
+ <omgdi:waypoint x="1400.0586510263724" y="540.058504398827"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+ <omgdi:waypoint x="1739.95" y="400.0"/>
+ <omgdi:waypoint x="1820.0" y="400.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow99" id="BPMNEdge_flow99">
+ <omgdi:waypoint x="2039.9499999999982" y="466.5576923076923"/>
+ <omgdi:waypoint x="2080.005704870052" y="465.4022398573087"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
+ <omgdi:waypoint x="1439.9416944213153" y="540.0"/>
+ <omgdi:waypoint x="1540.0" y="540.0"/>
+ <omgdi:waypoint x="1540.0" y="429.95"/>
+ </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"/>
+ <omgdi:waypoint x="1080.0" y="261.0"/>
+ <omgdi:waypoint x="1080.0" y="511.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="sid-A37806A7-6B7B-48A2-BB37-DAE640231144" id="BPMNEdge_sid-A37806A7-6B7B-48A2-BB37-DAE640231144">
+ <omgdi:waypoint x="1724.9999999998677" y="850.4571226080794"/>
+ <omgdi:waypoint x="1080.0" y="850.0"/>
+ <omgdi:waypoint x="1080.0" y="570.95"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties b/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties
new file mode 100644
index 0000000..be8a7bb
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/workflow.properties
@@ -0,0 +1,21 @@
+# 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}
+historyLevel=activity
+uwfAdapter=org.apache.syncope.core.flowable.impl.FlowableUserWorkflowAdapter
+gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter
+awfAdapter=org.apache.syncope.core.workflow.java.DefaultAnyObjectWorkflowAdapter
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml b/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml
new file mode 100644
index 0000000..9e27f47
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/resources/workflowFlowableContext.xml
@@ -0,0 +1,62 @@
+<?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"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <bean id="userWorkflowDef" class="org.apache.syncope.core.spring.ResourceWithFallbackLoader">
+ <property name="primary" value="file:${wf.directory}/userWorkflow.bpmn20.xml"/>
+ <property name="fallback" value="classpath:userWorkflow.bpmn20.xml"/>
+ </bean>
+
+ <bean id="syncopeIdmIdentityService" class="org.apache.syncope.core.flowable.support.SyncopeIdmIdentityService"/>
+ <bean id="syncopeIdmEngineConfiguration" class="org.flowable.idm.spring.SpringIdmEngineConfiguration">
+ <property name="idmIdentityService" ref="syncopeIdmIdentityService"/>
+ </bean>
+ <bean id="syncopeIdmEngineConfigurator" class="org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator">
+ <property name="idmEngineConfiguration" ref="syncopeIdmEngineConfiguration"/>
+ </bean>
+
+ <bean class="org.apache.syncope.core.flowable.support.DomainProcessEngineConfiguration" scope="prototype">
+ <property name="databaseSchemaUpdate" value="true"/>
+
+ <property name="jpaHandleTransaction" value="true"/>
+ <property name="jpaCloseEntityManager" value="false"/>
+
+ <property name="history" value="${historyLevel}"/>
+
+ <property name="idmEngineConfigurator" ref="syncopeIdmEngineConfigurator"/>
+ <property name="customPreVariableTypes">
+ <list>
+ <bean class="org.apache.syncope.core.flowable.support.SyncopeEntitiesVariableType"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="bpmnProcessManager" class="org.apache.syncope.core.flowable.impl.FlowableBpmnProcessManager"/>
+ <bean id="userRequestHandler" class="org.apache.syncope.core.flowable.impl.FlowableUserRequestHandler"/>
+ <bean id="flowableUtils" class="org.apache.syncope.core.flowable.impl.FlowableWorkflowUtils"/>
+
+ <context:component-scan base-package="org.apache.syncope.core.flowable"/>
+</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/logic/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/pom.xml b/ext/flowable/logic/pom.xml
new file mode 100644
index 0000000..b5765df
--- /dev/null
+++ b/ext/flowable/logic/pom.xml
@@ -0,0 +1,61 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable Logic</name>
+ <description>Apache Syncope Ext: Flowable Logic</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-logic</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.core</groupId>
+ <artifactId>syncope-core-logic</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-bpmn</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java
new file mode 100644
index 0000000..8d280ac
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/BpmnProcessLogic.java
@@ -0,0 +1,73 @@
+/*
+ * 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.logic;
+
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.util.List;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import org.apache.syncope.core.flowable.api.BpmnProcessManager;
+
+@Component
+public class BpmnProcessLogic extends AbstractTransactionalLogic<BpmnProcessTO> {
+
+ @Autowired
+ private BpmnProcessManager bpmnProcessManager;
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_LIST + "')")
+ @Transactional(readOnly = true)
+ public List<BpmnProcessTO> list() {
+ return bpmnProcessManager.getProcesses();
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_GET + "')")
+ @Transactional(readOnly = true)
+ public void exportDefinition(final String key, final BpmnProcessFormat format, final OutputStream os) {
+ bpmnProcessManager.exportProcess(key, format, os);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_GET + "')")
+ @Transactional(readOnly = true)
+ public void exportDiagram(final String key, final OutputStream os) {
+ bpmnProcessManager.exportDiagram(key, os);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_SET + "')")
+ public void importDefinition(final String key, final BpmnProcessFormat format, final String definition) {
+ bpmnProcessManager.importProcess(key, format, definition);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.BPMN_PROCESS_DELETE + "')")
+ public void delete(final String key) {
+ bpmnProcessManager.deleteProcess(key);
+ }
+
+ @Override
+ protected BpmnProcessTO resolveReference(final Method method, final Object... args)
+ throws UnresolvedReferenceException {
+
+ throw new UnresolvedReferenceException();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java
new file mode 100644
index 0000000..1acc1da
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserRequestLogic.java
@@ -0,0 +1,160 @@
+/*
+ * 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.logic;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import org.apache.commons.io.output.NullOutputStream;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.syncope.core.flowable.api.BpmnProcessManager;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationManager;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.api.UserRequestHandler;
+import org.apache.syncope.core.spring.security.AuthContextUtils;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Component
+public class UserRequestLogic extends AbstractTransactionalLogic<UserRequestForm> {
+
+ @Autowired
+ private BpmnProcessManager bpmnProcessManager;
+
+ @Autowired
+ private UserRequestHandler userRequestHandler;
+
+ @Autowired
+ private PropagationManager propagationManager;
+
+ @Autowired
+ private PropagationTaskExecutor taskExecutor;
+
+ @Autowired
+ private UserDataBinder binder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ protected UserRequestTO doStart(final String bpmnProcess, final User user) {
+ // check if BPMN process exists
+ bpmnProcessManager.exportProcess(bpmnProcess, BpmnProcessFormat.XML, new NullOutputStream());
+
+ return userRequestHandler.start(bpmnProcess, user);
+ }
+
+ @PreAuthorize("isAuthenticated()")
+ public UserRequestTO start(final String bpmnProcess) {
+ return doStart(bpmnProcess, userDAO.findByUsername(AuthContextUtils.getUsername()));
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.USER_REQUEST_START + "')")
+ public UserRequestTO start(final String bpmnProcess, final String userKey) {
+ return doStart(bpmnProcess, userDAO.authFind(userKey));
+ }
+
+ @PreAuthorize("isAuthenticated()")
+ public void cancel(final String executionId, final String reason) {
+ Pair<ProcessInstance, String> parsed = userRequestHandler.parse(executionId);
+
+ if (!AuthContextUtils.getUsername().equals(userDAO.find(parsed.getRight()).getUsername())
+ && !AuthContextUtils.getAuthorities().stream().
+ anyMatch(auth -> FlowableEntitlement.USER_REQUEST_CANCEL.equals(auth.getAuthority()))) {
+
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.DelegatedAdministration);
+ sce.getElements().add("Canceling " + executionId + " not allowed");
+ throw sce;
+ }
+
+ userRequestHandler.cancel(parsed.getLeft(), reason);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_CLAIM + "')")
+ public UserRequestForm claimForm(final String taskId) {
+ return userRequestHandler.claimForm(taskId);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_READ + "') "
+ + "and hasRole('" + StandardEntitlement.USER_READ + "')")
+ @Transactional(readOnly = true)
+ public List<UserRequestForm> getForms(final String key) {
+ User user = userDAO.authFind(key);
+ return userRequestHandler.getForms(user.getKey());
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_LIST + "')")
+ @Transactional(readOnly = true)
+ public Pair<Integer, List<UserRequestForm>> getForms(
+ final int page,
+ final int size,
+ final List<OrderByClause> orderByClauses) {
+
+ return userRequestHandler.getForms(page, size, orderByClauses);
+ }
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_FORM_SUBMIT + "')")
+ public UserTO submitForm(final UserRequestForm form) {
+ WorkflowResult<UserPatch> wfResult = userRequestHandler.submitForm(form);
+
+ // propByRes can be made empty by the workflow definition if no propagation should occur
+ // (for example, with rejected users)
+ if (wfResult.getPropByRes() != null && !wfResult.getPropByRes().isEmpty()) {
+ List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
+ new WorkflowResult<>(
+ Pair.of(wfResult.getResult(), Boolean.TRUE),
+ wfResult.getPropByRes(),
+ wfResult.getPerformedTasks()));
+
+ taskExecutor.execute(tasks, false);
+ }
+
+ UserTO userTO;
+ if (userDAO.find(wfResult.getResult().getKey()) == null) {
+ userTO = new UserTO();
+ userTO.setKey(wfResult.getResult().getKey());
+ } else {
+ userTO = binder.getUserTO(wfResult.getResult().getKey());
+ }
+ return userTO;
+ }
+
+ @Override
+ protected UserRequestForm resolveReference(final Method method, final Object... args)
+ throws UnresolvedReferenceException {
+
+ throw new UnresolvedReferenceException();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java
new file mode 100644
index 0000000..8d73fae
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/UserWorkflowTaskLogic.java
@@ -0,0 +1,91 @@
+/*
+ * 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.logic;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.patch.UserPatch;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationManager;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
+import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.flowable.api.WorkflowTaskManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Component;
+
+@Component
+public class UserWorkflowTaskLogic extends AbstractTransactionalLogic<UserRequestForm> {
+
+ @Autowired
+ private WorkflowTaskManager wfTaskManager;
+
+ @Autowired
+ private PropagationManager propagationManager;
+
+ @Autowired
+ private PropagationTaskExecutor taskExecutor;
+
+ @Autowired
+ private UserDataBinder binder;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @PreAuthorize("hasRole('" + FlowableEntitlement.WORKFLOW_TASK_LIST + "') "
+ + "and hasRole('" + StandardEntitlement.USER_READ + "')")
+ public List<WorkflowTask> getAvailableTasks(final String key) {
+ User user = userDAO.authFind(key);
+ return wfTaskManager.getAvailableTasks(user.getKey());
+ }
+
+ @PreAuthorize("hasRole('" + StandardEntitlement.USER_UPDATE + "')")
+ public UserTO executeNextTask(final WorkflowTaskExecInput workflowTaskExecInput) {
+ WorkflowResult<String> updated = wfTaskManager.executeNextTask(workflowTaskExecInput);
+
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(updated.getResult());
+
+ List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(
+ new WorkflowResult<>(
+ Pair.<UserPatch, Boolean>of(userPatch, null),
+ updated.getPropByRes(), updated.getPerformedTasks()));
+
+ taskExecutor.execute(tasks, false);
+
+ return binder.getUserTO(updated.getResult());
+ }
+
+ @Override
+ protected UserRequestForm resolveReference(final Method method, final Object... args)
+ throws UnresolvedReferenceException {
+
+ throw new UnresolvedReferenceException();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
----------------------------------------------------------------------
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
new file mode 100644
index 0000000..ea526ad
--- /dev/null
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
@@ -0,0 +1,98 @@
+/*
+ * 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.logic.init;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.types.FlowableEntitlement;
+import org.apache.syncope.core.flowable.impl.FlowableDeployUtils;
+import org.apache.syncope.core.flowable.impl.FlowableRuntimeUtils;
+import org.apache.syncope.core.flowable.support.DomainProcessEngine;
+import org.apache.syncope.core.persistence.api.SyncopeLoader;
+import org.apache.syncope.core.provisioning.api.EntitlementsHolder;
+import org.apache.syncope.core.spring.ResourceWithFallbackLoader;
+import org.flowable.engine.ProcessEngine;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.flowable.spring.SpringProcessEngineConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class FlowableLoader implements SyncopeLoader {
+
+ private static final Logger LOG = LoggerFactory.getLogger(FlowableLoader.class);
+
+ @Resource(name = "userWorkflowDef")
+ private ResourceWithFallbackLoader userWorkflowDef;
+
+ @Autowired
+ private DomainProcessEngine dpEngine;
+
+ @Override
+ public Integer getPriority() {
+ return Integer.MIN_VALUE;
+ }
+
+ @Override
+ public void load() {
+ EntitlementsHolder.getInstance().init(FlowableEntitlement.values());
+
+ byte[] wfDef = new byte[0];
+
+ try (InputStream wfIn = userWorkflowDef.getResource().getInputStream()) {
+ wfDef = IOUtils.toByteArray(wfIn);
+ } catch (IOException e) {
+ LOG.error("While loading " + userWorkflowDef.getResource().getFilename(), e);
+ }
+
+ for (Map.Entry<String, ProcessEngine> entry : dpEngine.getEngines().entrySet()) {
+ List<ProcessDefinition> processes = entry.getValue().getRepositoryService().
+ createProcessDefinitionQuery().processDefinitionKey(FlowableRuntimeUtils.WF_PROCESS_ID).
+ list();
+ LOG.debug(FlowableRuntimeUtils.WF_PROCESS_ID + " Flowable processes in repository: {}", processes);
+
+ // Only loads process definition from file if not found in repository
+ if (processes.isEmpty()) {
+ entry.getValue().getRepositoryService().createDeployment().addInputStream(
+ userWorkflowDef.getResource().getFilename(), new ByteArrayInputStream(wfDef)).deploy();
+
+ ProcessDefinition procDef = entry.getValue().getRepositoryService().createProcessDefinitionQuery().
+ processDefinitionKey(FlowableRuntimeUtils.WF_PROCESS_ID).latestVersion().
+ singleResult();
+
+ FlowableDeployUtils.deployModel(entry.getValue(), procDef);
+
+ LOG.debug("Flowable Workflow definition loaded for domain {}", entry.getKey());
+ }
+
+ // jump to the next ID block
+ for (int i = 0; i < entry.getValue().getProcessEngineConfiguration().getIdBlockSize(); i++) {
+ SpringProcessEngineConfiguration.class.cast(entry.getValue().getProcessEngineConfiguration()).
+ getIdGenerator().getNextId();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/pom.xml b/ext/flowable/pom.xml
new file mode 100644
index 0000000..5a804b5
--- /dev/null
+++ b/ext/flowable/pom.xml
@@ -0,0 +1,49 @@
+<?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-ext</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable</name>
+ <description>Apache Syncope Ext: Flowable</description>
+ <groupId>org.apache.syncope.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <packaging>pom</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../..</rootpom.basedir>
+ </properties>
+
+ <modules>
+ <module>common-lib</module>
+ <module>rest-api</module>
+ <module>logic</module>
+ <module>rest-cxf</module>
+ <module>flowable-bpmn</module>
+ <module>client-console</module>
+ </modules>
+
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-api/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/pom.xml b/ext/flowable/rest-api/pom.xml
new file mode 100644
index 0000000..c45ffd3
--- /dev/null
+++ b/ext/flowable/rest-api/pom.xml
@@ -0,0 +1,76 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable REST API</name>
+ <description>Apache Syncope Ext: Flowable REST API</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.common</groupId>
+ <artifactId>syncope-common-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Generating javadoc JAR artifact for usage with CXF's WADL generator (for core) -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java
new file mode 100644
index 0000000..4097afd
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/UserRequestFormQuery.java
@@ -0,0 +1,32 @@
+/*
+ * 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.common.rest.api.beans;
+
+public class UserRequestFormQuery extends AbstractQuery {
+
+ private static final long serialVersionUID = -4762457303770028554L;
+
+ public static class Builder extends AbstractQuery.Builder<UserRequestFormQuery, Builder> {
+
+ @Override
+ protected UserRequestFormQuery newInstance() {
+ return new UserRequestFormQuery();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java
new file mode 100644
index 0000000..06cb056
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java
@@ -0,0 +1,108 @@
+/*
+ * 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.common.rest.api.service;
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.security.SecurityRequirements;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+
+/**
+ * REST operations for BPMN processes.
+ */
+@Tag(name = "Flowable")
+@SecurityRequirements({
+ @SecurityRequirement(name = "BasicAuthentication"),
+ @SecurityRequirement(name = "Bearer") })
+@Path("flowable/bpmnProcesses")
+public interface BpmnProcessService extends JAXRSService {
+
+ /**
+ * Lists the available BPMN processes.
+ *
+ * @return available BPMN processs, for the given any object type
+ */
+ @GET
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ List<BpmnProcessTO> list();
+
+ /**
+ * Exports the BPMN process for matching key.
+ *
+ * @param key BPMN process key
+ * @return BPMN process for matching key
+ */
+ @GET
+ @Path("{key}")
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ Response get(@NotNull @PathParam("key") String key);
+
+ /**
+ * Exports the BPMN diagram representation (if available), for matching key.
+ *
+ * @param key BPMN process key
+ * @return workflow diagram representation
+ */
+ @GET
+ @Path("{key}/diagram.png")
+ @Produces({ RESTHeaders.MEDIATYPE_IMAGE_PNG })
+ Response exportDiagram(@NotNull @PathParam("key") String key);
+
+ /**
+ * Imports the BPMN process under the provided key.
+ *
+ * @param key BPMN process key
+ * @param definition BPMN process for matching kind
+ */
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
+ @PUT
+ @Path("{key}")
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ void set(@NotNull @PathParam("key") String key, @NotNull String definition);
+
+ /**
+ * Removes the BPMN process under the provided key.
+ *
+ * @param key BPMN process key
+ */
+ @Operation(operationId = "deleteBpmnProcess")
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
+ @DELETE
+ @Path("{key}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ void delete(@NotNull @PathParam("key") String key);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java
new file mode 100644
index 0000000..701772d
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java
@@ -0,0 +1,125 @@
+/*
+ * 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.common.rest.api.service;
+
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.security.SecurityRequirements;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.BeanParam;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+
+/**
+ * REST operations related to user workflow.
+ */
+@Tag(name = "Flowable")
+@SecurityRequirements({
+ @SecurityRequirement(name = "BasicAuthentication"),
+ @SecurityRequirement(name = "Bearer") })
+@Path("flowable/userRequests")
+public interface UserRequestService extends JAXRSService {
+
+ /**
+ * Starts a new user request, for the given BOMN Process and
+ * user (if provided) or requesting user (if not provided).
+ *
+ * @param bpmnProcess BPMN process
+ * @param userKey user key
+ * @return data about the started request service, including execution id
+ */
+ @POST
+ @Path("start/{bpmnProcess}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserRequestTO start(
+ @NotNull @PathParam("bpmnProcess") String bpmnProcess,
+ @QueryParam("userKey") String userKey);
+
+ /**
+ * Cancel a running user request.
+ *
+ * @param executionId execution id
+ * @param reason reason to cancel the user request
+ */
+ @DELETE
+ @Path("{executionId}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ void cancel(
+ @NotNull @PathParam("executionId") String executionId,
+ @QueryParam("reason") String reason);
+
+ /**
+ * Returns a list of all available workflow forms.
+ *
+ * @param query query conditions
+ * @return list of all available workflow forms
+ */
+ @GET
+ @Path("forms")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ PagedResult<UserRequestForm> getForms(@BeanParam UserRequestFormQuery query);
+
+ /**
+ * Returns a list of available forms for the given user key.
+ *
+ * @param userKey user key
+ * @return list of available forms for the given user key
+ */
+ @GET
+ @Path("forms/{userKey}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ List<UserRequestForm> getForms(@NotNull @PathParam("userKey") String userKey);
+
+ /**
+ * Claims the form for the given task id.
+ *
+ * @param taskId workflow task id
+ * @return the workflow form for the given task id
+ */
+ @POST
+ @Path("forms/{taskId}/claim")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserRequestForm claimForm(@NotNull @PathParam("taskId") String taskId);
+
+ /**
+ * Submits a workflow form.
+ *
+ * @param form workflow form.
+ * @return updated user
+ */
+ @POST
+ @Path("forms")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserTO submitForm(@NotNull UserRequestForm form);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java
new file mode 100644
index 0000000..54f38d0
--- /dev/null
+++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java
@@ -0,0 +1,67 @@
+/*
+ * 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.common.rest.api.service;
+
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.security.SecurityRequirements;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+
+@Tag(name = "Flowable")
+@SecurityRequirements({
+ @SecurityRequirement(name = "BasicAuthentication"),
+ @SecurityRequirement(name = "Bearer") })
+@Path("flowable/userWorkflowTasks")
+public interface UserWorkflowTaskService extends JAXRSService {
+
+ /**
+ * Returns a list of available tasks for the given user key.
+ *
+ * @param userKey user key
+ * @return list of available tasks for the given user key
+ */
+ @GET
+ @Path("tasks/{userKey}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ List<WorkflowTask> getAvailableTasks(@NotNull @PathParam("userKey") String userKey);
+
+ /**
+ * Executes the next workflow task available, for matching user key.
+ *
+ * @param workflowTaskExecInput input for task execution
+ * @return updated user
+ */
+ @POST
+ @Path("tasks/{userKey}")
+ @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
+ UserTO executeNextTask(@NotNull WorkflowTaskExecInput workflowTaskExecInput);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-cxf/pom.xml
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/pom.xml b/ext/flowable/rest-cxf/pom.xml
new file mode 100644
index 0000000..20b60c1
--- /dev/null
+++ b/ext/flowable/rest-cxf/pom.xml
@@ -0,0 +1,72 @@
+<?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.ext</groupId>
+ <artifactId>syncope-ext-flowable</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Ext: Flowable REST CXF</name>
+ <description>Apache Syncope Ext: Flowable REST CXF</description>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.core</groupId>
+ <artifactId>syncope-core-rest-cxf</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-api</artifactId>
+ <version>${project.version}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-logic</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java
new file mode 100644
index 0000000..dd1aea8
--- /dev/null
+++ b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/BpmnProcessServiceImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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.rest.cxf.service;
+
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import org.apache.syncope.common.lib.to.BpmnProcessTO;
+import org.apache.syncope.common.lib.types.BpmnProcessFormat;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.core.logic.BpmnProcessLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.syncope.common.rest.api.service.BpmnProcessService;
+
+@Service
+public class BpmnProcessServiceImpl extends AbstractServiceImpl implements BpmnProcessService {
+
+ @Autowired
+ private BpmnProcessLogic logic;
+
+ @Override
+ public List<BpmnProcessTO> list() {
+ return logic.list();
+ }
+
+ @Override
+ public Response get(final String key) {
+ BpmnProcessFormat format =
+ messageContext.getHttpHeaders().getAcceptableMediaTypes().contains(MediaType.APPLICATION_JSON_TYPE)
+ ? BpmnProcessFormat.JSON
+ : BpmnProcessFormat.XML;
+
+ StreamingOutput sout = os -> logic.exportDefinition(key, format, os);
+
+ return Response.ok(sout).
+ type(format == BpmnProcessFormat.JSON
+ ? MediaType.APPLICATION_JSON_TYPE : MediaType.APPLICATION_XHTML_XML_TYPE).
+ build();
+ }
+
+ @Override
+ public Response exportDiagram(final String key) {
+ StreamingOutput sout = (os) -> logic.exportDiagram(key, os);
+
+ return Response.ok(sout).
+ type(RESTHeaders.MEDIATYPE_IMAGE_PNG).
+ build();
+ }
+
+ @Override
+ public void set(final String key, final String definition) {
+ BpmnProcessFormat format =
+ messageContext.getHttpHeaders().getMediaType().equals(MediaType.APPLICATION_JSON_TYPE)
+ ? BpmnProcessFormat.JSON
+ : BpmnProcessFormat.XML;
+
+ logic.importDefinition(key, format, definition);
+ }
+
+ @Override
+ public void delete(final String key) {
+ logic.delete(key);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java
new file mode 100644
index 0000000..2f174a0
--- /dev/null
+++ b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserRequestServiceImpl.java
@@ -0,0 +1,73 @@
+/*
+ * 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.rest.cxf.service;
+
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+import org.apache.syncope.core.logic.UserRequestLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
+
+@Service
+public class UserRequestServiceImpl extends AbstractServiceImpl implements UserRequestService {
+
+ @Autowired
+ private UserRequestLogic logic;
+
+ @Override
+ public UserRequestTO start(final String bpmnProcess, final String userKey) {
+ return userKey == null
+ ? logic.start(bpmnProcess)
+ : logic.start(bpmnProcess, userKey);
+ }
+
+ @Override
+ public void cancel(final String executionId, final String reason) {
+ logic.cancel(executionId, reason);
+ }
+
+ @Override
+ public UserRequestForm claimForm(final String taskId) {
+ return logic.claimForm(taskId);
+ }
+
+ @Override
+ public List<UserRequestForm> getForms(final String userKey) {
+ return logic.getForms(userKey);
+ }
+
+ @Override
+ public PagedResult<UserRequestForm> getForms(final UserRequestFormQuery query) {
+ Pair<Integer, List<UserRequestForm>> result = logic.getForms(
+ query.getPage(), query.getSize(), getOrderByClauses(query.getOrderBy()));
+ return buildPagedResult(result.getRight(), query.getPage(), query.getSize(), result.getLeft());
+ }
+
+ @Override
+ public UserTO submitForm(final UserRequestForm form) {
+ return logic.submitForm(form);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java
new file mode 100644
index 0000000..441973d
--- /dev/null
+++ b/ext/flowable/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowTaskServiceImpl.java
@@ -0,0 +1,45 @@
+/*
+ * 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.rest.cxf.service;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowTask;
+import org.apache.syncope.common.lib.to.WorkflowTaskExecInput;
+import org.apache.syncope.core.logic.UserWorkflowTaskLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.syncope.common.rest.api.service.UserWorkflowTaskService;
+
+@Service
+public class UserWorkflowTaskServiceImpl extends AbstractServiceImpl implements UserWorkflowTaskService {
+
+ @Autowired
+ private UserWorkflowTaskLogic logic;
+
+ @Override
+ public List<WorkflowTask> getAvailableTasks(final String userKey) {
+ return logic.getAvailableTasks(userKey);
+ }
+
+ @Override
+ public UserTO executeNextTask(final WorkflowTaskExecInput workflowTaskExecInput) {
+ return logic.executeNextTask(workflowTaskExecInput);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
----------------------------------------------------------------------
diff --git a/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java b/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
index 66d2ce0..66bb812 100644
--- a/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
+++ b/ext/oidcclient/client-console/src/main/java/org/apache/syncope/client/console/pages/OIDCClient.java
@@ -32,7 +32,8 @@ import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-@ExtPage(label = "OIDC Client", icon = "fa-openid ", listEntitlement = OIDCClientEntitlement.OP_READ, priority = 200)
+@ExtPage(label = "OpenID Connect 1.0 Client", icon = "fa-openid ",
+ listEntitlement = OIDCClientEntitlement.OP_READ, priority = 300)
public class OIDCClient extends BaseExtPage {
private static final long serialVersionUID = -599601954212606001L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/oidcclient/persistence-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/ext/oidcclient/persistence-jpa/pom.xml b/ext/oidcclient/persistence-jpa/pom.xml
index 4d22477..8ce5496 100644
--- a/ext/oidcclient/persistence-jpa/pom.xml
+++ b/ext/oidcclient/persistence-jpa/pom.xml
@@ -117,7 +117,7 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>sqlgenr</id>
+ <id>sqlgen</id>
<phase>process-classes</phase>
<goals>
<goal>sql</goal>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
----------------------------------------------------------------------
diff --git a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
index 39b719c..37851c5 100644
--- a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
+++ b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCClientService.java
@@ -35,7 +35,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for OpenID Connect Clients.
*/
-@Tag(name = "OIDCClients")
+@Tag(name = "OpenID Connect 1.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
----------------------------------------------------------------------
diff --git a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
index ca55a4a..be7c7be 100644
--- a/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
+++ b/ext/oidcclient/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCProviderService.java
@@ -47,7 +47,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for OpenID Connect Providers.
*/
-@Tag(name = "OIDCProviders")
+@Tag(name = "OpenID Connect 1.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pom.xml b/ext/pom.xml
index 264c20f..0c0aaea 100644
--- a/ext/pom.xml
+++ b/ext/pom.xml
@@ -77,6 +77,7 @@ under the License.
</profiles>
<modules>
+ <module>flowable</module>
<module>camel</module>
<module>swagger-ui</module>
<module>saml2sp</module>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java b/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
index 7163ab9..71ef8e5 100644
--- a/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
+++ b/ext/saml2sp/client-console/src/main/java/org/apache/syncope/client/console/pages/SAML2SP.java
@@ -33,7 +33,7 @@ import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-@ExtPage(label = "SAML 2.0 SP", icon = "fa-sign-in", listEntitlement = SAML2SPEntitlement.IDP_READ, priority = 300)
+@ExtPage(label = "SAML 2.0 SP", icon = "fa-sign-in", listEntitlement = SAML2SPEntitlement.IDP_READ, priority = 400)
public class SAML2SP extends BaseExtPage {
private static final long serialVersionUID = -4837201407211278956L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
index 5c47843..196d731 100644
--- a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
+++ b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/init/SAML2SPLoader.java
@@ -25,7 +25,6 @@ import java.util.Map;
import java.util.Properties;
import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.PropertyUtils;
import org.apache.syncope.core.persistence.api.SyncopeLoader;
import org.apache.syncope.core.provisioning.api.EntitlementsHolder;
@@ -95,9 +94,8 @@ public class SAML2SPLoader implements SyncopeLoader {
public void load() {
EntitlementsHolder.getInstance().init(SAML2SPEntitlement.values());
- Pair<Properties, String> init = PropertyUtils.read(getClass(), SAML2SP_LOGIC_PROPERTIES, "conf.directory");
- Properties props = init.getLeft();
- String confDirectory = init.getRight();
+ Properties props = PropertyUtils.read(getClass(), SAML2SP_LOGIC_PROPERTIES, "conf.directory").getLeft();
+ String confDirectory = props.getProperty("conf.directory");
assertNotNull(confDirectory, "<conf.directory>");
@@ -174,5 +172,4 @@ public class SAML2SPLoader implements SyncopeLoader {
public String getSignatureAlgorithm() {
return signatureAlgorithm;
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/saml2sp/persistence-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/ext/saml2sp/persistence-jpa/pom.xml b/ext/saml2sp/persistence-jpa/pom.xml
index 73894d8..eb0aac1 100644
--- a/ext/saml2sp/persistence-jpa/pom.xml
+++ b/ext/saml2sp/persistence-jpa/pom.xml
@@ -117,7 +117,7 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>sqlgenr</id>
+ <id>sqlgen</id>
<phase>process-classes</phase>
<goals>
<goal>sql</goal>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
index acfbeb2..a20a3b9 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
@@ -46,7 +46,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for SAML 2.0 Identity Providers.
*/
-@Tag(name = "SAML2IdP")
+@Tag(name = "SAML 2.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
index 06d0996..2495fb1 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
@@ -39,7 +39,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for the provided SAML 2.0 Service Provider.
*/
-@Tag(name = "SAML2SP")
+@Tag(name = "SAML 2.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java b/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
index f243bb5..917b076 100644
--- a/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
+++ b/ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
@@ -37,7 +37,7 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@ExtPage(label = "SCIM 2.0", icon = "fa-cloud", listEntitlement = SCIMEntitlement.SCIM_CONF_GET, priority = 100)
+@ExtPage(label = "SCIM 2.0", icon = "fa-cloud", listEntitlement = SCIMEntitlement.SCIM_CONF_GET, priority = 500)
public class SCIMConfPage extends BaseExtPage {
protected static final Logger LOG = LoggerFactory.getLogger(SCIMConfPage.class);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
index 7e10f45..6faca11 100644
--- a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
+++ b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
@@ -36,7 +36,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
/**
* REST operations for SCIM 2.0 configuration.
*/
-@Tag(name = "SCIMConf")
+@Tag(name = "SCIM 2.0")
@SecurityRequirements({
@SecurityRequirement(name = "BasicAuthentication"),
@SecurityRequirement(name = "Bearer") })
[19/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java
new file mode 100644
index 0000000..5446894
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java
@@ -0,0 +1,144 @@
+/*
+ * 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 static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.to.UserRequestTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
+import org.apache.syncope.fit.AbstractITCase;
+import org.apache.syncope.fit.FlowableDetector;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+public class UserRequestITCase extends AbstractITCase {
+
+ @BeforeAll
+ public static void loadBpmnProcesses() throws IOException {
+ WebClient.client(bpmnProcessService).type(MediaType.APPLICATION_XML_TYPE);
+ bpmnProcessService.set("directorGroupRequest",
+ IOUtils.toString(UserRequestITCase.class.getResourceAsStream("/directorGroupRequest.bpmn20.xml")));
+ }
+
+ @Test
+ public void twoLevelsApproval() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("twoLevelsApproval@tirasa.net")).getEntity();
+ assertNotNull(user);
+ assertFalse(user.getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request
+ UserRequestTO req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // 1st approval -> reject
+ UserRequestForm form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("firstLevelApprove").get().setValue(Boolean.FALSE.toString());
+ userRequestService.submitForm(form);
+
+ // no more forms, group not assigned
+ assertTrue(userRequestService.getForms(user.getKey()).isEmpty());
+ assertFalse(userService.read(user.getKey()).getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request again
+ req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // 1st approval -> accept
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("firstLevelApprove").get().setValue(Boolean.TRUE.toString());
+ userRequestService.submitForm(form);
+
+ // 2nd approval -> reject
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("secondLevelApprove").get().setValue(Boolean.FALSE.toString());
+ user = userRequestService.submitForm(form);
+
+ // no more forms, group not assigned
+ assertTrue(userRequestService.getForms(user.getKey()).isEmpty());
+ assertFalse(userService.read(user.getKey()).getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request again
+ req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // 1st approval -> accept
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("firstLevelApprove").get().setValue(Boolean.TRUE.toString());
+ userRequestService.submitForm(form);
+
+ // 2nd approval -> accept
+ form = userRequestService.getForms(user.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("secondLevelApprove").get().setValue(Boolean.TRUE.toString());
+ user = userRequestService.submitForm(form);
+
+ // check that the director group was effectively assigned
+ assertTrue(user.getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+ assertTrue(userService.read(user.getKey()).getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+ }
+
+ @Test
+ public void cancel() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ PagedResult<UserRequestForm> forms =
+ userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("twoLevelsApproval@tirasa.net")).getEntity();
+ assertNotNull(user);
+ assertFalse(user.getMembership("ebf97068-aa4b-4a85-9f01-680e8c4cf227").isPresent());
+
+ // start request
+ UserRequestTO req = userRequestService.start("directorGroupRequest", user.getKey());
+ assertNotNull(req);
+
+ // check that form was generated
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ assertEquals(1, userRequestService.getForms(user.getKey()).size());
+
+ // cancel request
+ userRequestService.cancel(req.getExecutionId(), "nothing in particular");
+
+ // check that form was removed
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms, forms.getTotalCount());
+
+ assertTrue(userRequestService.getForms(user.getKey()).isEmpty());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
index 48d9d55..0e48cf2 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
@@ -27,11 +27,15 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
+import java.util.Collections;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.UUID;
import javax.sql.DataSource;
import javax.ws.rs.ForbiddenException;
import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.client.lib.SyncopeClient;
@@ -46,18 +50,22 @@ import org.apache.syncope.common.lib.to.MembershipTO;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.ProvisioningResult;
import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.to.UserRequestForm;
+import org.apache.syncope.common.lib.to.WorkflowTask;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.PatchOperation;
import org.apache.syncope.common.rest.api.beans.AnyQuery;
+import org.apache.syncope.common.rest.api.beans.UserRequestFormQuery;
import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.syncope.common.rest.api.service.UserRequestService;
import org.apache.syncope.common.rest.api.service.UserSelfService;
import org.apache.syncope.common.rest.api.service.UserService;
import org.apache.syncope.fit.AbstractITCase;
import org.apache.syncope.fit.FlowableDetector;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
@@ -74,7 +82,7 @@ public class UserSelfITCase extends AbstractITCase {
@Test
public void create() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// 1. self-registration as admin: failure
try {
@@ -96,7 +104,7 @@ public class UserSelfITCase extends AbstractITCase {
@Test
public void createAndApprove() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// self-create user with membership: goes 'createApproval' with resources and membership but no propagation
UserTO userTO = UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org");
@@ -122,10 +130,10 @@ public class UserSelfITCase extends AbstractITCase {
}
// now approve and verify that propagation has happened
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
- userTO = userWorkflowService.submitForm(form);
+ userTO = userRequestService.submitForm(form);
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());
assertNotNull(resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey()));
@@ -133,17 +141,17 @@ public class UserSelfITCase extends AbstractITCase {
@Test
public void read() {
- UserService userService2 = clientFactory.create("rossini", ADMIN_PWD).getService(UserService.class);
-
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("selfread@syncope.apache.org")).getEntity();
+ UserService us2 = clientFactory.create(user.getUsername(), "password123").getService(UserService.class);
try {
- userService2.read("1417acbe-cbf6-4277-9372-e75e04f97000");
+ us2.read(user.getKey());
fail("This should not happen");
} catch (ForbiddenException e) {
assertNotNull(e);
}
- Pair<Map<String, Set<String>>, UserTO> self = clientFactory.create("rossini", ADMIN_PWD).self();
- assertEquals("rossini", self.getRight().getUsername());
+ Pair<Map<String, Set<String>>, UserTO> self = clientFactory.create(user.getUsername(), "password123").self();
+ assertEquals(user.getUsername(), self.getRight().getUsername());
}
@Test
@@ -174,14 +182,14 @@ public class UserSelfITCase extends AbstractITCase {
readEntity(new GenericType<ProvisioningResult<UserTO>>() {
}).getEntity();
assertNotNull(updated);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "active" : "created", updated.getStatus());
assertTrue(updated.getUsername().endsWith("XX"));
}
@Test
public void updateWithApproval() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
// 1. create user as admin
UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org")).getEntity();
@@ -220,10 +228,10 @@ public class UserSelfITCase extends AbstractITCase {
}
// 3. approve self-update as admin
- WorkflowFormTO form = userWorkflowService.getFormForUser(updated.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
+ UserRequestForm form = userRequestService.getForms(updated.getKey()).get(0);
+ form = userRequestService.claimForm(form.getTaskId());
form.getProperty("approveUpdate").get().setValue(Boolean.TRUE.toString());
- updated = userWorkflowService.submitForm(form);
+ updated = userRequestService.submitForm(form);
assertNotNull(updated);
assertEquals("active", updated.getStatus());
assertTrue(updated.getUsername().endsWith("XX"));
@@ -244,17 +252,11 @@ public class UserSelfITCase extends AbstractITCase {
new GenericType<ProvisioningResult<UserTO>>() {
}).getEntity();
assertNotNull(deleted);
- assertEquals(FlowableDetector.isFlowableEnabledForUsers(syncopeService)
+ assertEquals(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService)
? "deleteApproval" : null, deleted.getStatus());
}
@Test
- public void issueSYNCOPE373() {
- UserTO userTO = adminClient.self().getRight();
- assertEquals(ADMIN_UNAME, userTO.getUsername());
- }
-
- @Test
public void passwordReset() {
// 0. ensure that password request DOES require security question
configurationService.set(attrTO("passwordReset.securityQuestion", "true"));
@@ -400,4 +402,308 @@ public class UserSelfITCase extends AbstractITCase {
assertFalse(self.getRight().isMustChangePassword());
}
+ @Test
+ public void createWithReject() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ // User with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
+ userTO.getMemberships().add(new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
+
+ // 1. create user with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f
+ userTO = createUser(userTO).getEntity();
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
+ assertEquals("createApproval", userTO.getStatus());
+
+ // 2. request if there is any pending task for user just created
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ assertNotNull(form);
+ assertNotNull(form.getUsername());
+ assertEquals(userTO.getUsername(), form.getUsername());
+ assertNotNull(form.getTaskId());
+ assertNull(form.getOwner());
+
+ // 3. claim task as rossini, with role "User manager" granting entitlement to claim forms but not in
+ // groupForWorkflowApproval, designated for approval in workflow definition: fail
+ UserTO rossini = userService.read("1417acbe-cbf6-4277-9372-e75e04f97000");
+ if (!rossini.getRoles().contains("User manager")) {
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey("1417acbe-cbf6-4277-9372-e75e04f97000");
+ userPatch.getRoles().add(new StringPatchItem.Builder().
+ operation(PatchOperation.ADD_REPLACE).value("User manager").build());
+ rossini = updateUser(userPatch).getEntity();
+ }
+ assertTrue(rossini.getRoles().contains("User manager"));
+
+ UserRequestService userService2 = clientFactory.create("rossini", ADMIN_PWD).
+ getService(UserRequestService.class);
+ try {
+ userService2.claimForm(form.getTaskId());
+ fail("This should not happen");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.Workflow, e.getType());
+ }
+
+ // 4. claim task from bellini, with role "User manager" and in groupForWorkflowApproval
+ UserRequestService userService3 = clientFactory.create("bellini", ADMIN_PWD).
+ getService(UserRequestService.class);
+ form = userService3.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getOwner());
+
+ // 5. reject user
+ form.getProperty("approveCreate").get().setValue(Boolean.FALSE.toString());
+ form.getProperty("rejectReason").get().setValue("I don't like him.");
+ userTO = userService3.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals("rejected", userTO.getStatus());
+
+ // 6. check that rejected user was not propagated to external resource (SYNCOPE-364)
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ Exception exception = null;
+ try {
+ jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
+ new String[] { userTO.getUsername() }, Integer.class);
+ } catch (EmptyResultDataAccessException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ }
+
+ @Test
+ public void createWithApproval() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ // read forms *before* any operation
+ PagedResult<UserRequestForm> forms =
+ userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("createWithApproval@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ // User with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
+ userTO.getMemberships().add(
+ new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
+
+ // 1. create user and verify that no propagation occurred)
+ ProvisioningResult<UserTO> result = createUser(userTO);
+ assertNotNull(result);
+ userTO = result.getEntity();
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
+ assertEquals("createApproval", userTO.getStatus());
+ assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
+
+ assertTrue(result.getPropagationStatuses().isEmpty());
+
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ Exception exception = null;
+ try {
+ jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
+ new String[] { userTO.getUsername() }, Integer.class);
+ } catch (EmptyResultDataAccessException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+
+ // 2. request if there is any pending form for user just created
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ // 3. as admin, update user: still pending approval
+ String updatedUsername = "changed-" + UUID.randomUUID().toString();
+ UserPatch userPatch = new UserPatch();
+ userPatch.setKey(userTO.getKey());
+ userPatch.setUsername(new StringReplacePatchItem.Builder().value(updatedUsername).build());
+ updateUser(userPatch);
+
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getUserTO());
+ assertEquals(updatedUsername, form.getUserTO().getUsername());
+ assertNull(form.getUserPatch());
+ assertNull(form.getOwner());
+
+ // 4. claim task (as admin)
+ form = userRequestService.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getUserTO());
+ assertEquals(updatedUsername, form.getUserTO().getUsername());
+ assertNull(form.getUserPatch());
+ assertNotNull(form.getOwner());
+
+ // 5. approve user (and verify that propagation occurred)
+ form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
+ userTO = userRequestService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals(updatedUsername, userTO.getUsername());
+ assertEquals("active", userTO.getStatus());
+ assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
+
+ String username = queryForObject(
+ jdbcTemplate, 50, "SELECT id FROM test WHERE id=?", String.class, userTO.getUsername());
+ assertEquals(userTO.getUsername(), username);
+
+ // 6. update user
+ userPatch = new UserPatch();
+ userPatch.setKey(userTO.getKey());
+ userPatch.setPassword(new PasswordPatch.Builder().value("anotherPassword123").build());
+
+ userTO = updateUser(userPatch).getEntity();
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void updateApproval() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ // read forms *before* any operation
+ PagedResult<UserRequestForm> forms = userRequestService.getForms(new UserRequestFormQuery.Builder().
+ page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO created = createUser(UserITCase.getUniqueSampleTO("updateApproval@syncope.apache.org")).getEntity();
+ assertNotNull(created);
+ assertEquals("/", created.getRealm());
+ assertEquals(0, created.getMemberships().size());
+
+ UserPatch patch = new UserPatch();
+ patch.setKey(created.getKey());
+ patch.getMemberships().add(new MembershipPatch.Builder().group("b1f7c12d-ec83-441f-a50e-1691daaedf3b").build());
+
+ SyncopeClient client = clientFactory.create(created.getUsername(), "password123");
+ Response response = client.getService(UserSelfService.class).update(patch);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ assertEquals("updateApproval", userService.read(created.getKey()).getStatus());
+
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ UserRequestForm form = userRequestService.getForms(created.getKey()).get(0);
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNull(form.getOwner());
+ assertNotNull(form.getUserTO());
+ assertNotNull(form.getUserPatch());
+ assertEquals(patch, form.getUserPatch());
+
+ // as admin, update user: still pending approval
+ UserPatch adminPatch = new UserPatch();
+ adminPatch.setKey(created.getKey());
+ adminPatch.setRealm(new StringReplacePatchItem.Builder().value("/even/two").build());
+
+ UserTO updated = updateUser(adminPatch).getEntity();
+ assertEquals("updateApproval", updated.getStatus());
+ assertEquals("/even/two", updated.getRealm());
+ assertEquals(0, updated.getMemberships().size());
+
+ // the patch is not updated in the approval form
+ form = userRequestService.getForms(created.getKey()).get(0);
+ assertEquals(patch, form.getUserPatch());
+
+ // approve the user
+ form = userRequestService.claimForm(form.getTaskId());
+ form.getProperty("approveUpdate").get().setValue(Boolean.TRUE.toString());
+ userRequestService.submitForm(form);
+
+ // verify that the approved user bears both original and further changes
+ UserTO approved = userService.read(created.getKey());
+ assertEquals("active", approved.getStatus());
+ assertEquals("/even/two", approved.getRealm());
+ assertEquals(1, approved.getMemberships().size());
+ assertTrue(approved.getMembership("b1f7c12d-ec83-441f-a50e-1691daaedf3b").isPresent());
+ }
+
+ @Test
+ public void availableTasks() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ UserTO user = createUser(UserITCase.getUniqueSampleTO("availableTasks@apache.org")).getEntity();
+ assertEquals("active", user.getStatus());
+
+ List<WorkflowTask> tasks = userWorkflowTaskService.getAvailableTasks(user.getKey());
+ assertNotNull(tasks);
+ assertTrue(tasks.stream().anyMatch(task -> "update".equals(task.getName())));
+ assertTrue(tasks.stream().anyMatch(task -> "suspend".equals(task.getName())));
+ assertTrue(tasks.stream().anyMatch(task -> "delete".equals(task.getName())));
+ }
+
+ @Test
+ public void issueSYNCOPE15() {
+ assumeTrue(FlowableDetector.isFlowableEnabledForUserWorkflow(syncopeService));
+
+ // read forms *before* any operation
+ PagedResult<UserRequestForm> forms = userRequestService.getForms(new UserRequestFormQuery.Builder().
+ page(1).size(1000).build());
+ int preForms = forms.getTotalCount();
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("issueSYNCOPE15@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getMemberships().clear();
+
+ // Users with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
+ userTO.getMemberships().add(
+ new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
+
+ // 1. create user with group 9 (and verify that no propagation occurred)
+ userTO = createUser(userTO).getEntity();
+ assertNotNull(userTO);
+ assertNotEquals(0L, userTO.getKey());
+ assertNotNull(userTO.getCreationDate());
+ assertNotNull(userTO.getCreator());
+ assertNotNull(userTO.getLastChangeDate());
+ assertNotNull(userTO.getLastModifier());
+ assertEquals(userTO.getCreationDate(), userTO.getLastChangeDate());
+
+ // 2. request if there is any pending form for user just created
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms + 1, forms.getTotalCount());
+
+ UserRequestForm form = userRequestService.getForms(userTO.getKey()).get(0);
+ assertNotNull(form);
+
+ // 3. first claim by bellini ....
+ UserRequestService userService3 = clientFactory.create("bellini", ADMIN_PWD).
+ getService(UserRequestService.class);
+ form = userService3.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getOwner());
+
+ // 4. second claim task by admin
+ form = userRequestService.claimForm(form.getTaskId());
+ assertNotNull(form);
+
+ // 5. approve user
+ form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
+
+ // 6. submit approve
+ userTO = userRequestService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals(preForms,
+ userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build()).
+ getTotalCount());
+ assertTrue(userRequestService.getForms(userTO.getKey()).isEmpty());
+
+ // 7.check that no more forms are still to be processed
+ forms = userRequestService.getForms(new UserRequestFormQuery.Builder().page(1).size(1000).build());
+ assertEquals(preForms, forms.getTotalCount());
+ }
+
+ @Test
+ public void issueSYNCOPE373() {
+ UserTO userTO = adminClient.self().getRight();
+ assertEquals(ADMIN_UNAME, userTO.getUsername());
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java
deleted file mode 100644
index 24dc61d..0000000
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserWorkflowITCase.java
+++ /dev/null
@@ -1,361 +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.
- */
-package org.apache.syncope.fit.core;
-
-import org.apache.syncope.fit.FlowableDetector;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.UUID;
-import javax.sql.DataSource;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.patch.MembershipPatch;
-import org.apache.syncope.common.lib.patch.PasswordPatch;
-import org.apache.syncope.common.lib.patch.StringPatchItem;
-import org.apache.syncope.common.lib.patch.StringReplacePatchItem;
-import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.ProvisioningResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.PatchOperation;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.syncope.fit.AbstractITCase;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-
-@SpringJUnitConfig(locations = { "classpath:testJDBCEnv.xml" })
-public class UserWorkflowITCase extends AbstractITCase {
-
- @Autowired
- private DataSource testDataSource;
-
- @Test
- public void createWithReject() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- // User with group 9 are defined in workflow as subject to approval
- userTO.getMemberships().add(
- new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
-
- // 1. create user with group 9
- userTO = createUser(userTO).getEntity();
- assertNotNull(userTO);
- assertEquals(1, userTO.getMemberships().size());
- assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
- assertEquals("createApproval", userTO.getStatus());
-
- // 2. request if there is any pending task for user just created
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
- assertNotNull(form.getUsername());
- assertEquals(userTO.getUsername(), form.getUsername());
- assertNotNull(form.getTaskId());
- assertNull(form.getOwner());
-
- // 3. claim task as rossini, with role "User manager" granting entitlement to claim forms but not in group 7,
- // designated for approval in workflow definition: fail
- UserTO rossini = userService.read("1417acbe-cbf6-4277-9372-e75e04f97000");
- if (!rossini.getRoles().contains("User manager")) {
- UserPatch userPatch = new UserPatch();
- userPatch.setKey("1417acbe-cbf6-4277-9372-e75e04f97000");
- userPatch.getRoles().add(new StringPatchItem.Builder().
- operation(PatchOperation.ADD_REPLACE).value("User manager").build());
- rossini = updateUser(userPatch).getEntity();
- }
- assertTrue(rossini.getRoles().contains("User manager"));
-
- UserWorkflowService userService2 = clientFactory.create("rossini", ADMIN_PWD).
- getService(UserWorkflowService.class);
- try {
- userService2.claimForm(form.getTaskId());
- fail("This should not happen");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.Workflow, e.getType());
- }
-
- // 4. claim task from bellini, with role "User manager" and in group 7
- UserWorkflowService userService3 = clientFactory.create("bellini", ADMIN_PWD).
- getService(UserWorkflowService.class);
- form = userService3.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getOwner());
-
- // 5. reject user
- form.getProperty("approveCreate").get().setValue(Boolean.FALSE.toString());
- form.getProperty("rejectReason").get().setValue("I don't like him.");
- userTO = userService3.submitForm(form);
- assertNotNull(userTO);
- assertEquals("rejected", userTO.getStatus());
-
- // 6. check that rejected user was not propagated to external resource (SYNCOPE-364)
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- Exception exception = null;
- try {
- jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
- new String[] { userTO.getUsername() }, Integer.class);
- } catch (EmptyResultDataAccessException e) {
- exception = e;
- }
- assertNotNull(exception);
- }
-
- @Test
- public void createWithApproval() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- PagedResult<WorkflowFormTO> forms =
- userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- int preForms = forms.getTotalCount();
-
- UserTO userTO = UserITCase.getUniqueSampleTO("createWithApproval@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- // User with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
- userTO.getMemberships().add(
- new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
-
- // 1. create user and verify that no propagation occurred)
- ProvisioningResult<UserTO> result = createUser(userTO);
- assertNotNull(result);
- userTO = result.getEntity();
- assertEquals(1, userTO.getMemberships().size());
- assertEquals("0cbcabd2-4410-4b6b-8f05-a052b451d18f", userTO.getMemberships().get(0).getGroupKey());
- assertEquals("createApproval", userTO.getStatus());
- assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
-
- assertTrue(result.getPropagationStatuses().isEmpty());
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- Exception exception = null;
- try {
- jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
- new String[] { userTO.getUsername() }, Integer.class);
- } catch (EmptyResultDataAccessException e) {
- exception = e;
- }
- assertNotNull(exception);
-
- // 2. request if there is any pending form for user just created
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms + 1, forms.getTotalCount());
-
- // 3. as admin, request for changes: still pending approval
- String updatedUsername = "changed-" + UUID.randomUUID().toString();
- userTO.setUsername(updatedUsername);
- userWorkflowService.executeTask("default", userTO);
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getUserTO());
- assertEquals(updatedUsername, form.getUserTO().getUsername());
- assertNull(form.getUserPatch());
- assertNull(form.getOwner());
-
- // 4. claim task (as admin)
- form = userWorkflowService.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getUserTO());
- assertEquals(updatedUsername, form.getUserTO().getUsername());
- assertNull(form.getUserPatch());
- assertNotNull(form.getOwner());
-
- // 5. approve user (and verify that propagation occurred)
- form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals(updatedUsername, userTO.getUsername());
- assertEquals("active", userTO.getStatus());
- assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
-
- String username = queryForObject(
- jdbcTemplate, 50, "SELECT id FROM test WHERE id=?", String.class, userTO.getUsername());
- assertEquals(userTO.getUsername(), username);
-
- // 6. update user
- UserPatch userPatch = new UserPatch();
- userPatch.setKey(userTO.getKey());
- userPatch.setPassword(new PasswordPatch.Builder().value("anotherPassword123").build());
-
- userTO = updateUser(userPatch).getEntity();
- assertNotNull(userTO);
- }
-
- @Test
- public void updateApproval() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- PagedResult<WorkflowFormTO> forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build());
- int preForms = forms.getTotalCount();
-
- UserTO created = createUser(UserITCase.getUniqueSampleTO("updateApproval@syncope.apache.org")).getEntity();
- assertNotNull(created);
- assertEquals("/", created.getRealm());
- assertEquals(0, created.getMemberships().size());
-
- UserPatch patch = new UserPatch();
- patch.setKey(created.getKey());
- patch.getMemberships().add(new MembershipPatch.Builder().group("b1f7c12d-ec83-441f-a50e-1691daaedf3b").build());
-
- SyncopeClient client = clientFactory.create(created.getUsername(), "password123");
- Response response = client.getService(UserSelfService.class).update(patch);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertEquals("updateApproval", userService.read(created.getKey()).getStatus());
-
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms + 1, forms.getTotalCount());
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(created.getKey());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNull(form.getOwner());
- assertNotNull(form.getUserTO());
- assertNotNull(form.getUserPatch());
- assertEquals(patch, form.getUserPatch());
-
- // as admin, request for more changes: still pending approval
- patch.setRealm(new StringReplacePatchItem.Builder().value("/even/two").build());
- response = userService.update(patch);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertEquals("updateApproval", userService.read(created.getKey()).getStatus());
-
- // the patch is updated in the approval form
- form = userWorkflowService.getFormForUser(created.getKey());
- assertEquals(patch, form.getUserPatch());
-
- // approve the user
- form = userWorkflowService.claimForm(form.getTaskId());
- form.getProperty("approveUpdate").get().setValue(Boolean.TRUE.toString());
- userWorkflowService.submitForm(form);
-
- // verify that the approved user bears both original and further changes
- UserTO approved = userService.read(created.getKey());
- assertNotNull(approved);
- assertEquals("/even/two", approved.getRealm());
- assertEquals(1, approved.getMemberships().size());
- assertNotNull(approved.getMembership("b1f7c12d-ec83-441f-a50e-1691daaedf3b").get());
- }
-
- @Test
- public void availableTasks() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- UserTO user = createUser(UserITCase.getUniqueSampleTO("availableTasks@apache.org")).getEntity();
- assertEquals("active", user.getStatus());
-
- List<WorkflowTaskTO> tasks = userWorkflowService.getAvailableTasks(user.getKey());
- assertNotNull(tasks);
- assertTrue(tasks.stream().anyMatch(task -> "update".equals(task.getName())));
- assertTrue(tasks.stream().anyMatch(task -> "suspend".equals(task.getName())));
- assertTrue(tasks.stream().anyMatch(task -> "delete".equals(task.getName())));
- }
-
- @Test
- public void issueSYNCOPE15() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- PagedResult<WorkflowFormTO> forms = userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build());
- int preForms = forms.getTotalCount();
-
- UserTO userTO = UserITCase.getUniqueSampleTO("issueSYNCOPE15@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().clear();
- userTO.getMemberships().clear();
-
- // Users with group 0cbcabd2-4410-4b6b-8f05-a052b451d18f are defined in workflow as subject to approval
- userTO.getMemberships().add(
- new MembershipTO.Builder().group("0cbcabd2-4410-4b6b-8f05-a052b451d18f").build());
-
- // 1. create user with group 9 (and verify that no propagation occurred)
- userTO = createUser(userTO).getEntity();
- assertNotNull(userTO);
- assertNotEquals(0L, userTO.getKey());
- assertNotNull(userTO.getCreationDate());
- assertNotNull(userTO.getCreator());
- assertNotNull(userTO.getLastChangeDate());
- assertNotNull(userTO.getLastModifier());
- assertEquals(userTO.getCreationDate(), userTO.getLastChangeDate());
-
- // 2. request if there is any pending form for user just created
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms + 1, forms.getTotalCount());
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
-
- // 3. first claim by bellini ....
- UserWorkflowService userService3 = clientFactory.create("bellini", ADMIN_PWD).
- getService(UserWorkflowService.class);
- form = userService3.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getOwner());
-
- // 4. second claim task by admin
- form = userWorkflowService.claimForm(form.getTaskId());
- assertNotNull(form);
-
- // 5. approve user
- form.getProperty("approveCreate").get().setValue(Boolean.TRUE.toString());
-
- // 6. submit approve
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals(
- preForms,
- userWorkflowService.getForms(
- new WorkflowFormQuery.Builder().page(1).size(1000).build()).getTotalCount());
- assertNull(userWorkflowService.getFormForUser(userTO.getKey()));
-
- // 7.check that no more forms are still to be processed
- forms = userWorkflowService.getForms(new WorkflowFormQuery.Builder().page(1).size(1000).build());
- assertEquals(preForms, forms.getTotalCount());
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java
deleted file mode 100644
index 3a921f9..0000000
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/WorkflowITCase.java
+++ /dev/null
@@ -1,74 +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.
- */
-package org.apache.syncope.fit.core;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.Optional;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.fit.AbstractITCase;
-import org.apache.syncope.fit.FlowableDetector;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-public class WorkflowITCase extends AbstractITCase {
-
- private static String defaultUserKey = null;
-
- @BeforeAll
- public static void findDefault() {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
- Optional<WorkflowDefinitionTO> found = workflowService.list(AnyTypeKind.USER.name()).stream().
- filter(object -> object.isMain()).findAny();
- if (found.isPresent()) {
- defaultUserKey = found.get().getKey();
- }
- assertNotNull(defaultUserKey);
- }
-
- @Test
- public void exportUserDefinition() throws IOException {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
- Response response = workflowService.get(AnyTypeKind.USER.name(), defaultUserKey);
- assertTrue(response.getMediaType().toString().
- startsWith(clientFactory.getContentType().getMediaType().toString()));
- assertTrue(response.getEntity() instanceof InputStream);
- String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
- assertNotNull(definition);
- assertFalse(definition.isEmpty());
- }
-
- @Test
- public void updateUserDefinition() throws IOException {
- assumeTrue(FlowableDetector.isFlowableEnabledForUsers(syncopeService));
- Response response = workflowService.get(AnyTypeKind.USER.name(), defaultUserKey);
- String definition = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8);
-
- workflowService.set(AnyTypeKind.USER.name(), defaultUserKey, definition);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/resources/addFlowableToContent.xsl
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/addFlowableToContent.xsl b/fit/core-reference/src/test/resources/addFlowableToContent.xsl
index 746580d..7bb0d1e 100644
--- a/fit/core-reference/src/test/resources/addFlowableToContent.xsl
+++ b/fit/core-reference/src/test/resources/addFlowableToContent.xsl
@@ -24,19 +24,19 @@
<dataset>
<xsl:apply-templates/>
- <ACT_RU_EXECUTION ID_="4" REV_="2" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="4" REV_="2" PROC_INST_ID_="4" BUSINESS_KEY_="userWorkflow:1417acbe-cbf6-4277-9372-e75e04f97000" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="5" REV_="2" EXECUTION_ID_="4" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="6" REV_="2" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="6" REV_="2" PROC_INST_ID_="6" BUSINESS_KEY_="userWorkflow:74cd8ece-715a-44a4-a736-e17b46c4e7e6" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="7" REV_="2" EXECUTION_ID_="6" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="8" REV_="2" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="8" REV_="2" PROC_INST_ID_="8" BUSINESS_KEY_="userWorkflow:b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="9" REV_="2" EXECUTION_ID_="8" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="10" REV_="2" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="10" REV_="2" PROC_INST_ID_="10" BUSINESS_KEY_="userWorkflow:c9b2dec2-00a7-4855-97c0-d854842b4b24" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="11" REV_="2" EXECUTION_ID_="10" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- <ACT_RU_EXECUTION ID_="12" REV_="2" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_EXECUTION ID_="12" REV_="2" PROC_INST_ID_="12" BUSINESS_KEY_="userWorkflow:823074dc-d280-436d-a7dd-07399fae48ec" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
<ACT_RU_TASK ID_="13" REV_="2" EXECUTION_ID_="12" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
</dataset>
</xsl:template>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/console.properties b/fit/core-reference/src/test/resources/console.properties
index 4d39cf0..6e47934 100644
--- a/fit/core-reference/src/test/resources/console.properties
+++ b/fit/core-reference/src/test/resources/console.properties
@@ -33,15 +33,12 @@ maxWaitTimeOnApplyChanges=30
csrf=false
-flowableModelerDirectory=${flowable-modeler.directory}
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
page.realms=org.apache.syncope.client.console.pages.Realms
page.topology=org.apache.syncope.client.console.topology.Topology
page.reports=org.apache.syncope.client.console.pages.Reports
-page.workflow=org.apache.syncope.client.console.pages.Workflow
page.audit=org.apache.syncope.client.console.pages.Audit
page.implementations=org.apache.syncope.client.console.pages.Implementations
page.logs=org.apache.syncope.client.console.pages.Logs
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/fit/core-reference/src/test/resources/hotswap-agent.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/hotswap-agent.properties b/fit/core-reference/src/test/resources/hotswap-agent.properties
index aa6d8e8..b834eb6 100644
--- a/fit/core-reference/src/test/resources/hotswap-agent.properties
+++ b/fit/core-reference/src/test/resources/hotswap-agent.properties
@@ -32,8 +32,15 @@ ${basedir}/../../core/provisioning-api/target/classes,\
${basedir}/../../core/provisioning-java/target/classes/org,\
${basedir}/../../core/workflow-api/target/classes,\
${basedir}/../../core/workflow-java/target/classes/org,\
-${basedir}/../../core/workflow-activiti/target/classes/org,\
-${basedir}/../../core/migration/target/classes,\
+${basedir}/../../ext/flowable/common-lib/target/classes,\
+${basedir}/../../ext/flowable/flowable-bpmn/target/classes/org,\
+${basedir}/../../ext/flowable/logic/target/classes,\
+${basedir}/../../ext/flowable/persistence-api/target/classes,\
+${basedir}/../../ext/flowable/persistence-jpa/target/classes/org/apache/syncope/core/persistence/jpa/dao,\
+${basedir}/../../ext/flowable/provisioning-api/target/classes,\
+${basedir}/../../ext/flowable/provisioning-java/target/classes,\
+${basedir}/../../ext/flowable/rest-api/target/classes,\
+${basedir}/../../ext/flowable/rest-cxf/target/classes/org,\
${basedir}/../../ext/camel/common-lib/target/classes,\
${basedir}/../../ext/camel/logic/target/classes,\
${basedir}/../../ext/camel/provisioning-camel/target/classes/org,\
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java b/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
index f5944b0..c0dfc65 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/ConsolePom.java
@@ -22,88 +22,10 @@ public final class ConsolePom {
public static final String FLOWABLE_PLACEHOLDER = "</dependencies>";
- public static final String FLOWABLE_CONTENT_TO_ADD = "<dependency>\n"
- + " <groupId>org.flowable</groupId>\n"
- + " <artifactId>flowable-ui-modeler-app</artifactId>\n"
- + " <type>war</type>\n"
- + " <scope>test</scope>\n"
- + " </dependency>\n"
- + " </dependencies>\n";
-
- public static final String MODELER_PLACEHOLDER = "</finalName>";
-
- public static final String MODELER_CONTENT_TO_ADD = "</finalName><plugins>\n"
- + " <plugin>\n"
- + " <groupId>org.apache.maven.plugins</groupId>\n"
- + " <artifactId>maven-antrun-plugin</artifactId>\n"
- + " <inherited>true</inherited>\n"
- + " <executions>\n"
- + " <execution>\n"
- + " <id>setupFlowableModeler</id>\n"
- + " <phase>process-resources</phase>\n"
- + " <configuration>\n"
- + " <target>\n"
- + " <unzip src=\"${settings.localRepository}/org/flowable/flowable-ui-modeler-app/"
- + "${flowable.version}/flowable-ui-modeler-app-${flowable.version}.war\" \n"
- + " dest=\"${flowable-modeler.directory}\">\n" + " <patternset>\n"
- + " <include name=\"WEB-INF/classes/static/**\"/>\n"
- + " <include name=\"WEB-INF/lib/flowable-ui-modeler-logic-${flowable.version}.jar\"/>\n"
- + " </patternset>\n" + " </unzip>\n" + " \n"
- + " <unzip src=\"${flowable-modeler.directory}/WEB-INF/lib/"
- + "flowable-ui-modeler-logic-${flowable.version}.jar\"\n"
- + " dest=\"${flowable-modeler.directory}\">\n" + " <patternset>\n"
- + " <include name=\"stencilset_bpmn.json\"/>\n" + " </patternset>\n"
- + " </unzip>\n" + " \n"
- + " <move todir=\"${flowable-modeler.directory}\">\n"
- + " <fileset dir=\"${flowable-modeler.directory}/WEB-INF/classes/static/\">\n"
- + " <include name=\"**\"/>\n" + " </fileset>\n"
- + " </move>\n"
- + " <delete dir=\"${flowable-modeler.directory}/WEB-INF\"/>\n"
- + " \n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\"</head>\"\n"
- + " value=\"<script type="text/javascript">window.onunload = "
- + "refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>"
- + "\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\" ng-click="backToLanding()"\"\n"
- + " value=\" disabled="disabled"\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\"<ul class="nav navbar-nav" id="main-nav"\"\n"
- + " value=\"<ul class="nav navbar-nav" id="main-nav" "
- + "style="display: none;"\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/index.html\"\n"
- + " token=\"<div class="pull-right\"\n"
- + " value=\"<div style="display: none;" class="pull-right\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/editor-app/editor.html\"\n"
- + " token=\"<div class="btn-group pull-right"\"\n"
- + " value=\"<div style="display: none;" class="btn-group "
- + "pull-right"\"/>\n"
- + " <replace file=\"${flowable-modeler.directory}/editor-app/configuration/"
- + "toolbar-default-actions.js\"\n"
- + " token=\"$location.path('/processes');\"\n"
- + " value=\"window.close();\"/>\n" + " \n"
- + " <copy file=\"${basedir}/src/main/resources/app-cfg.js\" \n"
- + " todir=\"${flowable-modeler.directory}/scripts\"\n"
- + " overwrite=\"true\"/>\n"
- + " <copy file=\"${basedir}/src/main/resources/url-config.js\" \n"
- + " todir=\"${flowable-modeler.directory}/editor-app/configuration\"\n"
- + " overwrite=\"true\"/>\n"
- + " <copy file=\"${basedir}/src/main/resources/toolbar.js\" \n"
- + " todir=\"${flowable-modeler.directory}/editor-app/configuration\"\n"
- + " overwrite=\"true\"/>\n"
- + " <copy file=\"${basedir}/src/main/resources/save-model.html\" \n"
- + " todir=\"${flowable-modeler.directory}/editor-app/popups\"\n"
- + " overwrite=\"true\"/>"
- + " </target>\n"
- + " </configuration>\n"
- + " <goals>\n"
- + " <goal>run</goal>\n"
- + " </goals>\n"
- + " </execution>\n"
- + " </executions>\n"
- + " </plugin>\n"
- + " </plugins>";
+ public static final String FLOWABLE_CONTENT_TO_ADD = " <dependency>\n"
+ + " <groupId>org.apache.syncope.ext.flowable</groupId>\n"
+ + " <artifactId>syncope-ext-flowable-client-console</artifactId>\n"
+ + " <version>${project.version}</version>\n" + " </dependency>\n";
private ConsolePom() {
// private constructor for static utility class
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
index faeb5af..044da8a 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
@@ -32,9 +32,9 @@ public final class CorePom {
public static final String FLOWABLE_PLACEHOLDER = "</dependencies>";
public static final String FLOWABLE_CONTENT_TO_ADD = " <dependency>\n"
- + " <groupId>org.apache.syncope.core</groupId>\n"
- + " <artifactId>syncope-core-workflow-flowable</artifactId>\n"
- + " </dependency>\n"
+ + " <groupId>org.apache.syncope.ext.flowable</groupId>\n"
+ + " <artifactId>syncope-ext-flowable-rest-cxf</artifactId>\n"
+ + " </dependency>\n"
+ " </dependencies>\n";
private CorePom() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
index a530867..e1c43b4 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
@@ -41,18 +41,17 @@ public class ArchetypeProcess extends BaseProcess {
final String confDirectory = args[6];
final String logsDirectory = args[7];
final String bundlesDirectory = args[8];
- final String modelerDirectory = args[9];
- final String syncopeVersion = args[10];
- final String syncopeAdminPassword = args[11];
- final boolean isProxyEnabled = Boolean.valueOf(args[12]);
- final String proxyHost = args[13];
- final String proxyPort = args[14];
- final String proxyUser = args[15];
- final String proxyPwd = args[16];
- final boolean mavenProxyAutoconf = Boolean.valueOf(args[17]);
- final boolean swagger = Boolean.valueOf(args[18]);
- final boolean flowable = Boolean.valueOf(args[19]);
- final String jwsKey = args[20];
+ final String syncopeVersion = args[9];
+ final String syncopeAdminPassword = args[10];
+ final boolean isProxyEnabled = Boolean.valueOf(args[11]);
+ final String proxyHost = args[12];
+ final String proxyPort = args[13];
+ final String proxyUser = args[14];
+ final String proxyPwd = args[15];
+ final boolean mavenProxyAutoconf = Boolean.valueOf(args[16]);
+ final boolean swagger = Boolean.valueOf(args[17]);
+ final boolean flowable = Boolean.valueOf(args[18]);
+ final String jwsKey = args[19];
setSyncopeInstallDir(installPath, artifactId);
@@ -103,7 +102,6 @@ public class ArchetypeProcess extends BaseProcess {
fileSystemUtils.createDirectory(confDirectory);
fileSystemUtils.createDirectory(logsDirectory);
fileSystemUtils.createDirectory(bundlesDirectory);
- fileSystemUtils.createDirectory(modelerDirectory);
if (flowable) {
File pomFile = new File(
@@ -129,15 +127,13 @@ public class ArchetypeProcess extends BaseProcess {
contentPomFile = fileSystemUtils.readFile(pomFile);
fileSystemUtils.writeToFile(
pomFile,
- contentPomFile.replace(ConsolePom.FLOWABLE_PLACEHOLDER, ConsolePom.FLOWABLE_CONTENT_TO_ADD).
- replace(ConsolePom.MODELER_PLACEHOLDER, ConsolePom.MODELER_CONTENT_TO_ADD));
+ contentPomFile.replace(ConsolePom.FLOWABLE_PLACEHOLDER, ConsolePom.FLOWABLE_CONTENT_TO_ADD));
}
final Properties syncopeProperties = new Properties();
syncopeProperties.setProperty("conf.directory", confDirectory);
syncopeProperties.setProperty("log.directory", logsDirectory);
syncopeProperties.setProperty("bundles.directory", bundlesDirectory);
- syncopeProperties.setProperty("flowable-modeler.directory", modelerDirectory);
mavenUtils.mvnCleanPackageWithProperties(
installPath + File.separator + artifactId, syncopeProperties, customMavenProxySettings);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
index 0429c30..6f5c79a 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
@@ -73,8 +73,6 @@ public final class ContainerProcess extends BaseProcess {
private String bundlesDirectory;
- private String modelerDirectory;
-
private boolean withDataSource;
private boolean jbossSsl;
@@ -83,8 +81,6 @@ public final class ContainerProcess extends BaseProcess {
private String jbossPort;
- private String jbossJdbcModuleName;
-
private String jbossAdminUsername;
private String jbossAdminPassword;
@@ -121,21 +117,19 @@ public final class ContainerProcess extends BaseProcess {
confDirectory = args[13];
logsDirectory = args[14];
bundlesDirectory = args[15];
- modelerDirectory = args[16];
- withDataSource = Boolean.valueOf(args[17]);
- jbossSsl = Boolean.valueOf(args[18]);
- jbossHost = args[19];
- jbossPort = args[20];
- jbossJdbcModuleName = args[21];
- jbossAdminUsername = args[22];
- jbossAdminPassword = args[23];
- jbossManagementPort = args[24];
- isProxyEnabled = Boolean.valueOf(args[25]);
- proxyHost = args[26];
- proxyPort = args[27];
- proxyUser = args[28];
- proxyPwd = args[29];
- mavenProxyAutoconf = Boolean.valueOf(args[30]);
+ withDataSource = Boolean.valueOf(args[16]);
+ jbossSsl = Boolean.valueOf(args[17]);
+ jbossHost = args[18];
+ jbossPort = args[19];
+ jbossAdminUsername = args[20];
+ jbossAdminPassword = args[21];
+ jbossManagementPort = args[22];
+ isProxyEnabled = Boolean.valueOf(args[23]);
+ proxyHost = args[24];
+ proxyPort = args[25];
+ proxyUser = args[26];
+ proxyPwd = args[27];
+ mavenProxyAutoconf = Boolean.valueOf(args[28]);
handler.logOutput("Configure web.xml file according to " + selectedContainer + " properties", true);
InstallLog.getInstance().info("Configure web.xml file according to " + selectedContainer + " properties");
@@ -211,7 +205,6 @@ public final class ContainerProcess extends BaseProcess {
mvnProperties.setProperty("conf.directory", confDirectory);
mvnProperties.setProperty("log.directory", logsDirectory);
mvnProperties.setProperty("bundles.directory", bundlesDirectory);
- mvnProperties.setProperty("flowable-modeler.directory", modelerDirectory);
mavenUtils.mvnCleanPackageWithProperties(
installPath + File.separator + artifactId, mvnProperties, customMavenProxySettings);
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
index 2bbde9b..07de880 100644
--- a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
+++ b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
@@ -35,18 +35,17 @@ under the License.
<arg>$mvn.conf.directory</arg><!-- 6 -->
<arg>$mvn.log.directory</arg><!-- 7 -->
<arg>$mvn.bundle.directory</arg><!-- 8 -->
- <arg>$mvn.modeler.directory</arg><!-- 9 -->
- <arg>$mvn.syncope.version</arg><!-- 10 -->
- <arg>$mvn.syncope.admin.password</arg><!-- 11 -->
- <arg>$mvn.proxy</arg><!-- 12 -->
- <arg>$mvn.proxy.host</arg><!-- 13 -->
- <arg>$mvn.proxy.port</arg><!-- 14 -->
- <arg>$mvn.proxy.user</arg><!-- 15 -->
- <arg>$mvn.proxy.pwd</arg><!-- 16 -->
- <arg>$mvn.proxy.autoconf</arg><!-- 17 -->
- <arg>$options.swagger</arg><!-- 18 -->
- <arg>$options.flowable.workflow.adapter</arg><!-- 19 -->
- <arg>$mvn.jws.key</arg><!-- 20 -->
+ <arg>$mvn.syncope.version</arg><!-- 9 -->
+ <arg>$mvn.syncope.admin.password</arg><!-- 10 -->
+ <arg>$mvn.proxy</arg><!-- 11 -->
+ <arg>$mvn.proxy.host</arg><!-- 12 -->
+ <arg>$mvn.proxy.port</arg><!-- 13 -->
+ <arg>$mvn.proxy.user</arg><!-- 14 -->
+ <arg>$mvn.proxy.pwd</arg><!-- 15 -->
+ <arg>$mvn.proxy.autoconf</arg><!-- 16 -->
+ <arg>$options.swagger</arg><!-- 17 -->
+ <arg>$options.flowable.workflow.adapter</arg><!-- 18 -->
+ <arg>$mvn.jws.key</arg><!-- 19 -->
</executeclass>
</job>
<job name="Persistence configuration...">
@@ -79,21 +78,19 @@ under the License.
<arg>$mvn.conf.directory</arg><!-- 13 -->
<arg>$mvn.log.directory</arg><!-- 14 -->
<arg>$mvn.bundle.directory</arg><!-- 15 -->
- <arg>$mvn.modeler.directory</arg><!-- 16 -->
- <arg>$with.datasuorce</arg><!-- 17 -->
- <arg>$jboss.container.ssl</arg><!-- 18 -->
- <arg>$jboss.container.host</arg><!-- 19 -->
- <arg>$jboss.container.port</arg><!-- 20 -->
- <arg>$jboss.container.jdbc.module</arg><!-- 21 -->
- <arg>$jboss.container.user</arg><!-- 22 -->
- <arg>$jboss.container.pwd</arg><!-- 23 -->
- <arg>$jboss.container.management.port</arg><!-- 24 -->
- <arg>$mvn.proxy</arg><!-- 25 -->
- <arg>$mvn.proxy.host</arg><!-- 26 -->
- <arg>$mvn.proxy.port</arg><!-- 27 -->
- <arg>$mvn.proxy.user</arg><!-- 28 -->
- <arg>$mvn.proxy.pwd</arg><!-- 29 -->
- <arg>$mvn.proxy.autoconf</arg><!-- 30 -->
+ <arg>$with.datasuorce</arg><!-- 16 -->
+ <arg>$jboss.container.ssl</arg><!-- 17 -->
+ <arg>$jboss.container.host</arg><!-- 18 -->
+ <arg>$jboss.container.port</arg><!-- 19 -->
+ <arg>$jboss.container.user</arg><!-- 20 -->
+ <arg>$jboss.container.pwd</arg><!-- 21 -->
+ <arg>$jboss.container.management.port</arg><!-- 22 -->
+ <arg>$mvn.proxy</arg><!-- 23 -->
+ <arg>$mvn.proxy.host</arg><!-- 24 -->
+ <arg>$mvn.proxy.port</arg><!-- 25 -->
+ <arg>$mvn.proxy.user</arg><!-- 26 -->
+ <arg>$mvn.proxy.pwd</arg><!-- 27 -->
+ <arg>$mvn.proxy.autoconf</arg><!-- 28 -->
</executeclass>
</job>
<onFail previous="true" next="false" />
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/resources/izpack/userInputLang.xml_eng
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_eng b/installer/src/main/resources/izpack/userInputLang.xml_eng
index 2bf1e2c..8d7ca08 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_eng
+++ b/installer/src/main/resources/izpack/userInputLang.xml_eng
@@ -32,7 +32,6 @@ under the License.
<str id="archetype.mvn.conf.directory" txt="Conf directory name:"/>
<str id="archetype.mvn.log.directory" txt="Log directory name:"/>
<str id="archetype.mvn.bundle.directory" txt="Bundle directory name:"/>
- <str id="archetype.mvn.modeler.directory" txt="Flowable modeler directory name:"/>
<str id="mvn.syncope.version.id" txt="Syncope Version:"/>
<str id="mvn.syncope.admin.password.id" txt="Admin Password:"/>
<str id="mvn.proxy.id" txt="Use Proxy Server:"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/resources/izpack/userInputLang.xml_ita
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_ita b/installer/src/main/resources/izpack/userInputLang.xml_ita
index 1cbad84..fd9f26f 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_ita
+++ b/installer/src/main/resources/izpack/userInputLang.xml_ita
@@ -32,7 +32,6 @@ under the License.
<str id="archetype.mvn.conf.directory" txt="Conf directory name:"/>
<str id="archetype.mvn.log.directory" txt="Log directory name:"/>
<str id="archetype.mvn.bundle.directory" txt="Bundle directory name:"/>
- <str id="archetype.mvn.modeler.directory" txt="Flowable modeler directory name:"/>
<str id="mvn.syncope.version.id" txt="Syncope Version:"/>
<str id="mvn.syncope.admin.password.id" txt="Admin Password:"/>
<str id="mvn.proxy.id" txt="Usa un Server Proxy:"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/installer/src/main/resources/izpack/userInputSpec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputSpec.xml b/installer/src/main/resources/izpack/userInputSpec.xml
index b55cb5b..18844fc 100644
--- a/installer/src/main/resources/izpack/userInputSpec.xml
+++ b/installer/src/main/resources/izpack/userInputSpec.xml
@@ -122,9 +122,6 @@ under the License.
<spec id="options.flowable.workflow.adapter.id" true="true" false="false" set="true"/>
</field>
<field type="space"/>
- <field type="dir" variable="mvn.modeler.directory" conditionid="options.choice.flowable">
- <spec id="archetype.mvn.modeler.directory" size="20" set="/var/tmp/syncope/modeler" mustExist="false" create="true"/>
- </field>
</panel>
<panel id="persistence">
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 04597e5..b60db09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -439,7 +439,6 @@ under the License.
<bundles.directory>${project.build.directory}/bundles</bundles.directory>
<connid.location>file:${bundles.directory}/</connid.location>
<log.directory>${project.build.directory}/log</log.directory>
- <flowable-modeler.directory>${project.build.directory}/flowable-modeler</flowable-modeler.directory>
<swagger-core.version>2.0.5</swagger-core.version>
<swagger-ui.version>3.18.2</swagger-ui.version>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 b7b339b..fae85c9 100644
--- a/src/main/asciidoc/reference-guide/concepts/workflow.adoc
+++ b/src/main/asciidoc/reference-guide/concepts/workflow.adoc
@@ -196,58 +196,3 @@ 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
-retention 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/2_1_X/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 were 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"
- flowable:formKey="recertify"
- flowable:candidateGroups="managingDirector">
-----
-====
-
-.Certifier is the manager defined in the user's `lastRecertificator` attribute
-====
-[source,xml]
-----
-<userTask id="recertificationRequest" name="Recertification Request"
- flowable:formKey="recertify"
- flowable:candidateUser="${user.lastRecertificator}">
-----
-====
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
index 22b0b7c..44d52ca 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/customization.adoc
@@ -278,14 +278,25 @@ Add the following dependency to `core/pom.xml`:
[source,xml,subs="verbatim,attributes"]
----
<dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-rest-cxf</artifactId>
<version>${syncope.version}</version>
</dependency>
----
Copy `core/src/main/resources/all/workflow.properties` to `core/src/main/resources/workflow.properties`.
+Add the following dependency to `console/pom.xml`:
+
+[source,xml,subs="verbatim,attributes"]
+----
+<dependency>
+ <groupId>org.apache.syncope.ext.flowable</groupId>
+ <artifactId>syncope-ext-flowable-client-console</artifactId>
+ <version>${syncope.version}</version>
+</dependency>
+----
+
[discrete]
===== Enable the <<apache-camel-provisioning-manager>>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/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 6a8a468..7ba4a4d 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/configurationparameters.adoc
@@ -50,8 +50,6 @@ mechanism to work properly;
Suspended Users are anyway not allowed to authenticate.
* `log.lastlogindate` - whether the system updates the `lastLoginDate` field of users upon authentication;
* `return.password.value` - whether the hashed password value shall be returned when reading users;
-* `identity.recertification.day.interval` - number of days between
-<<identity-recertification,identity recertifications>>;
* `connector.conf.history.size` - how many previous configurations shall be kept for each Connector Instance,
for usage with <<connectors-resources-history, connectors and resources configuration history management>>;
* `resource.conf.history.size` - how many previous configurations shall be kept for each External Resource,
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc
deleted file mode 100644
index 6cf0e68..0000000
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/flowablemodeler.adoc
+++ /dev/null
@@ -1,46 +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.
-//
-==== Enable the Flowable Modeler
-
-Due to licensing issues - see
-https://issues.apache.org/jira/browse/SYNCOPE-439?focusedCommentId=13829896&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13829896[this comment^]
-for more information - it is not possible to embed the
-http://www.flowable.org/docs/userguide/index.html#flowableModelerApp[Flowable Modeler^], which provides a powerful
-graphical web editing interface for Flowable, into any Apache Syncope artifact; thus, some manual steps are required to enable it on a
-working Apache Syncope deployment, for use with the Admin Console.
-
-[WARNING]
-This procedure requires Apache Maven since it is using a fake project to perform all of the required setup tasks.
-
-First of all, generate a new Maven project as described in the
-ifeval::["{backend}" == "html5"]
-http://syncope.apache.org/docs/getting-started.html[Apache Syncope Getting Started Guide,]
-endif::[]
-ifeval::["{backend}" == "pdf"]
-http://syncope.apache.org/docs/getting-started.pdf[Apache Syncope Getting Started Guide,]
-endif::[]
-then build via
-
-....
-$ mvn -P all clean install
-....
-
-At this point, copy the `console/target/flowable-modeler/` directory in the desired location of the host where the
-admin console is deployed, then set the value of `flowableModelerDirectory` with this path in the `console.properties`
-file.
[32/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
index 71e5ef4..ac3a256 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
@@ -42,8 +42,6 @@ import org.apache.syncope.common.lib.to.AccessTokenTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.event.IEvent;
@@ -100,12 +98,8 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
header = ((AccessTokenTO) modelObject).getOwner();
} else if (modelObject instanceof ExecTO) {
header = ((ExecTO) modelObject).getKey();
- } else if (modelObject instanceof WorkflowDefinitionTO) {
- header = ((WorkflowDefinitionTO) modelObject).getName();
} else if (modelObject instanceof ProvisioningTaskTO) {
header = ((ProvisioningTaskTO) modelObject).getName();
- } else if (modelObject instanceof WorkflowFormTO) {
- header = ((WorkflowFormTO) modelObject).getKey();
} else if (modelObject instanceof EntityTO) {
header = ((EntityTO) modelObject).getKey();
} else if (modelObject instanceof StatusBean) {
@@ -121,6 +115,8 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
? ((JobTO) modelObject).getRefDesc() : ((JobTO) modelObject).getRefKey();
} else if (modelObject instanceof ResourceProvision) {
header = ((ResourceProvision) modelObject).getAnyType();
+ } else if (modelObject instanceof EntityTO) {
+ header = ((EntityTO) modelObject).getKey();
} else {
header = new ResourceModel("actions", StringUtils.EMPTY).getObject();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
index 6b98619..a4d8775 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.java
@@ -87,7 +87,7 @@ public final class ActionPanel<T extends Serializable> extends Panel {
public void onClick(final AjaxRequestTarget target) {
}
};
- } else if (action.getType() == ActionType.WORKFLOW_MODELER) {
+ } else if (action.getType() == ActionType.EXTERNAL_EDITOR) {
enabled = action.getLink().isEnabled(obj);
actionLink = new BookmarkablePageLink<>(
"action", action.getLink().getPageClass(), action.getLink().getPageParameters()).
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
deleted file mode 100644
index ee47619..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ApprovalsWidget.java
+++ /dev/null
@@ -1,128 +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.
- */
-package org.apache.syncope.client.console.widgets;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.image.Icon;
-import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconTypeBuilder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.pages.Approvals;
-import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
-import org.apache.syncope.client.console.wicket.ajax.IndicatorAjaxTimerBehavior;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.util.ListModel;
-import org.apache.wicket.util.time.Duration;
-
-public class ApprovalsWidget extends AlertWidget<WorkflowFormTO> {
-
- private static final long serialVersionUID = 7667120094526529934L;
-
- private final UserWorkflowRestClient restClient = new UserWorkflowRestClient();
-
- private final List<WorkflowFormTO> lastApprovals = new ArrayList<>();
-
- public ApprovalsWidget(final String id, final PageReference pageRef) {
- super(id);
- setOutputMarkupId(true);
-
- latestAlertsList.add(new IndicatorAjaxTimerBehavior(Duration.seconds(30)) {
-
- private static final long serialVersionUID = 7298597675929755960L;
-
- @Override
- protected void onTimer(final AjaxRequestTarget target) {
- if (!latestAlerts.getObject().equals(lastApprovals)) {
- refreshLatestAlerts(target);
- }
- }
- });
- }
-
- public final void refreshLatestAlerts(final AjaxRequestTarget target) {
- latestAlerts.getObject().clear();
- latestAlerts.getObject().addAll(lastApprovals);
-
- int latestAlertSize = getLatestAlertsSize();
- linkAlertsNumber.setDefaultModelObject(latestAlertSize);
- target.add(linkAlertsNumber);
-
- headerAlertsNumber.setDefaultModelObject(latestAlertSize);
- target.add(headerAlertsNumber);
-
- target.add(latestAlertsList);
-
- lastApprovals.clear();
- lastApprovals.addAll(latestAlerts.getObject());
- }
-
- @Override
- protected int getLatestAlertsSize() {
- return SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_LIST)
- && SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_READ)
- ? restClient.countForms()
- : 0;
- }
-
- @Override
- protected IModel<List<WorkflowFormTO>> getLatestAlerts() {
- return new ListModel<WorkflowFormTO>() {
-
- private static final long serialVersionUID = -2583290457773357445L;
-
- @Override
- public List<WorkflowFormTO> getObject() {
- List<WorkflowFormTO> updatedApprovals;
- if (SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_LIST)
- && SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_READ)) {
-
- updatedApprovals = restClient.getForms(1, MAX_SIZE, new SortParam<>("createTime", true));
- } else {
- updatedApprovals = Collections.<WorkflowFormTO>emptyList();
- }
-
- return updatedApprovals;
- }
- };
- }
-
- @Override
- protected AbstractLink getEventsLink(final String linkid) {
- BookmarkablePageLink<Approvals> approvals = BookmarkablePageLinkBuilder.build(linkid, Approvals.class);
- MetaDataRoleAuthorizationStrategy.authorize(approvals, WebPage.ENABLE, StandardEntitlement.WORKFLOW_FORM_LIST);
- return approvals;
- }
-
- @Override
- protected Icon getIcon(final String iconid) {
- return new Icon(iconid,
- FontAwesomeIconTypeBuilder.on(FontAwesomeIconTypeBuilder.FontAwesomeGraphic.handshake_o).build());
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java
new file mode 100644
index 0000000..1453fa9
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ExtAlertWidget.java
@@ -0,0 +1,30 @@
+/*
+ * 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.client.console.widgets;
+
+import java.io.Serializable;
+
+public abstract class ExtAlertWidget<T extends Serializable> extends AlertWidget<T> {
+
+ private static final long serialVersionUID = -5622060468533516192L;
+
+ public ExtAlertWidget(final String id) {
+ super(id);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/console.properties b/client/console/src/main/resources/console.properties
index 3139c1c..f8a6467 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -33,15 +33,12 @@ maxWaitTimeOnApplyChanges=30
csrf=true
-flowableModelerDirectory=${flowable-modeler.directory}
-
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
page.dashboard=org.apache.syncope.client.console.pages.Dashboard
page.realms=org.apache.syncope.client.console.pages.Realms
page.topology=org.apache.syncope.client.console.topology.Topology
page.reports=org.apache.syncope.client.console.pages.Reports
-page.workflow=org.apache.syncope.client.console.pages.Workflow
page.audit=org.apache.syncope.client.console.pages.Audit
page.implementations=org.apache.syncope.client.console.pages.Implementations
page.logs=org.apache.syncope.client.console.pages.Logs
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
deleted file mode 100644
index 64805b9..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.html
+++ /dev/null
@@ -1,31 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div wicket:id="propView">
- <span wicket:id="value">[value]</span>
- </div>
-
- <div style="margin: 20px 0">
- <a href="#" alt="user details" class="btn btn-primary btn-circle btn-lg" wicket:id="userDetails" wicket:message="title:userDetails">
- <i class="glyphicon glyphicon-eye-open"></i>
- </a>
- </div>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
deleted file mode 100644
index 450ff50..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=User details
-userForm=Edit User
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
deleted file mode 100644
index 1de2361..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalDetails.html
+++ /dev/null
@@ -1,23 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <span wicket:id="wizard"/>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
deleted file mode 100644
index 5d5d129..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.html
+++ /dev/null
@@ -1,23 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <span wicket:id="approval">[APPROVAL]</span>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_it.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
deleted file mode 100644
index 84106b9..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ja.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=\u627f\u8a8d\u8a73\u7d30
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_pt_BR.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
deleted file mode 100644
index 941c896..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/ApprovalModal_ru.properties
+++ /dev/null
@@ -1,17 +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.
-approval.details=Approval details
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
deleted file mode 100644
index 92c475d..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_it.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=Dettagli utente
-userForm=Modifica utente
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
deleted file mode 100644
index 5a9cc2d..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ja.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=\u30e6\u30fc\u30b6\u30fc\u8a73\u7d30
-userForm=\u30e6\u30fc\u30b6\u30fc\u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
deleted file mode 100644
index 00a8971..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_pt_BR.properties
+++ /dev/null
@@ -1,18 +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.
-userDetails=Detalhes do Usu\u00e1rio
-userForm=Detalhes do Usu\u00e1rio
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
deleted file mode 100644
index 02c159a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/approvals/Approval_ru.properties
+++ /dev/null
@@ -1,20 +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.
-#
-# userDetails=\u00d0\u0098\u00d0\u00bd\u00d1\u0084\u00d0\u00be\u00d1\u0080\u00d0\u00bc\u00d0\u00b0\u00d1\u0086\u00d0\u00b8\u00d1\u008f \u00d0\u00be \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5
-userDetails=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
-userForm=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
deleted file mode 100644
index 5bf6234..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.html
+++ /dev/null
@@ -1,35 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <section class="content-header">
- <h1> </h1>
- <ol class="breadcrumb">
- <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard">[DASHBOARD]</wicket:message></a></li>
- <li class="active"><wicket:message key="approvals"/></li>
- </ol>
- </section>
-
- <section class="content" wicket:id="content">
- <div class="box">
- <div class="box-body" wicket:id="wfPanel"/>
- </div>
- </section>
- </wicket:extend>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
deleted file mode 100644
index 1ea8063..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=Task
-key=Key
-description=Description
-createTime=Create Time
-dueDate=Due Date
-owner=Owner
-claim=Claim
-manage=Manage
-approvals=Approvals
-delete=Delete
-type=Type
-username=Username
-new_user=New User
-creationDate = Creation Date
-claimDate = Claim Dare
-approval.edit=Approval Edit
-approval.manage=Approval Manage
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
deleted file mode 100644
index 7e12ce5..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_it.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=Task
-key=Chiave
-description=Descrizione
-createTime=Data di creazione
-dueDate=Scadenza
-owner=Esecutore
-claim=Richiedi
-manage=Gestisci
-approvals=Approvazioni
-delete=Rimuovi
-type=Tipo
-username=Utente
-new_user=Nuovo utente
-creationDate = Data creazione
-claimDate = Data rivendicazione
-approval.manage=Gestisci Approvazione
-approval.edit=Modifica Approvazione
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
deleted file mode 100644
index b2ff626..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ja.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=\u30bf\u30b9\u30af
-key=\u30ad\u30fc
-description=\u8aac\u660e
-createTime=\u4f5c\u6210\u6642\u523b
-dueDate=\u671f\u9650
-owner=\u30aa\u30fc\u30ca\u30fc
-claim=\u7533\u8acb
-manage=\u7ba1\u7406
-approvals=\u627f\u8a8d
-delete=\u524a\u9664
-type=\u30bf\u30a4\u30d7
-username=\u30e6\u30fc\u30b6\u30fc\u540d
-new_user=\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc
-creationDate = \u4f5c\u6210\u65e5
-claimDate = \u7533\u8acb\u65e5
-approval.edit=\u627f\u8a8d \u7de8\u96c6
-approval.manage=\u627f\u8a8d \u7ba1\u7406
-any.edit=${anyTO.type} ${anyTO.username} \u3092\u7de8\u96c6
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
deleted file mode 100644
index e5ff74c..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_pt_BR.properties
+++ /dev/null
@@ -1,34 +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.
-taskId=Tarefa
-key=Chave
-description=Descri\u00e7\u00e3o
-createTime=Tempo de Cria\u00e7\u00e3o
-dueDate=Data acordada
-owner=Propriet\u00e1rio
-claim=Requerimento
-manage=Ger\u00eancia
-approvals=Aprova\u00e7\u00f5es
-delete=Excluir
-type=Tipo
-username=Usu\u00e1rio
-new_user=Novo Usu\u00e1rio
-creationDate = Data de cria\u00e7\u00e3o
-claimDate = Data de reivindica\u00e7\u00e3o
-approval.manage=Aprova\u00e7\u00e3o
-approval.edit=Aprova\u00e7\u00e3o
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
deleted file mode 100644
index 6f4fb58..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Approvals_ru.properties
+++ /dev/null
@@ -1,52 +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.
-#
-# taskId=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b0
-taskId=\u0417\u0430\u044f\u0432\u043a\u0430
-# key=\u00d0\u0098\u00d0\u00b4\u00d0\u00b5\u00d0\u00bd\u00d1\u0082\u00d0\u00b8\u00d1\u0084\u00d0\u00b8\u00d0\u00ba\u00d0\u00b0\u00d1\u0082\u00d0\u00be\u00d1\u0080
-key=\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440
-# description=\u00d0\u009e\u00d0\u00bf\u00d0\u00b8\u00d1\u0081\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-description=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435
-# createTime=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
-createTime=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
-# dueDate=\u00d0\u00a1\u00d1\u0080\u00d0\u00be\u00d0\u00ba
-dueDate=\u0421\u0440\u043e\u043a
-# owner=\u00d0\u0092\u00d0\u00bb\u00d0\u00b0\u00d0\u00b4\u00d0\u00b5\u00d0\u00bb\u00d0\u00b5\u00d1\u0086
-owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
-# claim=\u00d0\u0092\u00d1\u008b\u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d0\u00bd\u00d0\u00b8\u00d1\u0082\u00d1\u008c \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-claim=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
-# manage=\u00d0\u00a3\u00d0\u00bf\u00d1\u0080\u00d0\u00b0\u00d0\u00b2\u00d0\u00bb\u00d0\u00b5\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-manage=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435
-# approvals=\u00d0\u0097\u00d0\u00b0\u00d1\u008f\u00d0\u00b2\u00d0\u00ba\u00d0\u00b8
-approvals=\u0417\u0430\u044f\u0432\u043a\u0438
-# delete=\u00d0\u00a3\u00d0\u00b4\u00d0\u00b0\u00d0\u00bb\u00d0\u00b8\u00d1\u0082\u00d1\u008c
-delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c
-# type=\u00d0\u00a2\u00d0\u00b8\u00d0\u00bf
-type=\u0422\u0438\u043f
-# username=\u00d0\u0098\u00d0\u00bc\u00d1\u008f \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
-username=\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
-# new_user=\u00d0\u00a1\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5 \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d1\u008c\u00d0\u00b7\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d1\u0082\u00d0\u00b5\u00d0\u00bb\u00d1\u008f
-new_user=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
-# creationDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
-creationDate=\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f
-# claimDate=\u00d0\u0094\u00d0\u00b0\u00d1\u0082\u00d0\u00b0 \u00d0\u00bd\u00d0\u00b0\u00d1\u0087\u00d0\u00b0\u00d0\u00bb\u00d0\u00b0 \u00d1\u0081\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d1\u008f
-claimDate=\u0414\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
-# approval.edit=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-approval.edit=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
-# approval.manage=\u00d0\u00a1\u00d0\u00be\u00d0\u00b3\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d0\u00be\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5
-approval.manage=\u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435
-any.edit=Edit ${anyTO.type} ${anyTO.username}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
index d477213..6f01bd9 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -65,8 +65,8 @@ under the License.
<span wicket:id="remediationWidget"/>
</li>
- <li class="dropdown tasks-menu">
- <span wicket:id="approvalsWidget"/>
+ <li class="dropdown tasks-menu" wicket:id="extAlertWidgets">
+ <span wicket:id="extAlertWidget"/>
</li>
<li class="dropdown user user-menu">
@@ -122,7 +122,6 @@ under the License.
<li wicket:id="policiesLI"><a href="#" wicket:id="policies"><i class="fa fa-list"></i><wicket:message key="policies"/></a></li>
<li wicket:id="securityLI"><a href="#" wicket:id="security"><i class="fa fa-lock"></i><wicket:message key="security"/></a></li>
<li wicket:id="typesLI"><a href="#" wicket:id="types"><i class="fa fa-wrench"></i><wicket:message key="types"/></a></li>
- <li wicket:id="workflowLI"><a href="#" wicket:id="workflow"><i class="fa fa-briefcase"></i><wicket:message key="workflow"/></a></li>
</ul>
</li>
<li wicket:id="extensionsLI" class="treeview">
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
deleted file mode 100644
index e1afe72..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/FlowableModelerPopupPage.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<!--
-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.
--->
-<html>
- <head>
- <title>Apache Syncope / Flowable Modeler</title>
-
- <meta http-equiv="refresh" content="0; url=../../flowable-modeler/modeler.html"/>
- </head>
- <body>
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
deleted file mode 100644
index 723c46a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
+++ /dev/null
@@ -1,37 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <section class="content-header">
- <h1> </h1>
- <ol class="breadcrumb">
- <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard"/></a></li>
- <li class="active"><wicket:message key="configuration"/></li>
- <li class="active"><wicket:message key="workflow"/></li>
- </ol>
- </section>
-
- <section class="content" wicket:id="content">
- <span wicket:id="disabled"><i><wicket:message key="disabled"/></i></span>
- <div class="box">
- <div class="box-body" wicket:id="workflowsPanel"/>
- </div>
- </section>
- </wicket:extend>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
deleted file mode 100644
index b8abd93..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable not enabled for users
-xmlEditorTitle=Workflow XML Editor
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
deleted file mode 100644
index 1f9eb5a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable non configurato per gli utenti
-xmlEditorTitle=Workflow XML Editor
-main=Principale
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties
deleted file mode 100644
index 11bb74a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ja.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=\u30d5\u30ed\u30fc\u53ef\u80fd\u306f\u30e6\u30fc\u30b6\u30fc\u306b\u5bfe\u3057\u3066\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093
-xmlEditorTitle=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc XML \u30a8\u30c7\u30a3\u30bf\u30fc
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
deleted file mode 100644
index 34829e5..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable n\u00e3o habilitado para usu\u00e1rios
-xmlEditorTitle=Workflow XML Editor
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
deleted file mode 100644
index 96c2862..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
+++ /dev/null
@@ -1,19 +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.
-noFlowableEnabledForUsers=Flowable \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439
-xmlEditorTitle=XML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
-main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
deleted file mode 100644
index 6197d5a..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
+++ /dev/null
@@ -1,32 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <div id="startAtContainer">
- <form wicket:id="form">
- <div class="input-group">
- <input wicket:id="key"/>
- <div class="input-group-addon">
- <a wicket:id="submit"><i class="fa fa-file-o" alt="new" title="new"></i></a>
- </div>
- </div>
- </form>
- </div>
- </wicket:extend>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
deleted file mode 100644
index d170041..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
+++ /dev/null
@@ -1,23 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
- <span wicket:id="newWorkflowProcess"/>
- </wicket:extend>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml b/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
deleted file mode 100644
index 5943197..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/empty.bpmn20.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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:flowable="http://flowable.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://www.flowable.org/processdef">
-
- <process id="%KEY%" name="%KEY%" isExecutable="true">
- <startEvent id="startevent1" name="Start"></startEvent>
- <endEvent id="endevent1" name="End"></endEvent>
- <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="endevent1"></sequenceFlow>
- </process>
- <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
- <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
- <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
- <omgdc:Bounds height="35.0" width="35.0" x="180.0" y="110.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
- <omgdc:Bounds height="35.0" width="35.0" x="460.0" y="110.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="215.0" y="127.0"></omgdi:waypoint>
- <omgdi:waypoint x="460.0" y="127.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
-</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
index 1086b88..af1d580 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel.properties
@@ -262,6 +262,6 @@ zoom_out.class=fa fa-search-minus
zoom_out.title=zoom-out
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
index 5538d75..4bfa686 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_it.properties
@@ -253,9 +253,9 @@ zoom_in.alt=zoom-in icon
zoom_out.class=fa fa-search-minus
zoom_out.title=zoom-out
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
index 6789a9b..6b011c7 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ja.properties
@@ -254,9 +254,9 @@ zoom_out.class=fa fa-search-minus
zoom_out.title=\u30ba\u30fc\u30e0\u30a2\u30a6\u30c8
zoom_out.alt=\u30ba\u30fc\u30e0\u30a2\u30a6\u30c8
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30e2\u30c7\u30e9\u2015
-workflow_modeler.alt=\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30e2\u30c7\u30e9\u2015
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
index c996263..b362779 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_pt_BR.properties
@@ -253,9 +253,9 @@ zoom_in.alt=zoom-in icon
zoom_out.class=fa fa-search-minus
zoom_out.title=zoom-out
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
index d697f25..dfea5ea 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionPanel_ru.properties
@@ -253,9 +253,9 @@ zoom_in.alt=zoom-in icon
zoom_out.class=fa fa-search-minus
zoom_out.title=rimpicciolisci
zoom_out.alt=zoom-out icon
-workflow_modeler.class=fa fa-picture-o
-workflow_modeler.title=workflow modeler
-workflow_modeler.alt=workflow modeler icon
+external_editor.class=fa fa-picture-o
+external_editor.title=external editor
+external_editor.alt=external modeler icon
reconciliation_push.class=fa fa-chevron-circle-right
reconciliation_push.title=push
reconciliation_push.alt=reconciliation push icon
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
deleted file mode 100644
index dd5b98f..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=View all approvals
-duedate=Due date
-owner=Owner
-createApproval=Create Approval
-summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
deleted file mode 100644
index 7b2287e..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_it.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=Tutte le approvazioni
-duedate=Scadenza
-owner=Assegnato
-createApproval=Approvazione Creazione
-summary=${number} approvazioni pendenti
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
deleted file mode 100644
index a6089eb..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ja.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=\u3059\u3079\u3066\u306e\u627f\u8a8d\u3092\u8868\u793a
-duedate=\u671f\u9650
-owner=\u30aa\u30fc\u30ca\u30fc
-createApproval=\u627f\u8a8d\u3092\u4f5c\u6210
-summary=${number} \u4fdd\u7559\u306e\u627f\u8a8d
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
deleted file mode 100644
index c24f3d8..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_pt_BR.properties
+++ /dev/null
@@ -1,21 +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.
-alerts.view.all=View all Approvals
-duedate=Due date
-owner=Owner
-createApproval=Create Approval
-summary=${number} pending approval(s)
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
deleted file mode 100644
index 10281ff..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/ApprovalsWidget_ru.properties
+++ /dev/null
@@ -1,22 +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.
-#
-alerts.view.all=\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u044f\u0432\u043a\u0438
-duedate=\u0421\u0440\u043e\u043a
-owner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446
-createApproval=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u044f\u0432\u043a\u0443
-summary=\u041e\u0436\u0438\u0434\u0430\u044e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f: ${number}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index be67966..207c789 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -268,16 +268,15 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
}
// mount resources
- ClassPathScanImplementationLookup classPathScanImplementationLookup =
- (ClassPathScanImplementationLookup) getServletContext().
- getAttribute(EnduserInitializer.CLASSPATH_LOOKUP);
- for (final Class<? extends AbstractResource> resource : classPathScanImplementationLookup.getResources()) {
+ ClassPathScanImplementationLookup lookup = (ClassPathScanImplementationLookup) getServletContext().
+ getAttribute(EnduserInitializer.CLASSPATH_LOOKUP);
+ for (Class<? extends AbstractResource> resource : lookup.getResources()) {
Resource annotation = resource.getAnnotation(Resource.class);
if (annotation == null) {
LOG.debug("No @Resource annotation found on {}, ignoring", resource.getName());
} else {
try {
- final AbstractResource instance = resource.getDeclaredConstructor().newInstance();
+ AbstractResource instance = resource.getDeclaredConstructor().newInstance();
mountResource(annotation.path(), new ResourceReference(annotation.key()) {
@@ -365,5 +364,4 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
public CustomTemplateInfo getCustomTemplate() {
return customTemplate;
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java b/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
index 1dd9066..7e2f323 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/PropertyUtils.java
@@ -23,37 +23,44 @@ import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.lang3.tuple.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Utility class for manipulating properties files.
*/
public final class PropertyUtils {
- public static Pair<Properties, String> read(
+ private static final Logger LOG = LoggerFactory.getLogger(PropertyUtils.class);
+
+ public static Pair<Properties, File> read(
final Class<?> clazz, final String propertiesFileName, final String confDirProp) {
Properties props = new Properties();
- String confDirName = null;
+ File confDir = null;
try (InputStream is = clazz.getResourceAsStream("/" + propertiesFileName)) {
props.load(is);
- confDirName = props.getProperty(confDirProp);
+ String confDirName = props.getProperty(confDirProp);
if (confDirName != null) {
- File confDir = new File(confDirName);
+ confDir = new File(confDirName);
if (confDir.exists() && confDir.canRead() && confDir.isDirectory()) {
File confDirProps = new File(confDir, propertiesFileName);
if (confDirProps.exists() && confDirProps.canRead() && confDirProps.isFile()) {
props.clear();
props.load(new FileInputStream(confDirProps));
}
+ } else {
+ confDir = null;
+ LOG.warn("{} not existing, unreadable or not a directory, ignoring", confDirName);
}
}
} catch (Exception e) {
throw new RuntimeException("Could not read " + propertiesFileName, e);
}
- return Pair.of(props, confDirName);
+ return Pair.of(props, confDir);
}
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java b/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
index 8b3403b..6d43e1f 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
@@ -40,7 +40,6 @@ public class ReconciliationReportletConf extends AbstractReportletConf {
key,
username,
groupName,
- workflowId,
status,
creationDate,
lastLoginDate,
http://git-wip-us.apache.org/repos/asf/syncope/blob/66b3a04e/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java b/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
index 1608563..8f364ec 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
@@ -51,7 +51,6 @@ public class UserReportletConf extends AbstractAnyReportletConf {
key,
username,
- workflowId,
status,
creator,
creationDate,
[13/34] syncope git commit: [SYNCOPE-1369] Flowable support
refactored as extension + code review (now with variable cleanup)
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/TwoContent.xml b/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
index b35beb4..23e372d 100644
--- a/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/TwoContent.xml
@@ -105,15 +105,6 @@ 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"/>
-
<!-- JWT lifetime in minutes -->
<SyncopeSchema id="jwt.lifetime.minutes"/>
<PlainSchema id="jwt.lifetime.minutes" type="Long"
@@ -142,11 +133,6 @@ under the License.
<Implementation id="PushJobDelegate" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.pushpull.PushJobDelegate"/>
- <Implementation id="IdentityRecertification" type="TASKJOB_DELEGATE" engine="JAVA"
- body="org.apache.syncope.core.provisioning.java.job.IdentityRecertification"/>
- <Task DTYPE="SchedTask" id="e95555d2-1b09-42c8-b25b-f4c4ec598989" name="Identity Recertification Task" active="1"
- jobDelegate_id="IdentityRecertification"/>
-
<Implementation id="ExpiredAccessTokenCleanup" type="TASKJOB_DELEGATE" engine="JAVA"
body="org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup"/>
<Task DTYPE="SchedTask" id="89de5014-e3f5-4462-84d8-d97575740baf" name="Access Token Cleanup Task" active="1"
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 54680bf..11dd2f3 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -84,7 +84,6 @@ under the License.
<module>provisioning-java</module>
<module>workflow-api</module>
<module>workflow-java</module>
- <module>workflow-flowable</module>
<module>logic</module>
<module>rest-cxf</module>
<module>upgrade</module>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
index b2c978b..d9f5035 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/event/AnyDeletedEvent.java
@@ -29,17 +29,21 @@ public class AnyDeletedEvent extends ApplicationEvent {
private final String anyKey;
+ private final String anyName;
+
private final String domain;
public AnyDeletedEvent(
final Object source,
final AnyTypeKind anyTypeKind,
final String anyKey,
+ final String anyName,
final String domain) {
super(source);
this.anyTypeKind = anyTypeKind;
this.anyKey = anyKey;
+ this.anyName = anyName;
this.domain = domain;
}
@@ -51,6 +55,10 @@ public class AnyDeletedEvent extends ApplicationEvent {
return anyKey;
}
+ public String getAnyName() {
+ return anyName;
+ }
+
public String getDomain() {
return domain;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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
deleted file mode 100755
index bd837e4..0000000
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/IdentityRecertification.java
+++ /dev/null
@@ -1,126 +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.
- */
-package org.apache.syncope.core.provisioning.java.job;
-
-import java.util.List;
-import java.util.Optional;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.core.persistence.api.dao.AnyDAO;
-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 {
-
- private static final String RECERTIFICATION_TIME = "identity.recertification.day.interval";
-
- @Autowired
- private ConfDAO confDAO;
-
- @Autowired
- private UserDAO userDAO;
-
- @Autowired
- private UserWorkflowAdapter uwfAdapter;
-
- private long recertificationTime = -1;
-
- protected void init() {
- synchronized (this) {
- if (recertificationTime == -1) {
- Optional<? extends CPlainAttr> recertificationTimeAttr = confDAO.find(RECERTIFICATION_TIME);
- if (!recertificationTimeAttr.isPresent()
- || recertificationTimeAttr.get().getValues().get(0).getLongValue() == null) {
-
- recertificationTime = -1;
- return;
- }
-
- recertificationTime = recertificationTimeAttr.get().getValues().
- get(0).getLongValue() * 1000 * 60 * 60 * 24;
- }
- }
- }
-
- protected boolean isToBeRecertified(final User user, final long now) {
- if (!user.isSuspended()
- && (user.getLastRecertification() == null
- || user.getLastRecertification().getTime() + recertificationTime < now)) {
-
- LOG.debug("{} is to be recertified", user);
- return true;
- }
-
- LOG.debug("{} does not need to be recertified", user);
- return false;
- }
-
- @Override
- protected String doExecute(final boolean dryRun) throws JobExecutionException {
- LOG.info("IdentityRecertification {} running [SchedTask {}]", dryRun ? "dry " : "", task.getKey());
-
- init();
- if (recertificationTime == -1) {
- LOG.debug("Identity Recertification disabled");
- return ("IDENTITY RECERTIFICATION DISABLED");
- }
-
- if (dryRun) {
- return "DRY RUN";
- }
-
- int total = userDAO.count();
- int pages = (total / AnyDAO.DEFAULT_PAGE_SIZE) + 1;
-
- status.set("Processing " + total + " users in " + pages + " pages");
-
- long now = System.currentTimeMillis();
- for (int page = 1; page <= pages && !interrupt; page++) {
- status.set("Processing " + total + " users: page " + page + " of " + pages);
-
- List<User> users = userDAO.findAll(page, AnyDAO.DEFAULT_PAGE_SIZE);
- for (int i = 0; i < users.size() && !interrupt; i++) {
- LOG.debug("Processing user: {}", users.get(i).getUsername());
-
- if (StringUtils.isNotBlank(users.get(i).getWorkflowId()) && isToBeRecertified(users.get(i), now)) {
- uwfAdapter.requestCertify(users.get(i));
- } else {
- LOG.warn("Workflow for {} is null or empty", users.get(i));
- }
- }
- }
- if (interrupt) {
- interrupted = true;
- return "Identity recertification interrupted";
- }
-
- return "SUCCESS";
- }
-
- @Override
- protected boolean hasToBeRegistered(final TaskExec execution) {
- return true;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
index 91d440e..8852870 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/ReconciliationReportlet.java
@@ -152,11 +152,6 @@ public class ReconciliationReportlet extends AbstractReportlet {
}
break;
- case workflowId:
- type = ReportXMLConst.XSD_STRING;
- value = any.getWorkflowId();
- break;
-
case status:
type = ReportXMLConst.XSD_STRING;
value = any.getStatus();
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
index 8d51e4a..338ef9a 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/UserReportlet.java
@@ -197,11 +197,6 @@ public class UserReportlet extends AbstractReportlet {
value = user.getUsername();
break;
- case workflowId:
- type = ReportXMLConst.XSD_STRING;
- value = user.getWorkflowId();
- break;
-
case status:
type = ReportXMLConst.XSD_STRING;
value = user.getStatus();
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
deleted file mode 100644
index 7a25cb8..0000000
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
+++ /dev/null
@@ -1,70 +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.
- */
-package org.apache.syncope.core.rest.cxf.service;
-
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.common.rest.api.beans.WorkflowFormQuery;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.syncope.core.logic.UserWorkflowLogic;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class UserWorkflowServiceImpl extends AbstractServiceImpl implements UserWorkflowService {
-
- @Autowired
- private UserWorkflowLogic logic;
-
- @Override
- public WorkflowFormTO claimForm(final String taskId) {
- return logic.claimForm(taskId);
- }
-
- @Override
- public UserTO executeTask(final String taskId, final UserTO userTO) {
- return logic.executeWorkflowTask(userTO, taskId);
- }
-
- @Override
- public WorkflowFormTO getFormForUser(final String userKey) {
- return logic.getFormForUser(userKey);
- }
-
- @Override
- public PagedResult<WorkflowFormTO> getForms(final WorkflowFormQuery query) {
- Pair<Integer, List<WorkflowFormTO>> result = logic.getForms(
- query.getPage(), query.getSize(), getOrderByClauses(query.getOrderBy()));
- return buildPagedResult(result.getRight(), query.getPage(), query.getSize(), result.getLeft());
- }
-
- @Override
- public List<WorkflowTaskTO> getAvailableTasks(final String userKey) {
- return logic.getAvailableTasks(userKey);
- }
-
- @Override
- public UserTO submitForm(final WorkflowFormTO form) {
- return logic.submitForm(form);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
deleted file mode 100644
index 2321e0a..0000000
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
+++ /dev/null
@@ -1,83 +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.
- */
-package org.apache.syncope.core.rest.cxf.service;
-
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.StreamingOutput;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
-import org.apache.syncope.core.logic.WorkflowLogic;
-import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class WorkflowServiceImpl extends AbstractServiceImpl implements WorkflowService {
-
- @Autowired
- private WorkflowLogic logic;
-
- @Override
- public List<WorkflowDefinitionTO> list(final String anyType) {
- return logic.list(anyType);
- }
-
- @Override
- public Response get(final String anyType, final String key) {
- WorkflowDefinitionFormat format =
- messageContext.getHttpHeaders().getAcceptableMediaTypes().contains(MediaType.APPLICATION_JSON_TYPE)
- ? WorkflowDefinitionFormat.JSON
- : WorkflowDefinitionFormat.XML;
-
- StreamingOutput sout = (os) -> logic.exportDefinition(anyType, key, format, os);
-
- return Response.ok(sout).
- type(format == WorkflowDefinitionFormat.JSON
- ? MediaType.APPLICATION_JSON_TYPE : MediaType.APPLICATION_XHTML_XML_TYPE).
- build();
- }
-
- @Override
- public Response exportDiagram(final String anyType, final String key) {
- StreamingOutput sout = (os) -> logic.exportDiagram(anyType, key, os);
-
- return Response.ok(sout).
- type(RESTHeaders.MEDIATYPE_IMAGE_PNG).
- build();
- }
-
- @Override
- public void set(final String anyType, final String key, final String definition) {
- WorkflowDefinitionFormat format =
- messageContext.getHttpHeaders().getMediaType().equals(MediaType.APPLICATION_JSON_TYPE)
- ? WorkflowDefinitionFormat.JSON
- : WorkflowDefinitionFormat.XML;
-
- logic.importDefinition(anyType, key, format, definition);
- }
-
- @Override
- public void delete(final String anyType, final String key) {
- logic.delete(anyType, key);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
index 8080676..6bc5fdb 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthContextUtils.java
@@ -19,8 +19,6 @@
package org.apache.syncope.core.spring.security;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -65,33 +63,26 @@ public final class AuthContextUtils {
public static Set<SyncopeGrantedAuthority> getAuthorities() {
SecurityContext ctx = SecurityContextHolder.getContext();
if (ctx != null && ctx.getAuthentication() != null && ctx.getAuthentication().getAuthorities() != null) {
- Set<SyncopeGrantedAuthority> result = new HashSet<>();
- ctx.getAuthentication().getAuthorities().stream().
- filter(authority -> (authority instanceof SyncopeGrantedAuthority)).
- forEachOrdered(authority -> result.add(SyncopeGrantedAuthority.class.cast(authority)));
-
- return result;
+ return ctx.getAuthentication().getAuthorities().stream().
+ filter(SyncopeGrantedAuthority.class::isInstance).
+ map(SyncopeGrantedAuthority.class::cast).
+ collect(Collectors.toSet());
}
return Collections.emptySet();
}
public static Map<String, Set<String>> getAuthorizations() {
- Map<String, Set<String>> result = null;
-
SecurityContext ctx = SecurityContextHolder.getContext();
if (ctx != null && ctx.getAuthentication() != null && ctx.getAuthentication().getAuthorities() != null) {
- result = new HashMap<>();
- for (GrantedAuthority authority : ctx.getAuthentication().getAuthorities()) {
- if (authority instanceof SyncopeGrantedAuthority) {
- result.put(
- SyncopeGrantedAuthority.class.cast(authority).getAuthority(),
- SyncopeGrantedAuthority.class.cast(authority).getRealms());
- }
- }
+ return ctx.getAuthentication().getAuthorities().stream().
+ filter(SyncopeGrantedAuthority.class::isInstance).
+ map(SyncopeGrantedAuthority.class::cast).
+ collect(Collectors.toMap(
+ SyncopeGrantedAuthority::getAuthority, SyncopeGrantedAuthority::getRealms));
}
- return result == null ? Collections.emptyMap() : result;
+ return Collections.emptyMap();
}
public static String getDomain() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
index 91d932b..daf093a 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
@@ -49,6 +49,10 @@ public final class SecureRandomUtils {
return FOR_LETTERS.generate(1);
}
+ public static String generateRandomLetters(final int length) {
+ return FOR_LETTERS.generate(length);
+ }
+
public static String generateRandomNumber() {
return FOR_NUMBERS.generate(1);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/upgrade/src/main/resources/schema.xml
----------------------------------------------------------------------
diff --git a/core/upgrade/src/main/resources/schema.xml b/core/upgrade/src/main/resources/schema.xml
index ea1a6a0..ad63e20 100644
--- a/core/upgrade/src/main/resources/schema.xml
+++ b/core/upgrade/src/main/resources/schema.xml
@@ -175,7 +175,6 @@ under the License.
<column name="lastChangeDate" type="timestamp"/>
<column name="lastModifier" type="varchar" size="255"/>
<column name="status" type="varchar" size="255"/>
- <column name="workflowId" type="varchar" size="255"/>
<column name="name" type="varchar" size="255"/>
<column name="REALM_ID" type="varchar" size="36"/>
<column name="TYPE_ID" type="varchar" size="255"/>
@@ -884,7 +883,6 @@ under the License.
<column name="lastChangeDate" type="timestamp"/>
<column name="lastModifier" type="varchar" size="255"/>
<column name="status" type="varchar" size="255"/>
- <column name="workflowId" type="varchar" size="255"/>
<column name="name" type="varchar" size="255"/>
<column name="REALM_ID" type="varchar" size="36"/>
<column name="GROUPOWNER_ID" type="varchar" size="36"/>
@@ -966,13 +964,10 @@ under the License.
<column name="lastChangeDate" type="timestamp"/>
<column name="lastModifier" type="varchar" size="255"/>
<column name="status" type="varchar" size="255"/>
- <column name="workflowId" type="varchar" size="255"/>
<column name="changePwdDate" type="timestamp"/>
<column name="cipherAlgorithm" type="varchar" size="20"/>
<column name="failedLogins" type="integer"/>
<column name="lastLoginDate" type="timestamp"/>
- <column name="lastRecertification" type="timestamp"/>
- <column name="lastRecertificator" type="varchar" size="255"/>
<column name="mustChangePassword" type="integer"/>
<column name="password" type="varchar" size="255"/>
<column name="securityAnswer" type="varchar" size="255"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
----------------------------------------------------------------------
diff --git a/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java b/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
index d81117c..42de069 100644
--- a/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
+++ b/core/upgrade/src/test/java/org/apache/syncope/core/upgrade/GeneratedUpgradeSQLTest.java
@@ -78,7 +78,7 @@ public class GeneratedUpgradeSQLTest {
Integer implementations = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM Implementation", Integer.class);
assertNotNull(implementations);
- assertEquals(16, implementations.intValue());
+ assertEquals(15, implementations.intValue());
Integer pullTaskActions = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM PullTaskAction", Integer.class);
assertNotNull(pullTaskActions);
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/upgrade/src/test/resources/syncopedb20.sql
----------------------------------------------------------------------
diff --git a/core/upgrade/src/test/resources/syncopedb20.sql b/core/upgrade/src/test/resources/syncopedb20.sql
index 314669b..59a2df0 100644
--- a/core/upgrade/src/test/resources/syncopedb20.sql
+++ b/core/upgrade/src/test/resources/syncopedb20.sql
@@ -261,17 +261,16 @@ CREATE MEMORY TABLE PUBLIC.ANYOBJECT(
LASTCHANGEDATE TIMESTAMP,
LASTMODIFIER VARCHAR(255),
STATUS VARCHAR(255),
- WORKFLOWID VARCHAR(255),
NAME VARCHAR(255),
REALM_ID VARCHAR(36),
TYPE_ID VARCHAR(255)
);
ALTER TABLE PUBLIC.ANYOBJECT ADD CONSTRAINT PUBLIC.CONSTRAINT_3 PRIMARY KEY(ID);
-- 3 +/- SELECT COUNT(*) FROM PUBLIC.ANYOBJECT;
-INSERT INTO PUBLIC.ANYOBJECT(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, TYPE_ID) VALUES
-('fc6dbc3a-6c07-4965-8781-921e7401a4a5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'HP LJ 1300n', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
-('8559d14d-58c2-46eb-a2d4-a7d35161e8f8', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'Canon MF 8030cn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
-('9e1d130c-d6a3-48b1-98b3-182477ed0688', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'Epson Stylus Color', '0679e069-7355-4b20-bd11-a5a0a5453c7c', 'PRINTER');
+INSERT INTO PUBLIC.ANYOBJECT(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, TYPE_ID) VALUES
+('fc6dbc3a-6c07-4965-8781-921e7401a4a5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'HP LJ 1300n', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
+('8559d14d-58c2-46eb-a2d4-a7d35161e8f8', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'Canon MF 8030cn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', 'PRINTER'),
+('9e1d130c-d6a3-48b1-98b3-182477ed0688', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'Epson Stylus Color', '0679e069-7355-4b20-bd11-a5a0a5453c7c', 'PRINTER');
CREATE MEMORY TABLE PUBLIC.ANYOBJECT_ANYTYPECLASS(
ANYOBJECT_ID VARCHAR(36),
ANYTYPECLASS_ID VARCHAR(255)
@@ -572,7 +571,6 @@ INSERT INTO PUBLIC.CPLAINATTR(ID, OWNER_ID, SCHEMA_ID) VALUES
('888ae8e1-a295-4ee2-a15e-31dbf6dfc3f9', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'authentication.statuses'),
('9891c0a7-27ee-4215-9eea-ca32e580b4e4', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'log.lastlogindate'),
('bcfd7efc-0605-4b5e-b4bb-85c1d5f6493a', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'return.password.value'),
-('bcfd7efc-0605-4b5e-b4bb-85c1d5f64bbb', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'identity.recertification.day.interval'),
('cfec3140-562d-459c-ac6a-e3e10758661d', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'jwt.lifetime.minutes'),
('ae36c6ab-0f39-40d7-b6e6-3b8394547c9c', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'connector.conf.history.size'),
('ae7ae53a-74cf-48b0-9a57-6d2c94928e60', 'cd64d66f-6fff-4008-b966-a06b1cc1436d', 'resource.conf.history.size');
@@ -1100,7 +1098,6 @@ INSERT INTO PUBLIC.PLAINSCHEMA(ID, CIPHERALGORITHM, CONVERSIONPATTERN, ENUMERATI
('authentication.statuses', NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, NULL, 'String', 0, NULL, NULL),
('log.lastlogindate', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Boolean', 0, NULL, NULL),
('return.password.value', NULL, NULL, NULL, NULL, 'false', NULL, 0, 0, NULL, 'Boolean', 0, NULL, NULL),
-('identity.recertification.day.interval', NULL, NULL, NULL, NULL, 'false', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
('jwt.lifetime.minutes', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
('connector.conf.history.size', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
('resource.conf.history.size', NULL, NULL, NULL, NULL, 'true', NULL, 0, 0, NULL, 'Long', 0, NULL, NULL),
@@ -1301,7 +1298,7 @@ CREATE MEMORY TABLE PUBLIC.REPORTLETCONFINSTANCE(
ALTER TABLE PUBLIC.REPORTLETCONFINSTANCE ADD CONSTRAINT PUBLIC.CONSTRAINT_4F PRIMARY KEY(ID);
-- 2 +/- SELECT COUNT(*) FROM PUBLIC.REPORTLETCONFINSTANCE;
INSERT INTO PUBLIC.REPORTLETCONFINSTANCE(ID, SERIALIZEDINSTANCE, REPORT_ID) VALUES
-('5874f3fa-578c-42c6-83b0-c11adafc98b2', '{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","workflowId","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}', '0062ea9c-924d-4ecf-9961-4492a8cc6d1b'),
+('5874f3fa-578c-42c6-83b0-c11adafc98b2', '{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}', '0062ea9c-924d-4ecf-9961-4492a8cc6d1b'),
('d6c2b475-4860-4eb1-8fde-618299c2a97c', '{"@class":"org.apache.syncope.common.lib.report.ReconciliationReportletConf","name":"dashboardReconciliationReportlet","userMatchingCond":null,"groupMatchingCond":null,"anyObjectMatchingCond":null,"features":["key","username","groupName"]}', 'c3520ad9-179f-49e7-b315-d684d216dd97');
CREATE MEMORY TABLE PUBLIC.REPORTTEMPLATE(
ID VARCHAR(255) NOT NULL,
@@ -1403,7 +1400,6 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEGROUP(
LASTCHANGEDATE TIMESTAMP,
LASTMODIFIER VARCHAR(255),
STATUS VARCHAR(255),
- WORKFLOWID VARCHAR(255),
NAME VARCHAR(255),
REALM_ID VARCHAR(36),
GROUPOWNER_ID VARCHAR(36),
@@ -1411,23 +1407,23 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEGROUP(
);
ALTER TABLE PUBLIC.SYNCOPEGROUP ADD CONSTRAINT PUBLIC.CONSTRAINT_8E PRIMARY KEY(ID);
-- 16 +/- SELECT COUNT(*) FROM PUBLIC.SYNCOPEGROUP;
-INSERT INTO PUBLIC.SYNCOPEGROUP(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) VALUES
-('37d15e4c-cdc1-460b-a591-8505c8133806', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'root', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('b1f7c12d-ec83-441f-a50e-1691daaedf3b', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'child', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('29f96485-729e-4d31-88a1-6fc60e4677f3', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'citizen', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('8fb2d51e-c605-4e80-a72b-13ffecf1aa9a', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'employee', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('a3c1a693-a6be-483f-a2b3-5cfec146f4bf', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'secretary', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('ebf97068-aa4b-4a85-9f01-680e8c4cf227', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'director', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, '823074dc-d280-436d-a7dd-07399fae48ec'),
-('bf825fe1-7320-4a54-bd64-143b5c18ab97', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'managingDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('f779c0d4-633b-4be5-8f57-32eb478a3ca5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'otherchild', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('0cbcabd2-4410-4b6b-8f05-a052b451d18f', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'groupForWorkflowApproval', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('b8d38784-57e7-4595-859a-076222644b55', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'managingConsultant', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('268fed79-f440-4390-9435-b273768eb5d6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'groupForWorkflowOptIn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('0626100b-a4ba-4e00-9971-86fad52a6216', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'aGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('ba9ed509-b1f5-48ab-a334-c8530a6422dc', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'bGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('ece66293-8f31-4a84-8e8d-23da36e70846', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'artDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
-('034740a9-fa10-453b-af37-dc7897e98fb1', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'additional', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL, NULL),
-('e7ff94e8-19c9-4f0a-b8b7-28327edbf6ed', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, NULL, 'fake', '722f3d84-9c2b-4525-8f6e-e4b82c55a36c', NULL, NULL);
+INSERT INTO PUBLIC.SYNCOPEGROUP(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) VALUES
+('37d15e4c-cdc1-460b-a591-8505c8133806', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'root', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('b1f7c12d-ec83-441f-a50e-1691daaedf3b', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'child', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('29f96485-729e-4d31-88a1-6fc60e4677f3', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'citizen', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('8fb2d51e-c605-4e80-a72b-13ffecf1aa9a', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'employee', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('a3c1a693-a6be-483f-a2b3-5cfec146f4bf', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'secretary', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('ebf97068-aa4b-4a85-9f01-680e8c4cf227', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'director', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, '823074dc-d280-436d-a7dd-07399fae48ec'),
+('bf825fe1-7320-4a54-bd64-143b5c18ab97', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'managingDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('f779c0d4-633b-4be5-8f57-32eb478a3ca5', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'otherchild', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('0cbcabd2-4410-4b6b-8f05-a052b451d18f', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'groupForWorkflowApproval', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('b8d38784-57e7-4595-859a-076222644b55', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'managingConsultant', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('268fed79-f440-4390-9435-b273768eb5d6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'groupForWorkflowOptIn', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('0626100b-a4ba-4e00-9971-86fad52a6216', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'aGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('ba9ed509-b1f5-48ab-a334-c8530a6422dc', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'bGroupForPropagation', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('ece66293-8f31-4a84-8e8d-23da36e70846', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'artDirector', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL),
+('034740a9-fa10-453b-af37-dc7897e98fb1', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'additional', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL, NULL),
+('e7ff94e8-19c9-4f0a-b8b7-28327edbf6ed', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', NULL, 'fake', '722f3d84-9c2b-4525-8f6e-e4b82c55a36c', NULL, NULL);
CREATE MEMORY TABLE PUBLIC.SYNCOPEGROUP_ANYTYPECLASS(
GROUP_ID VARCHAR(36),
ANYTYPECLASS_ID VARCHAR(255)
@@ -1569,7 +1565,6 @@ INSERT INTO PUBLIC.SYNCOPESCHEMA(ID) VALUES
('authentication.statuses'),
('log.lastlogindate'),
('return.password.value'),
-('identity.recertification.day.interval'),
('jwt.lifetime.minutes'),
('connector.conf.history.size'),
('resource.conf.history.size'),
@@ -1619,13 +1614,10 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEUSER(
LASTCHANGEDATE TIMESTAMP,
LASTMODIFIER VARCHAR(255),
STATUS VARCHAR(255),
- WORKFLOWID VARCHAR(255),
CHANGEPWDDATE TIMESTAMP,
CIPHERALGORITHM VARCHAR(20),
FAILEDLOGINS INTEGER,
LASTLOGINDATE TIMESTAMP,
- LASTRECERTIFICATION TIMESTAMP,
- LASTRECERTIFICATOR VARCHAR(255),
MUSTCHANGEPASSWORD INTEGER,
PASSWORD VARCHAR(255),
SECURITYANSWER VARCHAR(255),
@@ -1638,12 +1630,12 @@ CREATE MEMORY TABLE PUBLIC.SYNCOPEUSER(
);
ALTER TABLE PUBLIC.SYNCOPEUSER ADD CONSTRAINT PUBLIC.CONSTRAINT_6FFB PRIMARY KEY(ID);
-- 5 +/- SELECT COUNT(*) FROM PUBLIC.SYNCOPEUSER;
-INSERT INTO PUBLIC.SYNCOPEUSER(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, LASTRECERTIFICATION, LASTRECERTIFICATOR, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) VALUES
-('1417acbe-cbf6-4277-9372-e75e04f97000', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '4', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'rossini', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL),
-('74cd8ece-715a-44a4-a736-e17b46c4e7e6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '6', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'verdi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
-('b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '8', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'vivaldi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
-('c9b2dec2-00a7-4855-97c0-d854842b4b24', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '10', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'bellini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
-('823074dc-d280-436d-a7dd-07399fae48ec', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', '12', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'puccini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL);
+INSERT INTO PUBLIC.SYNCOPEUSER(ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) VALUES
+('1417acbe-cbf6-4277-9372-e75e04f97000', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'rossini', 'c5b75db1-fce7-470f-b780-3b9934d82a9d', NULL),
+('74cd8ece-715a-44a4-a736-e17b46c4e7e6', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'verdi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
+('b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'vivaldi', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
+('c9b2dec2-00a7-4855-97c0-d854842b4b24', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'bellini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL),
+('823074dc-d280-436d-a7dd-07399fae48ec', TIMESTAMP '2010-10-20 11:00:00', 'admin', TIMESTAMP '2010-10-20 11:00:00', 'admin', 'active', NULL, 'SHA1', NULL, NULL, NULL, NULL, NULL, '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, 0, NULL, NULL, 'puccini', 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL);
CREATE MEMORY TABLE PUBLIC.SYNCOPEUSER_ANYTYPECLASS(
USER_ID VARCHAR(36),
ANYTYPECLASS_ID VARCHAR(255)
@@ -1720,7 +1712,6 @@ INSERT INTO PUBLIC.TASK(ID, DTYPE, ACTIVE, CRONEXPRESSION, DESCRIPTION, JOBDELEG
('316285cc-ae52-4ea2-a33b-7355e189ac3f', 'PropagationTask', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'USER', '[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"type","value":["type"]}]', NULL, '1417acbe-cbf6-4277-9372-e75e04f97000', '__ACCOUNT__', NULL, 'DELETE', 'ws-target-resource-2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('c41b9b71-9bfa-4f90-89f2-84787def4c5c', 'PullTask', 1, NULL, NULL, NULL, 'CSV (update matching; assign unmatching)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'resource-csv', 'UPDATE', 1, 1, 1, 1, 'ASSIGN', 'INCREMENTAL', NULL, 'e4c28e7a-9dbf-4ee7-9441-93812a0d4a28', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('e95555d2-1b09-42c8-b25b-f4c4ec597979', 'SchedTask', 1, '0 0 0 1 * ?', NULL, 'org.apache.syncope.fit.core.reference.TestSampleJobDelegate', 'SampleJob Task', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
-('e95555d2-1b09-42c8-b25b-f4c4ec598989', 'SchedTask', 1, NULL, NULL, 'org.apache.syncope.core.provisioning.java.job.IdentityRecertification', 'Identity Recertification Task', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('89de5014-e3f5-4462-84d8-d97575740baf', 'SchedTask', 1, '0 0/5 * * * ?', NULL, 'org.apache.syncope.core.provisioning.java.job.ExpiredAccessTokenCleanup', 'Access Token Cleanup Task', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('d6c2d6d3-6329-44c1-9187-f1469ead1cfa', 'PropagationTask', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'USER', '[{"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"]}]', NULL, '1417acbe-cbf6-4277-9372-e75e04f97000', '__ACCOUNT__', NULL, 'UPDATE', 'ws-target-resource-nopropagation', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO PUBLIC.TASK(ID, DTYPE, ACTIVE, CRONEXPRESSION, DESCRIPTION, JOBDELEGATECLASSNAME, NAME, STARTAT, ANYTYPE, ANYTYPEKIND, ATTRIBUTES, CONNOBJECTKEY, ENTITYKEY, OBJECTCLASSNAME, OLDCONNOBJECTKEY, OPERATION, RESOURCE_ID, MATCHINGRULE, PERFORMCREATE, PERFORMDELETE, PERFORMUPDATE, SYNCSTATUS, UNMATCHINGRULE, PULLMODE, RECONCILIATIONFILTERBUILDERCLASSNAME, DESTINATIONREALM_ID, EXECUTED, HTMLBODY, SENDER, SUBJECT, TEXTBODY, TRACELEVEL, NOTIFICATION_ID, SOURCEREALM_ID) VALUES
@@ -2386,7 +2377,7 @@ SELECT
SS.USER_ID AS ANY_ID,
SS.ROLE_ID AS ROLE_ID
FROM PUBLIC.SYNCOPEUSER_SYNCOPEROLE SS;
-CREATE FORCE VIEW PUBLIC.ANYOBJECT_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, TYPE_ID) AS
+CREATE FORCE VIEW PUBLIC.ANYOBJECT_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, TYPE_ID) AS
SELECT
A.ID AS ANY_ID,
A.ID,
@@ -2395,7 +2386,6 @@ SELECT
A.LASTCHANGEDATE,
A.LASTMODIFIER,
A.STATUS,
- A.WORKFLOWID,
A.NAME,
A.REALM_ID,
A.TYPE_ID
@@ -2406,7 +2396,7 @@ SELECT
M.ANYOBJECT_ID AS RIGHT_ANY_ID,
M.TYPE_ID AS TYPE
FROM PUBLIC.URELATIONSHIP M;
-CREATE FORCE VIEW PUBLIC.USER_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, LASTRECERTIFICATION, LASTRECERTIFICATOR, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) AS
+CREATE FORCE VIEW PUBLIC.USER_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, CHANGEPWDDATE, CIPHERALGORITHM, FAILEDLOGINS, LASTLOGINDATE, MUSTCHANGEPASSWORD, PASSWORD, SECURITYANSWER, SUSPENDED, TOKEN, TOKENEXPIRETIME, USERNAME, REALM_ID, SECURITYQUESTION_ID) AS
SELECT
U.ID AS ANY_ID,
U.ID,
@@ -2415,13 +2405,10 @@ SELECT
U.LASTCHANGEDATE,
U.LASTMODIFIER,
U.STATUS,
- U.WORKFLOWID,
U.CHANGEPWDDATE,
U.CIPHERALGORITHM,
U.FAILEDLOGINS,
U.LASTLOGINDATE,
- U.LASTRECERTIFICATION,
- U.LASTRECERTIFICATOR,
U.MUSTCHANGEPASSWORD,
U.PASSWORD,
U.SECURITYANSWER,
@@ -2527,7 +2514,7 @@ FROM PUBLIC.AMEMBERSHIP M
INNER JOIN PUBLIC.SYNCOPEGROUP G
ON 1=1
WHERE M.GROUP_ID = G.ID;
-CREATE FORCE VIEW PUBLIC.GROUP_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, WORKFLOWID, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) AS
+CREATE FORCE VIEW PUBLIC.GROUP_SEARCH(ANY_ID, ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER, STATUS, NAME, REALM_ID, GROUPOWNER_ID, USEROWNER_ID) AS
SELECT
R.ID AS ANY_ID,
R.ID,
@@ -2536,7 +2523,6 @@ SELECT
R.LASTCHANGEDATE,
R.LASTMODIFIER,
R.STATUS,
- R.WORKFLOWID,
R.NAME,
R.REALM_ID,
R.GROUPOWNER_ID,
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
index 3a9f21f..1f7daca 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
@@ -36,15 +36,6 @@ public interface AnyObjectWorkflowAdapter extends WorkflowAdapter {
WorkflowResult<String> create(AnyObjectTO anyObjectTO);
/**
- * Execute a task on a anyObject.
- *
- * @param anyObjectTO anyObject to be subject to task
- * @param taskId to be executed
- * @return anyObject just updated
- */
- WorkflowResult<String> execute(AnyObjectTO anyObjectTO, String taskId);
-
- /**
* Update a anyObject.
*
* @param anyObjectPatch modification set to be performed
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java
deleted file mode 100644
index 43fb0dd..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,22 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-public interface AnyObjectWorkflowDefinitionAdapter extends WorkflowDefinitionAdapter {
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
index 72595f6..e478a26 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
@@ -36,15 +36,6 @@ public interface GroupWorkflowAdapter extends WorkflowAdapter {
WorkflowResult<String> create(GroupTO groupTO);
/**
- * Execute a task on a group.
- *
- * @param groupTO group to be subject to task
- * @param taskId to be executed
- * @return group just updated
- */
- WorkflowResult<String> execute(GroupTO groupTO, String taskId);
-
- /**
* Update a group.
*
* @param groupPatch modification set to be performed
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java
deleted file mode 100644
index 6dc2241..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,22 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-public interface GroupWorkflowDefinitionAdapter extends WorkflowDefinitionAdapter {
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/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 537294d..a29e584 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,7 +22,6 @@ 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.
@@ -51,23 +50,6 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
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);
-
- /**
- * Execute a task on an user.
- *
- * @param userTO user to be subject to task
- * @param taskId to be executed
- * @return user just updated
- */
- WorkflowResult<String> execute(UserTO userTO, String taskId);
-
- /**
* Activate an user.
*
* @param userKey user to be activated
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java
deleted file mode 100644
index 93b3969..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,22 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-public interface UserWorkflowDefinitionAdapter extends WorkflowDefinitionAdapter {
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
index 07ca5b4..ba42c53 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowAdapter.java
@@ -18,60 +18,10 @@
*/
package org.apache.syncope.core.workflow.api;
-import java.util.List;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.patch.AnyPatch;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.to.WorkflowTaskTO;
-import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
-import org.apache.syncope.core.provisioning.api.WorkflowResult;
-
public interface WorkflowAdapter {
/**
* @return any string that might be interpreted as 'prefix' (say table prefix in SQL environments)
*/
String getPrefix();
-
- /**
- * Get the forms for current workflow process instances matching the provided parameters.
- *
- * @param page result page
- * @param size items per page
- * @param orderByClauses sort conditions
- * @return total number of forms, list of forms matching the provided parameters
- */
- Pair<Integer, List<WorkflowFormTO>> getForms(int page, int size, List<OrderByClause> orderByClauses);
-
- /**
- * Get form for given workflowId (if present).
- *
- * @param workflowId workflow id
- * @return form (if present), otherwise null
- */
- WorkflowFormTO getForm(String workflowId);
-
- /**
- * Claim a form for a given object.
- *
- * @param taskId Workflow task to which the form is associated
- * @return updated form
- */
- WorkflowFormTO claimForm(String taskId);
-
- /**
- * Submit a form.
- *
- * @param form to be submitted
- * @return object updated by this form submit
- */
- WorkflowResult<? extends AnyPatch> submitForm(WorkflowFormTO form);
-
- /**
- * Get tasks available for execution, for given workflow id.
- *
- * @param workflowId workflow id
- * @return available tasks
- */
- List<WorkflowTaskTO> getAvailableTasks(String workflowId);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java
deleted file mode 100644
index ea84598..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionAdapter.java
+++ /dev/null
@@ -1,64 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-import java.io.OutputStream;
-import java.util.List;
-import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
-
-public interface WorkflowDefinitionAdapter {
-
- /**
- * @return all available workflow definitions.
- */
- List<WorkflowDefinitionTO> getDefinitions();
-
- /**
- * Export the workflow definition for the given key, in the requested format.
- *
- * @param key definition key
- * @param format export format
- * @param os export stream
- */
- void exportDefinition(String key, WorkflowDefinitionFormat format, OutputStream os);
-
- /**
- * Export the workflow graphical representation for the given key (if available).
- *
- * @param key definition key
- * @param os export stream
- */
- void exportDiagram(String key, OutputStream os);
-
- /**
- * Import the workflow definition for the given key.
- *
- * @param key definition key
- * @param format import format
- * @param definition definition
- */
- void importDefinition(String key, WorkflowDefinitionFormat format, String definition);
-
- /**
- * Remove the workflow definition for the given key.
- *
- * @param key definition key
- */
- void deleteDefinition(String key);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java
deleted file mode 100644
index f7d67f2..0000000
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/WorkflowDefinitionFormat.java
+++ /dev/null
@@ -1,29 +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.
- */
-package org.apache.syncope.core.workflow.api;
-
-/**
- * Format for import / export of workflow definition.
- */
-public enum WorkflowDefinitionFormat {
-
- XML,
- JSON
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/pom.xml
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/pom.xml b/core/workflow-flowable/pom.xml
deleted file mode 100644
index 75f1ece..0000000
--- a/core/workflow-flowable/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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-core</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <name>Apache Syncope Core Workflow Flowable</name>
- <description>Apache Syncope Core Workflow Flowable</description>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-flowable</artifactId>
- <packaging>jar</packaging>
-
- <properties>
- <rootpom.basedir>${basedir}/../..</rootpom.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-email</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.javamail</groupId>
- <artifactId>geronimo-javamail_1.4_mail</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-engine</artifactId>
- </dependency>
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-spring</artifactId>
- </dependency>
- <dependency>
- <groupId>org.flowable</groupId>
- <artifactId>flowable-json-converter</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-java</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java
deleted file mode 100644
index 8c04545..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDefinitionLoader.java
+++ /dev/null
@@ -1,92 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Resource;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.core.spring.ResourceWithFallbackLoader;
-import org.apache.syncope.core.persistence.api.SyncopeLoader;
-import org.apache.syncope.core.workflow.flowable.spring.DomainProcessEngine;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.engine.repository.ProcessDefinition;
-import org.flowable.spring.SpringProcessEngineConfiguration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class FlowableDefinitionLoader implements SyncopeLoader {
-
- private static final Logger LOG = LoggerFactory.getLogger(FlowableDefinitionLoader.class);
-
- @Resource(name = "userWorkflowDef")
- private ResourceWithFallbackLoader userWorkflowDef;
-
- @Autowired
- private DomainProcessEngine dpEngine;
-
- @Override
- public Integer getPriority() {
- return Integer.MIN_VALUE;
- }
-
- @Override
- public void load() {
- byte[] wfDef = new byte[0];
-
- try (InputStream wfIn = userWorkflowDef.getResource().getInputStream()) {
- wfDef = IOUtils.toByteArray(wfIn);
- } catch (IOException e) {
- LOG.error("While loading " + userWorkflowDef.getResource().getFilename(), e);
- }
-
- for (Map.Entry<String, ProcessEngine> entry : dpEngine.getEngines().entrySet()) {
- List<ProcessDefinition> processes = entry.getValue().getRepositoryService().
- createProcessDefinitionQuery().processDefinitionKey(FlowableUserWorkflowAdapter.WF_PROCESS_ID).
- list();
- LOG.debug(FlowableUserWorkflowAdapter.WF_PROCESS_ID + " Flowable processes in repository: {}", processes);
-
- // Only loads process definition from file if not found in repository
- if (processes.isEmpty()) {
- entry.getValue().getRepositoryService().createDeployment().addInputStream(
- userWorkflowDef.getResource().getFilename(), new ByteArrayInputStream(wfDef)).deploy();
-
- ProcessDefinition procDef = entry.getValue().getRepositoryService().createProcessDefinitionQuery().
- processDefinitionKey(FlowableUserWorkflowAdapter.WF_PROCESS_ID).latestVersion().
- singleResult();
-
- FlowableDeployUtils.deployModel(entry.getValue(), procDef);
-
- LOG.debug("Flowable Workflow definition loaded for domain {}", entry.getKey());
- }
-
- // jump to the next ID block
- for (int i = 0; i < entry.getValue().getProcessEngineConfiguration().getIdBlockSize(); i++) {
- SpringProcessEngineConfiguration.class.cast(entry.getValue().getProcessEngineConfiguration()).
- getIdGenerator().getNextId();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/3cabe08a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java
----------------------------------------------------------------------
diff --git a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java b/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java
deleted file mode 100644
index b2c6537..0000000
--- a/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/FlowableDeployUtils.java
+++ /dev/null
@@ -1,92 +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.
- */
-package org.apache.syncope.core.workflow.flowable;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import org.apache.syncope.core.workflow.api.WorkflowException;
-import org.flowable.bpmn.converter.BpmnXMLConverter;
-import org.flowable.bpmn.model.BpmnModel;
-import org.flowable.editor.constants.ModelDataJsonConstants;
-import org.flowable.editor.language.json.converter.BpmnJsonConverter;
-import org.flowable.engine.ProcessEngine;
-import org.flowable.common.engine.api.FlowableException;
-import org.flowable.engine.repository.Deployment;
-import org.flowable.engine.repository.Model;
-import org.flowable.engine.repository.ProcessDefinition;
-
-public final class FlowableDeployUtils {
-
- private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
- public static Deployment deployDefinition(
- final ProcessEngine engine, final String resourceName, final byte[] definition) {
-
- try {
- return engine.getRepositoryService().createDeployment().
- addInputStream(resourceName, new ByteArrayInputStream(definition)).deploy();
- } catch (FlowableException e) {
- throw new WorkflowException("While importing " + resourceName, e);
- }
- }
-
- public static void deployModel(final ProcessEngine engine, final ProcessDefinition procDef) {
- XMLStreamReader xtr = null;
- try (InputStream bpmnStream = engine.getRepositoryService().
- getResourceAsStream(procDef.getDeploymentId(), procDef.getResourceName());
- InputStreamReader isr = new InputStreamReader(bpmnStream)) {
-
- xtr = XMLInputFactory.newInstance().createXMLStreamReader(isr);
- BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
-
- Model model = engine.getRepositoryService().newModel();
- ObjectNode modelObjectNode = OBJECT_MAPPER.createObjectNode();
- modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, procDef.getName());
- model.setMetaInfo(modelObjectNode.toString());
- model.setName(procDef.getName());
- model.setDeploymentId(procDef.getDeploymentId());
- model.setVersion(procDef.getVersion());
-
- engine.getRepositoryService().saveModel(model);
- engine.getRepositoryService().addModelEditorSource(
- model.getId(),
- new BpmnJsonConverter().convertToJson(bpmnModel).toString().getBytes());
- } catch (Exception e) {
- throw new WorkflowException("While importing " + procDef.getResourceName(), e);
- } finally {
- if (xtr != null) {
- try {
- xtr.close();
- } catch (XMLStreamException e) {
- // ignore
- }
- }
- }
- }
-
- private FlowableDeployUtils() {
- // private constructor for static utility class
- }
-}