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 2019/01/16 07:13:10 UTC

[syncope] branch master updated (e9b8d95 -> 5b26fc8)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git.


    from e9b8d95  Upgrading Flowable
     new 0ecf9b0  Upgrading Bootstrap
     new 5b26fc8  Small cleanup after Flowable upgrade

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../syncope/core/flowable/impl/FlowableRuntimeUtils.java   | 14 +++-----------
 .../core/flowable/impl/FlowableUserRequestHandler.java     | 14 +++++++-------
 .../core/flowable/impl/FlowableUserWorkflowAdapter.java    |  5 ++---
 pom.xml                                                    |  2 +-
 4 files changed, 13 insertions(+), 22 deletions(-)


[syncope] 01/02: Upgrading Bootstrap

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 0ecf9b0a253c154b693c7a8a17dce5de78e4de71
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed Jan 16 07:49:20 2019 +0100

    Upgrading Bootstrap
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 7d673dd..e893e8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -449,7 +449,7 @@ under the License.
     <jquery-slimscroll.version>1.3.8</jquery-slimscroll.version>
     <jquery-cookie.version>1.4.1-1</jquery-cookie.version>
     
-    <bootstrap.version>3.3.7</bootstrap.version>
+    <bootstrap.version>3.4.0</bootstrap.version>
     <bootstrap-select.version>1.12.4</bootstrap-select.version>
     <bootstrap-fileinput.version>4.4.8</bootstrap-fileinput.version>
     <bootbox.version>4.4.0</bootbox.version>


[syncope] 02/02: Small cleanup after Flowable upgrade

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 5b26fc82fdacd8b4c74c05f045731984f957758c
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed Jan 16 08:11:23 2019 +0100

    Small cleanup after Flowable upgrade
---
 .../syncope/core/flowable/impl/FlowableRuntimeUtils.java   | 14 +++-----------
 .../core/flowable/impl/FlowableUserRequestHandler.java     | 14 +++++++-------
 .../core/flowable/impl/FlowableUserWorkflowAdapter.java    |  5 ++---
 3 files changed, 12 insertions(+), 21 deletions(-)

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
index 2a68a46..b945463 100644
--- 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
@@ -36,7 +36,6 @@ import org.flowable.engine.history.HistoricActivityInstance;
 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;
@@ -129,7 +128,7 @@ public final class FlowableRuntimeUtils {
     }
 
     public static void updateStatus(final DomainProcessEngine engine, final String procInstId, final User user) {
-        List<Task> tasks = createTaskQuery(engine, false).processInstanceId(procInstId).list();
+        List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(procInstId).list();
         if (tasks.isEmpty() || tasks.size() > 1) {
             LOG.warn("While setting user status: unexpected task number ({})", tasks.size());
         } else {
@@ -137,18 +136,11 @@ public final class FlowableRuntimeUtils {
         }
     }
 
-    public static TaskQuery createTaskQuery(final DomainProcessEngine engine, final boolean onlyFormTasks) {
-        TaskQuery taskQuery = engine.getTaskService().createTaskQuery();
-        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();
+        List<Task> tasks = engine.getTaskService().createTaskQuery().
+                taskWithFormKey().processInstanceId(procInstId).list();
         if (tasks.isEmpty() || tasks.size() > 1) {
             LOG.debug("While checking if form task: unexpected task number ({})", tasks.size());
         } else {
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
index c4997ca..228bc5e 100644
--- 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
@@ -128,7 +128,7 @@ public class FlowableUserRequestHandler implements UserRequestHandler {
         userRequest.setStartTime(procInst.getStartTime());
         userRequest.setUsername(userDAO.find(split.getRight()).getUsername());
         userRequest.setExecutionId(procInst.getId());
-        userRequest.setActivityId(FlowableRuntimeUtils.createTaskQuery(engine, false).
+        userRequest.setActivityId(engine.getTaskService().createTaskQuery().
                 processInstanceId(procInst.getProcessInstanceId()).singleResult().getTaskDefinitionKey());
         return userRequest;
     }
@@ -461,7 +461,7 @@ public class FlowableUserRequestHandler implements UserRequestHandler {
 
         Pair<Integer, List<UserRequestForm>> forms;
 
-        TaskQuery query = FlowableRuntimeUtils.createTaskQuery(engine, true);
+        TaskQuery query = engine.getTaskService().createTaskQuery().taskWithFormKey();
         if (userKey != null) {
             query.processInstanceBusinessKeyLike(FlowableRuntimeUtils.getProcBusinessKey("%", userKey));
         }
@@ -539,7 +539,7 @@ public class FlowableUserRequestHandler implements UserRequestHandler {
     protected Pair<Task, TaskFormData> parseTask(final String taskId) {
         Task task;
         try {
-            task = FlowableRuntimeUtils.createTaskQuery(engine, true).taskId(taskId).singleResult();
+            task = engine.getTaskService().createTaskQuery().taskWithFormKey().taskId(taskId).singleResult();
             if (task == null) {
                 throw new FlowableException("NULL result");
             }
@@ -563,8 +563,8 @@ public class FlowableUserRequestHandler implements UserRequestHandler {
 
         String authUser = AuthContextUtils.getUsername();
         if (!adminUser.equals(authUser)) {
-            List<Task> tasksForUser = FlowableRuntimeUtils.createTaskQuery(engine, true).
-                    taskId(taskId).taskCandidateOrAssigned(authUser).list();
+            List<Task> tasksForUser = engine.getTaskService().createTaskQuery().
+                    taskWithFormKey().taskId(taskId).taskCandidateOrAssigned(authUser).list();
             if (tasksForUser.isEmpty()) {
                 throw new WorkflowException(
                         new IllegalArgumentException(authUser + " is not candidate nor assignee of task " + taskId));
@@ -586,7 +586,7 @@ public class FlowableUserRequestHandler implements UserRequestHandler {
         Task task;
         try {
             engine.getTaskService().claim(taskId, authUser);
-            task = FlowableRuntimeUtils.createTaskQuery(engine, true).taskId(taskId).singleResult();
+            task = engine.getTaskService().createTaskQuery().taskWithFormKey().taskId(taskId).singleResult();
         } catch (FlowableException e) {
             throw new WorkflowException("While reading task " + taskId, e);
         }
@@ -601,7 +601,7 @@ public class FlowableUserRequestHandler implements UserRequestHandler {
         Task task;
         try {
             engine.getTaskService().unclaim(taskId);
-            task = FlowableRuntimeUtils.createTaskQuery(engine, true).taskId(taskId).singleResult();
+            task = engine.getTaskService().createTaskQuery().taskWithFormKey().taskId(taskId).singleResult();
         } catch (FlowableException e) {
             throw new WorkflowException("While unclaiming task " + taskId, e);
         }
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
index 6ab00df..02d0138 100644
--- 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
@@ -171,7 +171,7 @@ public class FlowableUserWorkflowAdapter extends AbstractUserWorkflowAdapter imp
             variables.putAll(moreVariables);
         }
 
-        List<Task> tasks = FlowableRuntimeUtils.createTaskQuery(engine, false).processInstanceId(procInstID).list();
+        List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(procInstID).list();
         String task = null;
         if (tasks.size() == 1) {
             try {
@@ -459,8 +459,7 @@ public class FlowableUserWorkflowAdapter extends AbstractUserWorkflowAdapter imp
 
         List<String> availableTasks = new ArrayList<>();
         try {
-            Task currentTask = FlowableRuntimeUtils.createTaskQuery(engine, false).
-                    processInstanceId(procInstID).singleResult();
+            Task currentTask = engine.getTaskService().createTaskQuery().processInstanceId(procInstID).singleResult();
 
             Process process = engine.getRepositoryService().
                     getBpmnModel(FlowableRuntimeUtils.getLatestProcDefByKey(