Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
dc2f43f5
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,发现更多精彩内容 >>
提交
dc2f43f5
编写于
9月 21, 2014
作者:
J
Josh Long
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
initial commit of a working actuator.
上级
e77a1780
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
77 addition
and
13 deletion
+77
-13
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/pom.xml
...spring-boot-starters/spring-boot-starter-actuator/pom.xml
+15
-0
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/src/main/java/org/activiti/spring/boot/actuate/endpoint/EndpointAutoConfiguration.java
...ring/boot/actuate/endpoint/EndpointAutoConfiguration.java
+8
-2
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/src/main/java/org/activiti/spring/boot/actuate/endpoint/ProcessEngineEndpoint.java
...i/spring/boot/actuate/endpoint/ProcessEngineEndpoint.java
+6
-10
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/src/main/java/org/activiti/spring/boot/actuate/endpoint/ProcessEngineMvcEndpoint.java
...pring/boot/actuate/endpoint/ProcessEngineMvcEndpoint.java
+47
-0
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-basic/src/test/java/org/activiti/spring/boot/TestProcessEngineAutoConfiguration.java
...iviti/spring/boot/TestProcessEngineAutoConfiguration.java
+1
-1
未找到文件。
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/pom.xml
浏览文件 @
dc2f43f5
...
...
@@ -17,10 +17,25 @@
<artifactId>
spring-boot-starter-basic
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-image-generator
</artifactId>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-bpmn-model
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<optional>
true
</optional>
</dependency>
</dependencies>
</project>
\ No newline at end of file
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/src/main/java/org/activiti/spring/boot/actuate/endpoint/EndpointAutoConfiguration.java
浏览文件 @
dc2f43f5
package
org.activiti.spring.boot.actuate.endpoint
;
import
org.activiti.engine.ProcessEngine
;
import
org.activiti.engine.RepositoryService
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -15,8 +16,13 @@ import org.springframework.context.annotation.Configuration;
public
class
EndpointAutoConfiguration
{
@Bean
public
ProcessEngineEndpoint
processEngine
Metric
(
ProcessEngine
engine
)
{
return
new
ProcessEngineEndpoint
(
engine
)
;
public
ProcessEngineEndpoint
processEngine
Endpoint
(
ProcessEngine
engine
)
{
return
new
ProcessEngineEndpoint
(
engine
)
;
}
@Bean
public
ProcessEngineMvcEndpoint
processEngineMvcEndpoint
(
ProcessEngineEndpoint
engineEndpoint
,
RepositoryService
repositoryService
)
{
return
new
ProcessEngineMvcEndpoint
(
engineEndpoint
,
repositoryService
);
}
}
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/src/main/java/org/activiti/spring/boot/actuate/endpoint/ProcessEngineEndpoint.java
浏览文件 @
dc2f43f5
...
...
@@ -7,6 +7,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import
java.util.List
;
/**
* Registers a Boot Actuator endpoint that provides information on the
* running process instance and renders BPMN diagrams of the deployed processes.
*
* @author Josh Long
*/
@ConfigurationProperties
(
prefix
=
"endpoints.activiti"
)
public
class
ProcessEngineEndpoint
extends
AbstractEndpoint
<
List
<
HistoricDetail
>>
{
...
...
@@ -26,13 +32,3 @@ public class ProcessEngineEndpoint extends AbstractEndpoint<List<HistoricDetail>
.
list
();
}
}
/* ProcessDefinition processDefinition = repositoryService
.createProcessDefinitionQuery().processDefinitionKey(pd).singleResult();
ProcessDiagramGenerator processDiagramGenerator = new DefaultProcessDiagramGenerator();
InputStream is = processDiagramGenerator
.generatePngDiagram(repositoryService
.getBpmnModel(processDefinition.getId()));
return new InputStreamResource(is);
*/
\ No newline at end of file
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-actuator/src/main/java/org/activiti/spring/boot/actuate/endpoint/ProcessEngineMvcEndpoint.java
0 → 100644
浏览文件 @
dc2f43f5
package
org.activiti.spring.boot.actuate.endpoint
;
import
org.activiti.bpmn.model.BpmnModel
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.image.ProcessDiagramGenerator
;
import
org.activiti.image.impl.DefaultProcessDiagramGenerator
;
import
org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter
;
import
org.springframework.core.io.InputStreamResource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.io.InputStream
;
/**
* Renders a valid running BPMN process definition as a BPMN diagram.
*
* This is duplicative of the functionality in the full REST API implementation.
*
* @author Joram Barrez
* @author Josh Long
*/
public
class
ProcessEngineMvcEndpoint
extends
EndpointMvcAdapter
{
private
final
RepositoryService
repositoryService
;
public
ProcessEngineMvcEndpoint
(
ProcessEngineEndpoint
processEngineEndpoint
,
RepositoryService
repositoryService
)
{
super
(
processEngineEndpoint
);
this
.
repositoryService
=
repositoryService
;
}
@RequestMapping
(
value
=
"/processes/{processDefinitionKey:.*}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
IMAGE_JPEG_VALUE
)
@ResponseBody
public
Resource
processDefinitionDiagram
(
@PathVariable
String
processDefinitionKey
)
{
ProcessDefinition
processDefinition
=
repositoryService
.
createProcessDefinitionQuery
()
.
processDefinitionKey
(
processDefinitionKey
).
singleResult
();
ProcessDiagramGenerator
processDiagramGenerator
=
new
DefaultProcessDiagramGenerator
();
BpmnModel
bpmnModel
=
repositoryService
.
getBpmnModel
(
processDefinition
.
getId
());
InputStream
is
=
processDiagramGenerator
.
generateJpgDiagram
(
bpmnModel
);
return
new
InputStreamResource
(
is
);
}
}
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starter-basic/src/test/java/org/activiti/spring/boot/TestProcessEngineAutoConfiguration.java
浏览文件 @
dc2f43f5
...
...
@@ -33,7 +33,7 @@ public class TestProcessEngineAutoConfiguration {
public
static
class
SimpleDataSourceConfiguration
{
@Bean
public
TaskExecutor
taskExecutor
()
{
TaskExecutor
taskExecutor
()
{
return
new
SimpleAsyncTaskExecutor
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录