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
bc45a923
Commit
bc45a923
authored
Mar 12, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发布工作流添加到实例表完成事件
parent
0bde4d3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
RunNodeServiceImpl.java
...c/main/java/com/byit/service/impl/RunNodeServiceImpl.java
+17
-3
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/RunNodeServiceImpl.java
View file @
bc45a923
package
com
.
byit
.
service
.
impl
;
package
com
.
byit
.
service
.
impl
;
import
com.byit.enums.FlowPropertyEnum
;
import
com.byit.enums.FlowPropertyEnum
;
import
com.byit.event.FlowScanEndEvent
;
import
com.byit.job.utils.CronExpression
;
import
com.byit.job.utils.CronExpression
;
import
com.byit.model.Flow
;
import
com.byit.model.Flow
;
import
com.byit.model.JobTask
;
import
com.byit.model.JobTask
;
...
@@ -12,6 +13,8 @@ import com.byit.service.RunNodeServer;
...
@@ -12,6 +13,8 @@ import com.byit.service.RunNodeServer;
import
com.byit.service.RunRecordingService
;
import
com.byit.service.RunRecordingService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisherAware
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -28,10 +31,11 @@ import java.util.UUID;
...
@@ -28,10 +31,11 @@ import java.util.UUID;
@Service
@Service
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
@Slf4j
@Slf4j
public
class
RunNodeServiceImpl
implements
RunNodeServer
{
public
class
RunNodeServiceImpl
implements
RunNodeServer
,
ApplicationEventPublisherAware
{
private
final
RunRecordingService
runRecordingService
;
private
final
RunRecordingService
runRecordingService
;
private
final
JobTaskService
jobTaskService
;
private
final
JobTaskService
jobTaskService
;
private
final
FlowService
flowService
;
private
final
FlowService
flowService
;
private
ApplicationEventPublisher
applicationEventPublisher
;
public
RunNodeServiceImpl
(
RunRecordingService
runRecordingService
,
JobTaskService
jobTaskService
,
public
RunNodeServiceImpl
(
RunRecordingService
runRecordingService
,
JobTaskService
jobTaskService
,
FlowService
flowService
)
{
FlowService
flowService
)
{
...
@@ -53,6 +57,7 @@ public class RunNodeServiceImpl implements RunNodeServer {
...
@@ -53,6 +57,7 @@ public class RunNodeServiceImpl implements RunNodeServer {
RunRecording
build
=
new
RunRecording
();
RunRecording
build
=
new
RunRecording
();
BeanUtils
.
copyProperties
(
flow
,
build
);
BeanUtils
.
copyProperties
(
flow
,
build
);
build
.
setRunId
(
runId
);
build
.
setRunId
(
runId
);
//TODO 这个不解释 不知道干嘛的 后续需要修改
build
.
setDispatchIp
(
"127.0.0.1"
);
build
.
setDispatchIp
(
"127.0.0.1"
);
build
.
setFlowVersionName
(
flow
.
getVersionName
());
build
.
setFlowVersionName
(
flow
.
getVersionName
());
build
.
setTriggerTime
(
flow
.
getTriggerNextTime
());
build
.
setTriggerTime
(
flow
.
getTriggerNextTime
());
...
@@ -75,7 +80,7 @@ public class RunNodeServiceImpl implements RunNodeServer {
...
@@ -75,7 +80,7 @@ public class RunNodeServiceImpl implements RunNodeServer {
jobTaskService
.
saveJobTasks
(
jobTasks
);
jobTaskService
.
saveJobTasks
(
jobTasks
);
log
.
info
(
"-------------【开始修改工作流{}的下次运行时间,以及各种状态】---------------"
,
flow
);
log
.
info
(
"-------------【开始修改工作流{}的下次运行时间,以及各种状态】---------------"
,
flow
);
updateFlow
(
flow
);
updateFlow
(
flow
);
applicationEventPublisher
.
publishEvent
(
new
FlowScanEndEvent
(
this
,
flow
.
getFlowId
()));
log
.
info
(
"-------saveRunRecAndTaskAndUpdate end-----------【运行结束】-----------------"
);
log
.
info
(
"-------saveRunRecAndTaskAndUpdate end-----------【运行结束】-----------------"
);
...
@@ -100,7 +105,16 @@ public class RunNodeServiceImpl implements RunNodeServer {
...
@@ -100,7 +105,16 @@ public class RunNodeServiceImpl implements RunNodeServer {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
flow
.
setTriggerNextTime
(
nextValidTime
!=
null
?
nextValidTime
.
getTime
():
999999999999L
);
flow
.
setTriggerNextTime
(
nextValidTime
!=
null
?
nextValidTime
.
getTime
():
999999999999L
);
flow
.
setScanMark
(
FlowPropertyEnum
.
NOT_SCAN
.
getCode
());
//flow.setScanMark(FlowPropertyEnum.NOT_SCAN.getCode())
flowService
.
updateByIdSelective
(
flow
);
flowService
.
updateByIdSelective
(
flow
);
}
}
/**
* 设置时间发布器
* @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