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/05/07 07:29:23 UTC

[syncope] branch master updated: [SYNCOPE-1470] Workaround (as Flowable does not support MariaDB): treat MariaDB as MySQL

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


The following commit(s) were added to refs/heads/master by this push:
     new 3419d9e  [SYNCOPE-1470] Workaround (as Flowable does not support MariaDB): treat MariaDB as MySQL
3419d9e is described below

commit 3419d9eddfe0bf74e3a8b108f43242b6aa654e19
Author: Francesco Chicchiriccò <il...@apachge.org>
AuthorDate: Tue May 7 09:27:36 2019 +0200

    [SYNCOPE-1470] Workaround (as Flowable does not support MariaDB): treat MariaDB as MySQL
---
 .../core/flowable/WorkflowFlowableContext.java     |  6 ++---
 .../support/DomainProcessEngineConfiguration.java  | 31 ++++++++++++++++++++++
 2 files changed, 34 insertions(+), 3 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 9871471..138a89c 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
@@ -22,6 +22,7 @@ import java.util.Arrays;
 import org.apache.syncope.core.flowable.impl.FlowableBpmnProcessManager;
 import org.apache.syncope.core.flowable.impl.FlowableUserRequestHandler;
 import org.apache.syncope.core.flowable.impl.FlowableWorkflowUtils;
+import org.apache.syncope.core.flowable.support.DomainProcessEngineConfiguration;
 import org.apache.syncope.core.flowable.support.SyncopeEntitiesVariableType;
 import org.apache.syncope.core.flowable.support.SyncopeFormHandlerHelper;
 import org.apache.syncope.core.flowable.support.SyncopeIdmIdentityService;
@@ -33,7 +34,6 @@ import org.flowable.common.engine.impl.history.HistoryLevel;
 import org.flowable.engine.impl.db.DbIdGenerator;
 import org.flowable.idm.spring.SpringIdmEngineConfiguration;
 import org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator;
-import org.flowable.spring.SpringProcessEngineConfiguration;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.context.annotation.Bean;
@@ -122,8 +122,8 @@ public class WorkflowFlowableContext {
     @ConditionalOnMissingBean
     @Bean
     @Scope("prototype")
-    public SpringProcessEngineConfiguration processEngineConfiguration() {
-        SpringProcessEngineConfiguration conf = new SpringProcessEngineConfiguration();
+    public DomainProcessEngineConfiguration processEngineConfiguration() {
+        DomainProcessEngineConfiguration conf = new DomainProcessEngineConfiguration();
         conf.setDatabaseSchemaUpdate(AbstractEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
         conf.setJpaHandleTransaction(true);
         conf.setJpaCloseEntityManager(false);
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..6f18e84
--- /dev/null
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineConfiguration.java
@@ -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.
+ */
+package org.apache.syncope.core.flowable.support;
+
+import org.flowable.spring.SpringProcessEngineConfiguration;
+
+public class DomainProcessEngineConfiguration extends SpringProcessEngineConfiguration {
+
+    public DomainProcessEngineConfiguration() {
+        super();
+
+        // workaround for Flowable not supporting (yet?) MariaDB
+        databaseTypeMappings.setProperty("MariaDB", DATABASE_TYPE_MYSQL);
+    }
+}