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 2020/10/14 07:19:22 UTC

[syncope] 02/02: Fixing after Flowable upgrade

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 cc7f7e6f3fdabd278db9f86988371994be351ee0
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed Oct 14 09:18:52 2020 +0200

    Fixing after Flowable upgrade
---
 .../syncope/core/flowable/WorkflowFlowableContext.java |  8 ++++++--
 .../flowable/support/SyncopeIdmIdentityService.java    | 18 +++++++-----------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/WorkflowFlowableContext.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/WorkflowFlowableContext.java
index 91f9055..049294b 100644
--- a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/WorkflowFlowableContext.java
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/WorkflowFlowableContext.java
@@ -19,7 +19,6 @@
 package org.apache.syncope.core.flowable;
 
 import java.util.List;
-
 import org.apache.syncope.core.flowable.impl.FlowableBpmnProcessManager;
 import org.apache.syncope.core.flowable.impl.FlowableUserRequestHandler;
 import org.apache.syncope.core.flowable.impl.FlowableWorkflowUtils;
@@ -36,8 +35,10 @@ import org.flowable.common.engine.impl.persistence.StrongUuidGenerator;
 import org.flowable.idm.spring.SpringIdmEngineConfiguration;
 import org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator;
 import org.flowable.spring.SpringProcessEngineConfiguration;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
@@ -49,6 +50,9 @@ import org.springframework.context.annotation.Scope;
 @Configuration
 public class WorkflowFlowableContext {
 
+    @Autowired
+    private ConfigurableApplicationContext ctx;
+
     @Value("${wf.directory}")
     private String wfDirectory;
 
@@ -59,7 +63,7 @@ public class WorkflowFlowableContext {
     @Bean
     public SpringIdmEngineConfiguration syncopeIdmEngineConfiguration() {
         SpringIdmEngineConfiguration conf = new SpringIdmEngineConfiguration();
-        conf.setIdmIdentityService(new SyncopeIdmIdentityService(conf));
+        conf.setIdmIdentityService(new SyncopeIdmIdentityService(conf, ctx));
         return conf;
     }
 
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
index c8123e9..c30eeb1 100644
--- 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
@@ -22,23 +22,19 @@ import org.flowable.idm.api.GroupQuery;
 import org.flowable.idm.api.UserQuery;
 import org.flowable.idm.engine.IdmEngineConfiguration;
 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 {
+public class SyncopeIdmIdentityService extends IdmIdentityServiceImpl {
 
-    private ConfigurableApplicationContext ctx;
+    private final ConfigurableApplicationContext ctx;
 
-    public SyncopeIdmIdentityService(final IdmEngineConfiguration idmEngineConfiguration) {
-        super(idmEngineConfiguration);
-    }
+    public SyncopeIdmIdentityService(
+            final IdmEngineConfiguration idmEngineConfiguration,
+            final ConfigurableApplicationContext ctx) {
 
-    @Override
-    public void setApplicationContext(final ApplicationContext ctx) throws BeansException {
-        this.ctx = (ConfigurableApplicationContext) ctx;
+        super(idmEngineConfiguration);
+        this.ctx = ctx;
     }
 
     @Override