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 2017/08/28 09:13:23 UTC
[8/8] syncope git commit: [SYNCOPE-1054] Replacing Activiti with
Flowable - still 5.x
[SYNCOPE-1054] Replacing Activiti with Flowable - still 5.x
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/7098ca9f
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/7098ca9f
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/7098ca9f
Branch: refs/heads/master
Commit: 7098ca9f6a46273d5ed1ed0214fd5e1b48eb1a6a
Parents: 1fe2d69
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Aug 28 11:13:06 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Aug 28 11:13:06 2017 +0200
----------------------------------------------------------------------
archetype/pom.xml | 2 +-
.../archetype-resources/console/pom.xml | 54 +-
.../resources/archetype-resources/core/pom.xml | 2 +-
.../archetype-resources/enduser/pom.xml | 6 +-
archetype/src/main/resources/meta-pom.xml | 2 +-
.../console/SyncopeConsoleApplication.java | 16 +-
.../client/console/commons/Constants.java | 2 -
.../console/pages/ActivitiModelerPopupPage.java | 27 -
.../syncope/client/console/pages/BasePage.java | 4 +-
.../console/pages/FlowableModelerPopupPage.java | 27 +
.../syncope/client/console/pages/Workflow.java | 2 +-
.../console/panels/WorkflowDirectoryPanel.java | 8 +-
.../resources/WorkflowDefGETResource.java | 2 +-
.../resources/WorkflowDefPUTResource.java | 2 +-
.../src/main/resources/console.properties | 2 +-
.../console/pages/ActivitiModelerPopupPage.html | 28 -
.../console/pages/FlowableModelerPopupPage.html | 28 +
.../client/console/pages/Workflow.properties | 2 +-
.../client/console/pages/Workflow_it.properties | 2 +-
.../console/pages/Workflow_pt_BR.properties | 2 +-
.../client/console/pages/Workflow_ru.properties | 5 +-
.../client/console/panels/empty.bpmn20.xml | 4 +-
core/pom.xml | 2 +-
.../rest/cxf/RestServiceExceptionMapper.java | 2 +-
core/workflow-activiti/pom.xml | 87 -
.../activiti/ActivitiDefinitionLoader.java | 96 -
.../workflow/activiti/ActivitiDeployUtils.java | 97 -
.../activiti/ActivitiUserWorkflowAdapter.java | 927 -------
.../core/workflow/activiti/ActivitiUtils.java | 31 -
.../activiti/SyncopeEntitiesVariableType.java | 35 -
.../workflow/activiti/SyncopeGroupManager.java | 122 -
.../activiti/SyncopeGroupQueryImpl.java | 159 --
.../core/workflow/activiti/SyncopeSession.java | 26 -
.../activiti/SyncopeSessionFactory.java | 45 -
.../workflow/activiti/SyncopeUserManager.java | 166 --
.../workflow/activiti/SyncopeUserQueryImpl.java | 206 --
.../activiti/spring/DomainProcessEngine.java | 114 -
.../spring/DomainProcessEngineFactoryBean.java | 104 -
.../task/AbstractActivitiServiceTask.java | 45 -
.../workflow/activiti/task/AutoActivate.java | 31 -
.../core/workflow/activiti/task/Create.java | 52 -
.../core/workflow/activiti/task/Delete.java | 41 -
.../workflow/activiti/task/GenerateToken.java | 44 -
.../core/workflow/activiti/task/Notify.java | 65 -
.../workflow/activiti/task/PasswordReset.java | 71 -
.../core/workflow/activiti/task/Reactivate.java | 29 -
.../core/workflow/activiti/task/Recertify.java | 58 -
.../core/workflow/activiti/task/Suspend.java | 29 -
.../core/workflow/activiti/task/Update.java | 49 -
.../src/main/resources/userWorkflow.bpmn20.xml | 287 ---
.../src/main/resources/workflow.properties | 22 -
.../main/resources/workflowActivitiContext.xml | 69 -
core/workflow-flowable/pom.xml | 87 +
.../flowable/FlowableDefinitionLoader.java | 96 +
.../workflow/flowable/FlowableDeployUtils.java | 97 +
.../flowable/FlowableUserWorkflowAdapter.java | 941 ++++++++
.../core/workflow/flowable/FlowableUtils.java | 31 +
.../flowable/SyncopeEntitiesVariableType.java | 35 +
.../workflow/flowable/SyncopeGroupManager.java | 122 +
.../flowable/SyncopeGroupQueryImpl.java | 159 ++
.../core/workflow/flowable/SyncopeSession.java | 26 +
.../flowable/SyncopeSessionFactory.java | 45 +
.../workflow/flowable/SyncopeUserManager.java | 166 ++
.../workflow/flowable/SyncopeUserQueryImpl.java | 206 ++
.../flowable/spring/DomainProcessEngine.java | 114 +
.../spring/DomainProcessEngineFactoryBean.java | 104 +
.../task/AbstractFlowableServiceTask.java | 45 +
.../workflow/flowable/task/AutoActivate.java | 31 +
.../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 | 49 +
.../src/main/resources/userWorkflow.bpmn20.xml | 287 +++
.../src/main/resources/workflow.properties | 22 +
.../main/resources/workflowFlowableContext.xml | 69 +
deb/core/LICENSE | 2 +-
deb/core/NOTICE | 2 +-
deb/core/pom.xml | 4 +-
fit/console-reference/pom.xml | 49 +-
.../src/main/resources/console.properties | 2 +-
.../src/main/resources/url-config.js | 8 +-
fit/core-reference/pom.xml | 6 +-
.../src/main/resources/all/workflow.properties | 2 +-
.../src/main/resources/userWorkflow.bpmn20.xml | 82 +-
.../apache/syncope/fit/ActivitiDetector.java | 36 -
.../apache/syncope/fit/FlowableDetector.java | 36 +
.../syncope/fit/console/AjaxBrowseITCase.java | 4 +-
.../syncope/fit/core/AuthenticationITCase.java | 4 +-
.../syncope/fit/core/MigrationITCase.java | 530 ----
.../apache/syncope/fit/core/PullTaskITCase.java | 4 +-
.../org/apache/syncope/fit/core/UserITCase.java | 8 +-
.../apache/syncope/fit/core/UserSelfITCase.java | 13 +-
.../syncope/fit/core/UserWorkflowITCase.java | 10 +-
.../apache/syncope/fit/core/WorkflowITCase.java | 8 +-
.../src/test/resources/addActivitiToContent.xsl | 50 -
.../src/test/resources/addFlowableToContent.xsl | 50 +
.../src/test/resources/console.properties | 2 +-
fit/core-reference/src/test/resources/rebel.xml | 4 +-
.../src/test/resources/syncope12.sql | 2265 ------------------
.../syncope/installer/files/ConsolePom.java | 89 +-
.../apache/syncope/installer/files/CorePom.java | 6 +-
.../installer/processes/ArchetypeProcess.java | 10 +-
.../installer/processes/ContainerProcess.java | 2 +-
.../main/resources/izpack/ProcessPanel.Spec.xml | 2 +-
installer/src/main/resources/izpack/install.xml | 4 +-
.../main/resources/izpack/userInputLang.xml_eng | 4 +-
.../main/resources/izpack/userInputLang.xml_ita | 4 +-
.../src/main/resources/izpack/userInputSpec.xml | 6 +-
pom.xml | 35 +-
.../asciidoc/getting-started/introduction.adoc | 5 +-
.../reference-guide/architecture/core.adoc | 6 +-
.../reference-guide/concepts/notifications.adoc | 2 +-
.../reference-guide/concepts/tasks.adoc | 2 +-
.../reference-guide/concepts/workflow.adoc | 52 +-
.../workingwithapachesyncope/customization.adoc | 4 +-
.../systemadministration/activitimodeler.adoc | 46 -
.../systemadministration/flowablemodeler.adoc | 46 +
.../systemadministration.adoc | 2 +-
src/site/xdoc/architecture.xml | 2 +-
src/site/xdoc/building.xml | 4 +-
standalone/LICENSE | 2 +-
standalone/NOTICE | 2 +-
standalone/pom.xml | 4 +-
128 files changed, 3590 insertions(+), 6393 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/archetype/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/pom.xml b/archetype/pom.xml
index 4b3e0ab..4cd3c45 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -213,7 +213,7 @@ under the License.
<directory>../fit/core-reference/src/test/resources</directory>
<targetPath>${project.build.outputDirectory}/archetype-resources/core/src/test/resources</targetPath>
<includes>
- <include>addActivitiToContent.xsl</include>
+ <include>addFlowableToContent.xsl</include>
<include>keystore</include>
</includes>
</resource>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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 2006755..52de63a 100644
--- a/archetype/src/main/resources/archetype-resources/console/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/console/pom.xml
@@ -141,8 +141,8 @@ under the License.
</dependency>
<dependency>
- <groupId>org.activiti</groupId>
- <artifactId>activiti-webapp-explorer2</artifactId>
+ <groupId>org.flowable</groupId>
+ <artifactId>flowable-webapp-explorer2</artifactId>
<type>war</type>
<scope>test</scope>
</dependency>
@@ -156,47 +156,41 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>setupActivitiModeler</id>
+ <id>setupFlowableModeler</id>
<phase>process-resources</phase>
<configuration>
<target>
- <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
- dest="${project.build.directory}/activiti-webapp-explorer2" />
+ <unzip src="${settings.localRepository}/org/flowable/flowable-webapp-explorer2/${flowable.version}/flowable-webapp-explorer2-${flowable.version}.war"
+ dest="${project.build.directory}/flowable-webapp-explorer2"/>
- <mkdir dir="${activiti-modeler.directory}" />
- <copy file="${project.build.directory}/activiti-webapp-explorer2/modeler.html"
- todir="${activiti-modeler.directory}" />
- <replace file="${activiti-modeler.directory}/modeler.html"
+ <mkdir dir="${flowable-modeler.directory}"/>
+ <copy file="${project.build.directory}/flowable-webapp-explorer2/modeler.html"
+ todir="${flowable-modeler.directory}"/>
+ <replace file="${flowable-modeler.directory}/modeler.html"
token="</head>"
value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>"/>
- <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
- todir="${activiti-modeler.directory}" />
+ <copy file="${project.build.directory}/flowable-webapp-explorer2/WEB-INF/classes/stencilset.json"
+ todir="${flowable-modeler.directory}"/>
- <mkdir dir="${activiti-modeler.directory}/editor-app" />
- <copy todir="${activiti-modeler.directory}/editor-app">
- <fileset dir="${project.build.directory}/activiti-webapp-explorer2/editor-app" />
+ <mkdir dir="${flowable-modeler.directory}/editor-app"/>
+ <copy todir="${flowable-modeler.directory}/editor-app">
+ <fileset dir="${project.build.directory}/flowable-webapp-explorer2/editor-app"/>
</copy>
- <replaceregexp file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
- match="ORYX.CONFIG.ROOT_PATH =.*"editor/"; //TODO: Remove last slash!!"
- replace="BASE_PATH = window.location.toString().substr(0, window.location.toString().indexOf('/wicket'));
-ORYX.CONFIG.ROOT_PATH = BASE_PATH + "/activiti-modeler/editor-app/editor/";"
- byline="true"/>
- <replace file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
- token="new Ajax.Request(ACTIVITI.CONFIG.contextRoot + '/editor/stencilset?version=' + Date.now(), {"
- value="new Ajax.Request(window.location.toString().substr(0, window.location.toString().indexOf('/activiti-modeler')) + "/activiti-modeler/stencilset.json", {"/>
- <replace file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
- token="ORYX.Editor.createByUrl(modelUrl);"
- value="modelUrl = BASE_PATH + "/workflowDefGET?modelId=" + this.modelId; ORYX.Editor.createByUrl(modelUrl);" />
- <replace file="${activiti-modeler.directory}/editor-app/configuration/toolbar-default-actions.js"
+ <replace file="${flowable-modeler.directory}/editor-app/editor/oryx.debug.js"
+ token="return this.changeDifference !== 0 || (this.facade.getModelMetaData()['new'] && this.facade.getCanvas().getChildShapes().size() > 0);"
+ value="return this.changeDifference !== 0
+ || (typeof this.facade.getModelMetaData() != 'undefined'
+ && this.facade.getModelMetaData()['new'] && this.facade.getCanvas().getChildShapes().size() > 0);"/>
+ <replace file="${flowable-modeler.directory}/editor-app/configuration/toolbar-default-actions.js"
token="window.location.href = "./";"
value="window.close();"/>
<copy file="${basedir}/src/main/resources/url-config.js"
- todir="${activiti-modeler.directory}/editor-app/configuration"
- overwrite="true" />
+ todir="${flowable-modeler.directory}/editor-app/configuration"
+ overwrite="true"/>
<copy file="${basedir}/src/main/resources/save-model.html"
- todir="${activiti-modeler.directory}/editor-app/popups"
- overwrite="true" />
+ todir="${flowable-modeler.directory}/editor-app/popups"
+ overwrite="true"/>
</target>
</configuration>
<goals>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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 f4ea761..aae48ce 100644
--- a/archetype/src/main/resources/archetype-resources/core/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/core/pom.xml
@@ -161,7 +161,7 @@ under the License.
<dependencies>
<dependency>
<groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-activiti</artifactId>
+ <artifactId>syncope-core-workflow-flowable</artifactId>
<version>${syncope.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/archetype/src/main/resources/archetype-resources/enduser/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/archetype-resources/enduser/pom.xml b/archetype/src/main/resources/archetype-resources/enduser/pom.xml
index 38ae43d..0b097f3 100644
--- a/archetype/src/main/resources/archetype-resources/enduser/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/enduser/pom.xml
@@ -193,7 +193,7 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
- <id>addActivitiTestContent</id>
+ <id>addFlowableTestContent</id>
<phase>prepare-package</phase>
<configuration>
<target>
@@ -211,14 +211,14 @@ under the License.
</then>
</if>
<if>
- <available file="../core/target/syncope/WEB-INF/lib/activiti-engine-${activiti.version}.jar"/>
+ <available file="../core/target/syncope/WEB-INF/lib/flowable-engine-${flowable.version}.jar"/>
<then>
<xslt basedir="../core/target/test-classes/backup"
includes="MasterContent.xml"
destdir="../core/target/test-classes/domains"
extension=".xml"
force="true"
- style="../core/src/test/resources/addActivitiToContent.xsl"/>
+ style="../core/src/test/resources/addFlowableToContent.xsl"/>
</then>
</if>
</target>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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 a322758..0b163ae 100644
--- a/archetype/src/main/resources/meta-pom.xml
+++ b/archetype/src/main/resources/meta-pom.xml
@@ -72,7 +72,7 @@ under the License.
<dependency>
<groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-activiti</artifactId>
+ <artifactId>syncope-core-workflow-flowable</artifactId>
<version>${syncope.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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 6c6b6e4..467312c 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
@@ -78,7 +78,7 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
Locale.ENGLISH, Locale.ITALIAN, new Locale("pt", "BR"), new Locale("ru")
}));
- private static final String ACTIVITI_MODELER_CONTEXT = "activiti-modeler";
+ private static final String FLOWABLE_MODELER_CONTEXT = "flowable-modeler";
public static SyncopeConsoleApplication get() {
return (SyncopeConsoleApplication) WebApplication.get();
@@ -90,7 +90,7 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
private String anonymousKey;
- private String activitiModelerDirectory;
+ private String flowableModelerDirectory;
private String reconciliationReportKey;
@@ -193,8 +193,8 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
mountPage("/login", getSignInPageClass());
- activitiModelerDirectory = props.getProperty("activitiModelerDirectory");
- Args.notNull(activitiModelerDirectory, "<activitiModelerDirectory>");
+ flowableModelerDirectory = props.getProperty("flowableModelerDirectory");
+ Args.notNull(flowableModelerDirectory, "<flowableModelerDirectory>");
try {
reconciliationReportKey = props.getProperty("reconciliationReportKey");
@@ -203,13 +203,13 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
}
Args.notNull(reconciliationReportKey, "<reconciliationReportKey>");
- mountResource("/" + ACTIVITI_MODELER_CONTEXT, new ResourceReference(ACTIVITI_MODELER_CONTEXT) {
+ mountResource("/" + FLOWABLE_MODELER_CONTEXT, new ResourceReference(FLOWABLE_MODELER_CONTEXT) {
private static final long serialVersionUID = -128426276529456602L;
@Override
public IResource getResource() {
- return new FilesystemResource(ACTIVITI_MODELER_CONTEXT, activitiModelerDirectory);
+ return new FilesystemResource(FLOWABLE_MODELER_CONTEXT, flowableModelerDirectory);
}
});
@@ -272,8 +272,8 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
return anonymousKey;
}
- public String getActivitiModelerDirectory() {
- return activitiModelerDirectory;
+ public String getFlowableModelerDirectory() {
+ return flowableModelerDirectory;
}
public String getReconciliationReportKey() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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 dc2d260..5449097 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
@@ -31,8 +31,6 @@ public final class Constants {
public static final String VEIL_INDICATOR_MARKUP_ID = "veil";
- public static final String ACTIVITI_MODELER_CONTEXT = "activiti-modeler";
-
public static final String FLOWABLE_MODELER_CONTEXT = "flowable-modeler";
public static final String MODELER_CONTEXT = "modelerContext";
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
deleted file mode 100644
index 05658fc..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.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 ActivitiModelerPopupPage extends WebPage {
-
- private static final long serialVersionUID = -7031206743629422898L;
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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 8a02ec9..e7ec23c 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
@@ -179,7 +179,7 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
liContainer = new WebMarkupContainer(getLIContainerId("workflow"));
liContainer.setOutputMarkupPlaceholderTag(true);
- liContainer.setVisible(platformInfo.getUserWorkflowAdapter().contains("Activiti"));
+ liContainer.setVisible(platformInfo.getUserWorkflowAdapter().contains("Flowable"));
confULContainer.add(liContainer);
link = BookmarkablePageLinkBuilder.build("workflow", Workflow.class);
MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, StandardEntitlement.WORKFLOW_DEF_GET);
@@ -255,7 +255,7 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
final Class<? extends WebPage> beforeLogout = (Class<? extends WebPage>) SyncopeConsoleSession.get().
getAttribute(Constants.BEFORE_LOGOUT_PAGE);
if (beforeLogout == null) {
- body.add(new BookmarkablePageLink<Page>("logout", Logout.class));
+ body.add(new BookmarkablePageLink<>("logout", Logout.class));
} else {
body.add(new AjaxLink<Page>("logout") {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
new file mode 100644
index 0000000..b55d2b5
--- /dev/null
+++ b/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/7098ca9f/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
index 01f4655..5ab09c3 100644
--- 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
@@ -55,7 +55,7 @@ public class Workflow extends BasePage {
content.add(workflowsPanel);
- if (SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti")) {
+ if (SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Flowable")) {
disabled.setVisible(false);
} else {
workflowsPanel.setVisible(false);
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
index 1a0e26a..980fe4c 100644
--- 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
@@ -126,13 +126,13 @@ public class WorkflowDirectoryPanel extends DirectoryPanel<
});
initResultTable();
- // Check if Activiti or Flowable Modeler directory is found
+ // Check if Flowable Modeler directory is found
modelerCtx = null;
try {
- if (SyncopeConsoleApplication.get().getActivitiModelerDirectory() != null) {
- File baseDir = new File(SyncopeConsoleApplication.get().getActivitiModelerDirectory());
+ if (SyncopeConsoleApplication.get().getFlowableModelerDirectory() != null) {
+ File baseDir = new File(SyncopeConsoleApplication.get().getFlowableModelerDirectory());
if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
- modelerCtx = Constants.ACTIVITI_MODELER_CONTEXT;
+ modelerCtx = Constants.FLOWABLE_MODELER_CONTEXT;
}
}
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
index 5b1bece..46fb22a 100644
--- 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
@@ -26,7 +26,7 @@ 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 Activiti Modeler).
+ * Mirror REST resource for obtaining user workflow definition in JSON (used by Flowable Modeler).
*
* @see org.apache.syncope.common.rest.api.service.WorkflowService#get
*/
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
index efef6d1..84ec3e5 100644
--- 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
@@ -27,7 +27,7 @@ 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 Activiti Modeler).
+ * Mirror REST resource for putting user workflow definition in JSON (used by Flowable Modeler).
*
* @see org.apache.syncope.common.rest.api.service.WorkflowService#set
*/
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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 59c3c09..c2da7e3 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -29,7 +29,7 @@ useGZIPCompression=true
csrf=true
-activitiModelerDirectory=${activiti-modeler.directory}
+flowableModelerDirectory=${flowable-modeler.directory}
reconciliationReportKey=c3520ad9-179f-49e7-b315-d684d216dd97
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
deleted file mode 100644
index 416df19..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.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 / Activiti Modeler</title>
-
- <meta http-equiv="refresh" content="0; url=../../activiti-modeler/modeler.html"/>
- </head>
- <body>
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
new file mode 100644
index 0000000..e1afe72
--- /dev/null
+++ b/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/7098ca9f/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
index a9635bf..b8abd93 100644
--- 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
@@ -14,6 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-noActivitiEnabledForUsers=Activiti not enabled for users
+noFlowableEnabledForUsers=Flowable not enabled for users
xmlEditorTitle=Workflow XML Editor
main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
index ff96099..1f9eb5a 100644
--- 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
@@ -14,6 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-noActivitiEnabledForUsers=Activiti non configurato per gli utenti
+noFlowableEnabledForUsers=Flowable non configurato per gli utenti
xmlEditorTitle=Workflow XML Editor
main=Principale
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
index ae769c6..34829e5 100644
--- 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
@@ -14,6 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-noActivitiEnabledForUsers=Activiti n\u00e3o habilitado para usu\u00e1rios
+noFlowableEnabledForUsers=Flowable n\u00e3o habilitado para usu\u00e1rios
xmlEditorTitle=Workflow XML Editor
main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/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
index a05edf6..96c2862 100644
--- 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
@@ -14,9 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-#
-# noActivitiEnabledForUsers=Activiti отключен для пользователей
-noActivitiEnabledForUsers=Activiti \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 редактор процесса согласования
+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/7098ca9f/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
index 7e9e7ea..5943197 100644
--- 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
@@ -19,13 +19,13 @@ under the License.
-->
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:activiti="http://activiti.org/bpmn"
+ xmlns: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://activiti.org/bpmn20">
+ targetNamespace="http://www.flowable.org/processdef">
<process id="%KEY%" name="%KEY%" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 9af2e48..922c2d4 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -84,7 +84,7 @@ under the License.
<module>provisioning-java</module>
<module>workflow-api</module>
<module>workflow-java</module>
- <module>workflow-activiti</module>
+ <module>workflow-flowable</module>
<module>logic</module>
<module>rest-cxf</module>
<module>migration</module>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/RestServiceExceptionMapper.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/RestServiceExceptionMapper.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/RestServiceExceptionMapper.java
index 718216e..9b97000 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/RestServiceExceptionMapper.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/RestServiceExceptionMapper.java
@@ -234,7 +234,7 @@ public class RestServiceExceptionMapper implements ExceptionMapper<Exception> {
}
private ResponseBuilder processBadRequestExceptions(final Exception ex) {
- // This exception might be raised by Activiti (if enabled)
+ // This exception might be raised by Flowable (if enabled)
Class<?> ibatisPersistenceException = null;
try {
ibatisPersistenceException = Class.forName("org.apache.ibatis.exceptions.PersistenceException");
http://git-wip-us.apache.org/repos/asf/syncope/blob/7098ca9f/core/workflow-activiti/pom.xml
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/pom.xml b/core/workflow-activiti/pom.xml
deleted file mode 100644
index 753b4e9..0000000
--- a/core/workflow-activiti/pom.xml
+++ /dev/null
@@ -1,87 +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.0-SNAPSHOT</version>
- </parent>
-
- <name>Apache Syncope Core Workflow Activiti</name>
- <description>Apache Syncope Core Workflow Activiti</description>
- <groupId>org.apache.syncope.core</groupId>
- <artifactId>syncope-core-workflow-activiti</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.activiti</groupId>
- <artifactId>activiti-engine</artifactId>
- </dependency>
- <dependency>
- <groupId>org.activiti</groupId>
- <artifactId>activiti-spring</artifactId>
- </dependency>
- <dependency>
- <groupId>org.activiti</groupId>
- <artifactId>activiti-json-converter</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</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/7098ca9f/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDefinitionLoader.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDefinitionLoader.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDefinitionLoader.java
deleted file mode 100644
index 9521213..0000000
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDefinitionLoader.java
+++ /dev/null
@@ -1,96 +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.activiti;
-
-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.activiti.engine.ProcessEngine;
-import org.activiti.engine.repository.ProcessDefinition;
-import org.activiti.spring.SpringProcessEngineConfiguration;
-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.activiti.spring.DomainProcessEngine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ActivitiDefinitionLoader implements SyncopeLoader {
-
- private static final Logger LOG = LoggerFactory.getLogger(ActivitiDefinitionLoader.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];
-
- InputStream wfIn = null;
- try {
- wfIn = userWorkflowDef.getResource().getInputStream();
- wfDef = IOUtils.toByteArray(wfIn);
- } catch (IOException e) {
- LOG.error("While loading " + userWorkflowDef.getResource().getFilename(), e);
- } finally {
- IOUtils.closeQuietly(wfIn);
- }
-
- for (Map.Entry<String, ProcessEngine> entry : dpEngine.getEngines().entrySet()) {
- List<ProcessDefinition> processes = entry.getValue().getRepositoryService().
- createProcessDefinitionQuery().processDefinitionKey(ActivitiUserWorkflowAdapter.WF_PROCESS_ID).
- list();
- LOG.debug(ActivitiUserWorkflowAdapter.WF_PROCESS_ID + " Activiti 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(ActivitiUserWorkflowAdapter.WF_PROCESS_ID).latestVersion().
- singleResult();
-
- ActivitiDeployUtils.deployModel(entry.getValue(), procDef);
-
- LOG.debug("Activiti 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/7098ca9f/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDeployUtils.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDeployUtils.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDeployUtils.java
deleted file mode 100644
index 965e03c..0000000
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiDeployUtils.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.core.workflow.activiti;
-
-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.activiti.bpmn.converter.BpmnXMLConverter;
-import org.activiti.bpmn.model.BpmnModel;
-import org.activiti.editor.constants.ModelDataJsonConstants;
-import org.activiti.editor.language.json.converter.BpmnJsonConverter;
-import org.activiti.engine.ActivitiException;
-import org.activiti.engine.ProcessEngine;
-import org.activiti.engine.repository.Deployment;
-import org.activiti.engine.repository.Model;
-import org.activiti.engine.repository.ProcessDefinition;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.core.workflow.api.WorkflowException;
-
-public final class ActivitiDeployUtils {
-
- 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 (ActivitiException e) {
- throw new WorkflowException("While importing " + resourceName, e);
- }
- }
-
- public static void deployModel(final ProcessEngine engine, final ProcessDefinition procDef) {
- InputStream bpmnStream = null;
- InputStreamReader isr = null;
- XMLStreamReader xtr = null;
- try {
- bpmnStream = engine.getRepositoryService().getResourceAsStream(
- procDef.getDeploymentId(), procDef.getResourceName());
- 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
- }
- }
- IOUtils.closeQuietly(isr);
- IOUtils.closeQuietly(bpmnStream);
- }
- }
-
- private ActivitiDeployUtils() {
- // private constructor for static utility class
- }
-}