Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
48b7b085
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
48b7b085
编写于
9月 19, 2014
作者:
J
Josh Long
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adding a starters-centric disribution.
上级
d423c36f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
31 addition
and
392 deletion
+31
-392
modules/activiti-spring-boot/pom.xml
modules/activiti-spring-boot/pom.xml
+25
-147
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/main/java/org/activiti/spring/boot/AbstractProcessEngineConfiguration.java
...iviti/spring/boot/AbstractProcessEngineConfiguration.java
+0
-0
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/main/java/org/activiti/spring/boot/ActivitiProperties.java
...ain/java/org/activiti/spring/boot/ActivitiProperties.java
+0
-0
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/main/resources/META-INF/spring.factories
...arters-basic/src/main/resources/META-INF/spring.factories
+2
-0
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/test/java/org/activiti/spring/boot/TestProcessEngineAutoConfiguration.java
...iviti/spring/boot/TestProcessEngineAutoConfiguration.java
+4
-12
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/test/resources/processes/waiter.bpmn20.xml
...ters-basic/src/test/resources/processes/waiter.bpmn20.xml
+0
-0
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-rest-api/src/main/resources/META-INF/spring.factories
...ers-rest-api/src/main/resources/META-INF/spring.factories
+0
-0
modules/activiti-spring-boot/src/main/java/org/activiti/spring/boot/ProcessEngineAutoConfiguration.java
.../activiti/spring/boot/ProcessEngineAutoConfiguration.java
+0
-231
modules/activiti-spring-boot/src/test/resources/application.properties
...iti-spring-boot/src/test/resources/application.properties
+0
-2
未找到文件。
modules/activiti-spring-boot/pom.xml
浏览文件 @
48b7b085
...
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<name>
Activiti - Spring Boot
</name>
<artifactId>
activiti-spring-boot
</artifactId>
<parent>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-root
</artifactId>
...
...
@@ -11,6 +11,17 @@
<version>
5.16.4-SNAPSHOT
</version>
</parent>
<groupId>
org.activiti
</groupId>
<artifactId>
spring-boot
</artifactId>
<packaging>
pom
</packaging>
<modules>
<module>
spring-boot-starters
</module>
<module>
spring-boot-autoconfigure
</module>
</modules>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<activiti.artifact>
...
...
@@ -96,150 +107,19 @@
</plugins>
</pluginManagement>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
1.2.0.BUILD-SNAPSHOT
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-engine
</artifactId>
<!-- Excluding these in favour of the Spring Boot dependencies -->
<exclusions>
<exclusion>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-beans
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-spring
</artifactId>
<!-- Excluding these in favour of the Spring Boot dependencies -->
<exclusions>
<exclusion>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-core
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jdbc
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-tx
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-orm
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-rest
</artifactId>
<!-- Excluding these in favour of the Spring Boot dependencies -->
<!--<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</exclusion>
</exclusions>-->
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<version>
${spring.boot.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
<version>
${spring.boot.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
<version>
${spring.boot.version}
</version>
<optional>
true
</optional>
<!-- Having it on the classpath will enable JPA + Activiti, but it is not mandatory -->
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
<version>
${spring.boot.version}
</version>
<optional>
true
</optional>
<!-- Having it on the classpath will enable JPA + Activiti, but it is not mandatory -->
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<version>
${spring.boot.version}
</version>
<optional>
true
</optional>
<!-- <optional>true</optional>
<scope>test</scope>-->
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-rest
</artifactId>
<optional>
true
</optional>
<exclusions>
<exclusion>
<groupId>
log4j
</groupId>
<artifactId>
1.2.17
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-log4j12
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<profiles>
<profile>
...
...
@@ -249,9 +129,7 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-source-plugin
</artifactId>
<!--
<version>2.1.1</version>
-->
<version>
2.1.1
</version>
<executions>
<execution>
<id>
attach-sources
</id>
...
...
modules/activiti-spring-boot/src/main/java/org/activiti/spring/boot/AbstractProcessEngineConfiguration.java
→
modules/activiti-spring-boot/s
pring-boot-starters/spring-boot-starters-basic/s
rc/main/java/org/activiti/spring/boot/AbstractProcessEngineConfiguration.java
浏览文件 @
48b7b085
文件已移动
modules/activiti-spring-boot/src/main/java/org/activiti/spring/boot/ActivitiProperties.java
→
modules/activiti-spring-boot/s
pring-boot-starters/spring-boot-starters-basic/s
rc/main/java/org/activiti/spring/boot/ActivitiProperties.java
浏览文件 @
48b7b085
文件已移动
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/main/resources/META-INF/spring.factories
0 → 100644
浏览文件 @
48b7b085
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.activiti.spring.boot.BasicProcessEngineAutoConfiguration
\ No newline at end of file
modules/activiti-spring-boot/src/test/java/org/activiti/spring/boot/TestProcessEngineAutoConfiguration.java
→
modules/activiti-spring-boot/s
pring-boot-starters/spring-boot-starters-basic/s
rc/test/java/org/activiti/spring/boot/TestProcessEngineAutoConfiguration.java
浏览文件 @
48b7b085
...
...
@@ -21,6 +21,9 @@ import org.springframework.transaction.PlatformTransactionManager;
import
javax.sql.DataSource
;
import
java.util.List
;
/**
* @author Josh Long
*/
public
class
TestProcessEngineAutoConfiguration
{
private
ConfigurableApplicationContext
applicationContext
;
...
...
@@ -61,21 +64,10 @@ public class TestProcessEngineAutoConfiguration {
public
void
close
()
{
this
.
applicationContext
.
close
();
}
@Test
public
void
testRunsWithRestApis
()
{
System
.
setProperty
(
"spring.activiti.restApiEnabled"
,
"true"
);
this
.
applicationContext
=
SpringApplication
.
run
(
SimpleDataSourceConfiguration
.
class
);
// do RestTemplate or something
}
@Test
public
void
testRunsWithoutRestApis
()
{
System
.
setProperty
(
"spring.activiti.restApiEnabled"
,
"false"
);
this
.
applicationContext
=
SpringApplication
.
run
(
SimpleDataSourceConfiguration
.
class
);
}
@Before
public
void
setUp
()
{
this
.
applicationContext
=
SpringApplication
.
run
(
SimpleDataSourceConfiguration
.
class
);
}
@Test
...
...
modules/activiti-spring-boot/src/test/resources/processes/waiter.bpmn20.xml
→
modules/activiti-spring-boot/s
pring-boot-starters/spring-boot-starters-basic/s
rc/test/resources/processes/waiter.bpmn20.xml
浏览文件 @
48b7b085
文件已移动
modules/activiti-spring-boot/src/main/resources/META-INF/spring.factories
→
modules/activiti-spring-boot/s
pring-boot-starters/spring-boot-starters-rest-api/s
rc/main/resources/META-INF/spring.factories
浏览文件 @
48b7b085
文件已移动
modules/activiti-spring-boot/src/main/java/org/activiti/spring/boot/ProcessEngineAutoConfiguration.java
已删除
100644 → 0
浏览文件 @
d423c36f
/*
* Copyright 2012-2014 the original author or authors.
*
* 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.
*/
package
org.activiti.spring.boot
;
import
org.activiti.engine.*
;
import
org.activiti.rest.service.application.ActivitiRestServicesApplication
;
import
org.activiti.spring.ProcessEngineFactoryBean
;
import
org.activiti.spring.SpringJobExecutor
;
import
org.activiti.spring.SpringProcessEngineConfiguration
;
import
org.restlet.ext.servlet.ServerServlet
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.*
;
import
org.springframework.boot.context.embedded.ServletRegistrationBean
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.support.ResourcePatternResolver
;
import
org.springframework.core.task.SimpleAsyncTaskExecutor
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.util.StringUtils
;
import
javax.sql.DataSource
;
import
java.io.IOException
;
import
java.util.List
;
/**
* <p>
* Auto configuration for using Activiti from a <a
* href="http://spring.io/projects/spring-boot">Spring Boot application</a>.
* Provides a configured {@link org.activiti.engine.ProcessEngine} if none other
* is detected.
* <p>
* Discovers any process definitions deployed in the
* {@literal src/main/resources/process} folder, and uses the single
* {@link javax.sql.DataSource} bean discovered in the Spring application
* context..
*
* @author Josh Long
* @author Joram Barrez
*/
@EnableConfigurationProperties
(
ActivitiProperties
.
class
)
@Configuration
public
class
ProcessEngineAutoConfiguration
{
@Configuration
public
static
class
DefaultProcessEngineConfiguration
extends
AbstractProcessEngineConfiguration
{
@Bean
public
SpringJobExecutor
springJobExecutor
(
TaskExecutor
taskExecutor
)
{
return
new
SpringJobExecutor
(
taskExecutor
);
}
@Autowired
private
ActivitiProperties
activitiProperties
;
@Autowired
private
ResourcePatternResolver
resourceLoader
;
@Bean
@ConditionalOnBean
(
DataSource
.
class
)
public
SpringProcessEngineConfiguration
activitiConfiguration
(
DataSource
dataSource
,
PlatformTransactionManager
transactionManager
,
SpringJobExecutor
springJobExecutor
)
throws
IOException
{
List
<
Resource
>
procDefResources
=
this
.
discoverProcessDefinitionResources
(
this
.
resourceLoader
,
this
.
activitiProperties
.
getProcessDefinitionLocationPrefix
(),
this
.
activitiProperties
.
getProcessDefinitionLocationSuffix
(),
this
.
activitiProperties
.
isCheckProcessDefinitions
());
SpringProcessEngineConfiguration
conf
=
super
.
processEngineConfigurationBean
(
procDefResources
.
toArray
(
new
Resource
[
procDefResources
.
size
()]),
dataSource
,
transactionManager
,
springJobExecutor
);
conf
.
setDeploymentName
(
defaultText
(
activitiProperties
.
getDeploymentName
(),
conf
.
getDeploymentName
()));
conf
.
setDatabaseSchema
(
defaultText
(
activitiProperties
.
getDatabaseSchema
(),
conf
.
getDatabaseSchema
()));
conf
.
setDatabaseSchemaUpdate
(
defaultText
(
activitiProperties
.
getDatabaseSchemaUpdate
(),
conf
.
getDatabaseSchemaUpdate
()));
return
conf
;
}
private
String
defaultText
(
String
deploymentName
,
String
deploymentName1
)
{
if
(
StringUtils
.
hasText
(
deploymentName
))
return
deploymentName
;
return
deploymentName1
;
}
@Bean
public
ProcessEngine
processEngine
(
SpringProcessEngineConfiguration
configuration
)
throws
Exception
{
ProcessEngineFactoryBean
processEngineFactoryBean
=
new
ProcessEngineFactoryBean
();
processEngineFactoryBean
.
setProcessEngineConfiguration
(
configuration
);
return
processEngineFactoryBean
.
getObject
();
}
@Bean
@ConditionalOnMissingBean
@Override
public
RuntimeService
runtimeServiceBean
(
ProcessEngine
processEngine
)
{
return
super
.
runtimeServiceBean
(
processEngine
);
}
@Bean
@ConditionalOnMissingBean
@Override
public
RepositoryService
repositoryServiceBean
(
ProcessEngine
processEngine
)
{
return
super
.
repositoryServiceBean
(
processEngine
);
}
@Bean
@ConditionalOnMissingBean
@Override
public
TaskService
taskServiceBean
(
ProcessEngine
processEngine
)
{
return
super
.
taskServiceBean
(
processEngine
);
}
@Bean
@ConditionalOnMissingBean
@Override
public
HistoryService
historyServiceBean
(
ProcessEngine
processEngine
)
{
return
super
.
historyServiceBean
(
processEngine
);
}
@Bean
@ConditionalOnMissingBean
@Override
public
ManagementService
managementServiceBeanBean
(
ProcessEngine
processEngine
)
{
return
super
.
managementServiceBeanBean
(
processEngine
);
}
@Bean
@ConditionalOnMissingBean
@Override
public
FormService
formServiceBean
(
ProcessEngine
processEngine
)
{
return
super
.
formServiceBean
(
processEngine
);
}
@Bean
@ConditionalOnMissingBean
@Override
public
IdentityService
identityServiceBean
(
ProcessEngine
processEngine
)
{
return
super
.
identityServiceBean
(
processEngine
);
}
@Bean
@ConditionalOnMissingBean
public
PlatformTransactionManager
transactionManager
(
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
@Bean
@ConditionalOnMissingBean
public
TaskExecutor
taskExecutor
()
{
return
new
SimpleAsyncTaskExecutor
();
}
}
@ConditionalOnExpression
(
"${spring.activiti.restApiEnabled:true}"
)
@Configuration
@ConditionalOnClass
({
ActivitiRestServicesApplication
.
class
,
ServletRegistrationBean
.
class
,
ServerServlet
.
class
})
public
static
class
RestServiceAutoConfiguration
{
@Autowired
private
ActivitiProperties
activitiProperties
;
@Bean
public
ServletRegistrationBean
activitiRestRegistration
()
{
ServerServlet
servlet
=
new
ServerServlet
();
ServletRegistrationBean
registration
=
new
ServletRegistrationBean
(
servlet
,
this
.
activitiProperties
.
getRestApiMapping
());
registration
.
addInitParameter
(
"org.restlet.application"
,
"org.activiti.rest.service.application.ActivitiRestServicesApplication"
);
registration
.
setName
(
this
.
activitiProperties
.
getRestApiServletName
());
return
null
;
}
}
/*
@Configuration
@ConditionalOnClass({EntityManagerFactory.class})
public static class JpaAutoConfiguration {
@Bean
InitializingBean configureJpaForActiviti(
final EntityManagerFactory emf,
final ActivitiProperties activitiProperties,
final SpringProcessEngineConfiguration processEngineAutoConfiguration) {
return new InitializingBean() {
@Override
public void afterPropertiesSet() throws Exception {
if (activitiProperties.isJpa()) {
processEngineAutoConfiguration
.setJpaEntityManagerFactory(emf);
processEngineAutoConfiguration
.setJpaHandleTransaction(false);
processEngineAutoConfiguration
.setJpaCloseEntityManager(false);
}
}
};
}
}*/
}
modules/activiti-spring-boot/src/test/resources/application.properties
已删除
100644 → 0
浏览文件 @
d423c36f
debug
true
spring.activiti.restApiEnabled
false
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录