Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
0bde4d3b
Commit
0bde4d3b
authored
Mar 12, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作流被添加进实例表事件定义和事件监听
parent
c331a6ce
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
FlowScanEndEvent.java
...n-core/src/main/java/com/byit/event/FlowScanEndEvent.java
+29
-0
FlowEventListener.java
...re/src/main/java/com/byit/listener/FlowEventListener.java
+16
-1
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/event/FlowScanEndEvent.java
0 → 100644
View file @
0bde4d3b
package
com
.
byit
.
event
;
import
org.springframework.context.ApplicationEvent
;
/**
* 创建工作流处理完毕事件
* 作用:主要是工作流处理完毕后需要将对应的工作流改为不扫描
* @author huangfu
*/
public
class
FlowScanEndEvent
extends
ApplicationEvent
{
private
Integer
flowId
;
/**
* 创建工作流添加进实例表完毕后的事件
*
* @param source the object on which the event initially occurred (never {@code null})
* @param flowId 工作流id
*/
public
FlowScanEndEvent
(
Object
source
,
Integer
flowId
)
{
super
(
source
);
this
.
flowId
=
flowId
;
}
public
Integer
getFlowId
()
{
return
flowId
;
}
}
\ No newline at end of file
byit-myth-core/myth-admin-core/src/main/java/com/byit/listener/FlowEventListener.java
View file @
0bde4d3b
...
@@ -2,6 +2,7 @@ package com.byit.listener;
...
@@ -2,6 +2,7 @@ package com.byit.listener;
import
com.byit.enums.FlowPropertyEnum
;
import
com.byit.enums.FlowPropertyEnum
;
import
com.byit.event.EndFlowEvent
;
import
com.byit.event.EndFlowEvent
;
import
com.byit.event.FlowScanEndEvent
;
import
com.byit.model.Flow
;
import
com.byit.model.Flow
;
import
com.byit.service.FlowService
;
import
com.byit.service.FlowService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -23,11 +24,25 @@ public class FlowEventListener {
...
@@ -23,11 +24,25 @@ public class FlowEventListener {
}
}
/**
/**
* 工作添加进实例表后的事件监听
* @param flowScanEndEvent 事假信息
*/
@EventListener
public
void
flowScanEndEventListener
(
FlowScanEndEvent
flowScanEndEvent
){
log
.
info
(
"-----------监听到事件{},工作流添加进实例完成事件-------"
,
flowScanEndEvent
);
Flow
flow
=
Flow
.
builder
()
.
flowId
(
flowScanEndEvent
.
getFlowId
())
.
scanMark
(
FlowPropertyEnum
.
NOT_SCAN
.
getCode
())
.
build
();
flowService
.
updateByIdSelective
(
flow
);
}
/**
* 工作流完成事件监听
* 工作流完成事件监听
* @param endFlowEvent 事件信息
* @param endFlowEvent 事件信息
*/
*/
@EventListener
@EventListener
public
void
flowEndEvent
(
EndFlowEvent
endFlowEvent
){
public
void
flowEndEvent
Listener
(
EndFlowEvent
endFlowEvent
){
log
.
info
(
"-----------监听到事件{},工作流实例完成事件-------"
,
endFlowEvent
);
log
.
info
(
"-----------监听到事件{},工作流实例完成事件-------"
,
endFlowEvent
);
Flow
flow
=
Flow
.
builder
()
Flow
flow
=
Flow
.
builder
()
.
flowId
(
endFlowEvent
.
getFlowId
())
.
flowId
(
endFlowEvent
.
getFlowId
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment