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
c331a6ce
Commit
c331a6ce
authored
Mar 12, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作流完结事件发布
parent
4b320574
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
ClosingExampleThreadRunHelper.java
...com/byit/thread/helper/ClosingExampleThreadRunHelper.java
+15
-1
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/ClosingExampleThreadRunHelper.java
View file @
c331a6ce
...
...
@@ -2,6 +2,7 @@ package com.byit.thread.helper;
import
com.byit.enums.NodeRunStatusPropertyEnum
;
import
com.byit.enums.RunRecordingEnum
;
import
com.byit.event.EndFlowEvent
;
import
com.byit.job.enums.JobResultEnum
;
import
com.byit.job.exceptions.BusinessException
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
...
...
@@ -11,6 +12,8 @@ import com.byit.service.RunRecordingService;
import
com.byit.thread.BaseThreadRunHelper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisherAware
;
import
org.springframework.stereotype.Component
;
import
javax.sql.DataSource
;
...
...
@@ -23,12 +26,13 @@ import java.util.List;
*/
@Component
@Slf4j
public
class
ClosingExampleThreadRunHelper
extends
BaseThreadRunHelper
{
public
class
ClosingExampleThreadRunHelper
extends
BaseThreadRunHelper
implements
ApplicationEventPublisherAware
{
private
static
final
String
LOCK_NAME
=
"judge_flow_end_lock"
;
private
final
DataSource
dataSource
;
private
final
JobTaskRunLogService
jobTaskRunLogService
;
private
final
RunRecordingService
runRecordingService
;
private
ApplicationEventPublisher
applicationEventPublisher
;
...
...
@@ -64,6 +68,7 @@ public class ClosingExampleThreadRunHelper extends BaseThreadRunHelper {
log
.
debug
(
"----------------扫描到有完结的运行实例{},{}-------------"
,
runCode
,
RunRecordingEnum
.
FLOW_STATUS_IS_END
.
getCode
());
runRecording
.
setFlowStatus
(
RunRecordingEnum
.
FLOW_STATUS_IS_END
.
getCode
());
runRecordingService
.
updateRunRecordingById
(
runRecording
);
applicationEventPublisher
.
publishEvent
(
new
EndFlowEvent
(
this
,
flowId
));
}
});
return
UNIVERSAL_WAIT_TIME
;
...
...
@@ -113,4 +118,13 @@ public class ClosingExampleThreadRunHelper extends BaseThreadRunHelper {
public
String
getLockName
()
{
return
LOCK_NAME
;
}
/**
* 设置时间发布器
* @param applicationEventPublisher 事件发布器
*/
@Override
public
void
setApplicationEventPublisher
(
ApplicationEventPublisher
applicationEventPublisher
)
{
this
.
applicationEventPublisher
=
applicationEventPublisher
;
}
}
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