mirror of
https://gitee.com/nutz/nutzboot.git
synced 2024-12-02 03:38:08 +08:00
Merge pull request #96 from nutzam/add_activiti
add: 把nutzmore的activiti封装一下,完成starter-activiti
This commit is contained in:
commit
1d48a17123
@ -12,6 +12,7 @@
|
||||
* add: feign完成feign-ribbon-eureka集成,实现负载均衡和服务发现
|
||||
* add: feign添加feign-hystrix依赖,强化与hystrix的集成
|
||||
* add: [rabbitmq](https://www.rabbitmq.com/) 开源消息代理
|
||||
* add: [activiti](https://www.activiti.org/) 工作流
|
||||
* change: feign默认不设置encoder/decoder,上一个版本默认jackson,并添加更多配置项.
|
||||
* change: 重构项目结构,用户项目不再需要依赖nutzboot-starter
|
||||
* change: 启用server.port和server.host,将jetty/undertow/tomcat的port和host设为过期配置,但继续兼容.
|
||||
|
@ -174,7 +174,7 @@ public class MainLauncher {
|
||||
- [ ] zbus
|
||||
- 工作流
|
||||
- [x] [uflo2](https://github.com/youseries/uflo) 中式工作流引擎
|
||||
- [ ] Activity
|
||||
- [x] [activiti](https://www.activiti.org/)
|
||||
- 规则引擎
|
||||
- [x] [urule](https://github.com/youseries/urule) 中式规则引擎
|
||||
- [ ] drools
|
||||
|
16
nutzboot-contrib/nutzboot-starter-activiti/pom.xml
Normal file
16
nutzboot-contrib/nutzboot-starter-activiti/pom.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<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.nutz</groupId>
|
||||
<artifactId>nutzboot-contrib</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>nutzboot-starter-activiti</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutz-integration-activiti</artifactId>
|
||||
<version>1.r.65-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,20 @@
|
||||
package org.nutz.boot.starter.activiti;
|
||||
|
||||
import org.activiti.engine.ProcessEngine;
|
||||
import org.nutz.boot.starter.ServerFace;
|
||||
import org.nutz.ioc.Ioc;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean
|
||||
public class ActivitiSetupStarter implements ServerFace {
|
||||
|
||||
@Inject("refer:$ioc")
|
||||
protected Ioc ioc;
|
||||
|
||||
public void start() throws Exception {
|
||||
ioc.get(ProcessEngine.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package org.nutz.boot.starter.activiti;
|
||||
|
||||
import org.nutz.boot.ioc.IocLoaderProvider;
|
||||
import org.nutz.integration.activiti.ActivitiIocLoader;
|
||||
import org.nutz.ioc.IocLoader;
|
||||
|
||||
public class ActivitiStarter implements IocLoaderProvider {
|
||||
|
||||
public IocLoader getIocLoader() {
|
||||
return new ActivitiIocLoader();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
org.nutz.boot.starter.activiti.ActivitiSetupStarter
|
||||
org.nutz.boot.starter.activiti.ActivitiStarter
|
@ -24,6 +24,7 @@
|
||||
<module>nutzboot-starter-xxl-job-executor</module>
|
||||
<module>nutzboot-starter-ngrok</module>
|
||||
<module>nutzboot-starter-hystrix-dashboard</module>
|
||||
<module>nutzboot-starter-activiti</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
* 先启动 nutzboot-demo-cloud-eureka-server, 将占有 8080端口
|
||||
* 访问 http://127.0.0.1:8080/eureka/jsp/status.jsp 等待30以上,刷新页面
|
||||
* 修改nutzboot-demo-cloud-service下的数据库连接信息
|
||||
* 启动 nutzboot-demo-cloud-service, 将占有8083端口, 它会注册一个服务,叫 "feign-service"
|
||||
* 等待30秒左右,刷新eureka的status.jsp,可以看到"feign-service"注册信息
|
||||
* 启动 nutzboot-demo-cloud-client,它占有8082端口
|
||||
|
@ -28,11 +28,6 @@
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-nutz-dao</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.193</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-jdbc</artifactId>
|
||||
@ -41,6 +36,11 @@
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-eureka-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.44</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -1,6 +1,8 @@
|
||||
nutz.application.name=feign-service
|
||||
server.port=0
|
||||
jdbc.url=jdbc:h2:mem:~
|
||||
jdbc.url=jdbc:mysql://127.0.0.1:3306/nbdemo
|
||||
jdbc.username=root
|
||||
jdbc.password=root
|
||||
|
||||
# Region where the application is deployed.
|
||||
# - for AWS specify one of the AWS regions
|
||||
|
@ -0,0 +1,65 @@
|
||||
<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.nutz</groupId>
|
||||
<artifactId>nutzboot-demo-simple</artifactId>
|
||||
<version>2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>nutzboot-demo-simple-activiti</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-nutz-mvc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-jetty</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-activiti</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.193</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/nutz/org.nutz.boot.starter.NbStarter</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>io.nutz.demo.simple.MainLauncher</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
package io.nutz.demo.simple;
|
||||
|
||||
import org.nutz.boot.NbApp;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@IocBean
|
||||
public class MainLauncher {
|
||||
|
||||
@Ok("raw")
|
||||
@At("/time/now")
|
||||
public long now() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new NbApp().setPrintProcDoc(true).run();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
server.port=8080
|
||||
server.host=0.0.0.0
|
||||
|
||||
jdbc.url=jdbc:h2:mem:~
|
||||
|
||||
# activiti
|
||||
activiti.databaseSchemaUpdate=true
|
||||
activiti.asyncExecutorEnabled=true
|
||||
activiti.asyncExecutorActivate=false
|
@ -0,0 +1,7 @@
|
||||
log4j.rootLogger=debug,Console
|
||||
|
||||
log4j.logger.org.eclipse.jetty=info
|
||||
|
||||
log4j.appender.Console=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.Console.layout.ConversionPattern=[%-5p] %d{HH:mm:ss.SSS} %l - %m%n
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Hello, So NB!</title>
|
||||
</head>
|
||||
<body>
|
||||
Hello, So NB!
|
||||
</body>
|
||||
</html>
|
@ -35,6 +35,7 @@
|
||||
<module>nutzboot-demo-simple-eureka-client</module>
|
||||
<module>nutzboot-demo-simple-rabbitmq</module>
|
||||
<module>nutzboot-demo-simple-xxl-job-executor</module>
|
||||
<module>nutzboot-demo-simple-activiti</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
|
5
pom.xml
5
pom.xml
@ -633,6 +633,11 @@
|
||||
<artifactId>nutzboot-starter-rabbitmq</artifactId>
|
||||
<version>${nutzboot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-activiti</artifactId>
|
||||
<version>${nutzboot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
|
Loading…
Reference in New Issue
Block a user