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
04426090
Commit
04426090
authored
May 08, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改虚节点不跟随祝工作流BUG
parent
b4c6aa31
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+1
-1
RunRecordingAndJobTaskServiceImpl.java
...ce/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
+14
-4
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
04426090
...
...
@@ -149,7 +149,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
flow
.
setFlowCron
(
pluginFlow
.
getConfig
().
getFlowCron
());
flow
.
setTriggerNextTime
(
StringUtils
.
isEmpty
(
pluginFlow
.
getConfig
().
getFlowCron
())
?
null
:
new
CronExpression
(
pluginFlow
.
getConfig
().
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
//设置超时时间,未设置默认30分钟
flow
.
setFlowTimeout
(
null
==
pluginFlow
.
getConfig
().
getFlowTimeout
()
?
1000
*
60
*
3
0
:
pluginFlow
.
getConfig
().
getFlowTimeout
());
flow
.
setFlowTimeout
(
null
==
pluginFlow
.
getConfig
().
getFlowTimeout
()
?
1000
*
60
*
12
0
:
pluginFlow
.
getConfig
().
getFlowTimeout
());
//判断是否是重发
if
(
pluginFlow
.
isRePublish
()){
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
View file @
04426090
...
...
@@ -2,6 +2,7 @@ package com.byit.service.mapservice.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.byit.enums.*
;
import
com.byit.job.utils.CronExpression
;
import
com.byit.job.utils.DateUtil
;
import
com.byit.model.*
;
import
com.byit.service.*
;
...
...
@@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -59,7 +61,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
* @throws Exception
*/
@Override
public
void
saveRunRecordingAndTask
(
JobTask
jobTask
)
throws
UnknownHostException
{
public
void
saveRunRecordingAndTask
(
JobTask
jobTask
)
throws
UnknownHostException
,
ParseException
{
log
.
info
(
"-----------saveRunRecordingAndTask start【虚节点保存服务】--------------"
);
//根据 map_flow_id查询当前的版本的工作流 使用祝工作流的runId 保存到执行记录表和任务表
Integer
mapFlowId
=
jobTask
.
getMapFlowId
();
...
...
@@ -67,6 +69,8 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
Flow
mainFlow
=
flowService
.
findFlowById
(
jobTask
.
getFlowId
());
//内嵌工作流
Flow
virFlow
=
flowService
.
findFlowById
(
mapFlowId
);
RunRecording
mainRecording
=
runRecordingService
.
findRunRecordingByFlowIdAndRunId
(
jobTask
.
getFlowId
(),
jobTask
.
getRunId
());
//查看是否跟随工作流
boolean
equals
=
"1"
.
equals
(
mainFlow
.
getScheduleFollow
());
boolean
virFlag
=
"1"
.
equals
(
virFlow
.
getScheduleFollow
());
...
...
@@ -92,6 +96,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
jobTaskRunLogService
.
saveJobTaskRunLog
(
jobTaskRunLog
);
log
.
info
(
"-----------【虚节点保存运行记录】--------------"
);
//保存进运行记录表
Long
triggerNextTime
=
virFlow
.
getTriggerNextTime
();
RunRecording
runRecording
=
RunRecording
.
builder
()
.
runId
(
jobTask
.
getRunId
())
.
flowId
(
mapFlowId
)
...
...
@@ -103,7 +108,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
.
alarmEmail
(
virFlow
.
getAlarmEmail
())
.
alarmlAction
(
virFlow
.
getAlarmlAction
())
.
priority
(
virFlow
.
getPriority
())
.
triggerTime
(
equals
?
main
Flow
.
getTriggerNextTime
():
virFlow
.
getTriggerNextTime
()
)
.
triggerTime
(
equals
?
main
Recording
.
getTriggerTime
():
triggerNextTime
)
.
principal
(
virFlow
.
getPrincipal
())
.
startTime
(
new
Date
())
.
flowNodeCount
(
virFlow
.
getFlowNodeCount
())
...
...
@@ -127,9 +132,9 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
BeanUtils
.
copyProperties
(
node
,
task
);
if
(
equals
)
{
task
.
setTriggerTime
(
main
Flow
.
getTriggerNext
Time
());
task
.
setTriggerTime
(
main
Recording
.
getTrigger
Time
());
}
else
if
(
virFlag
)
{
task
.
setTriggerTime
(
virFlow
.
getTriggerNextTime
()
);
task
.
setTriggerTime
(
triggerNextTime
);
}
task
.
setRunId
(
jobTask
.
getRunId
());
task
.
setTriggerStatus
(
"1"
);
...
...
@@ -140,6 +145,11 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
log
.
info
(
"----------------【虚节点保存成功,删除虚节点】--------------------"
);
jobTaskService
.
removeMythJobTaskById
(
jobTask
.
getId
());
log
.
info
(
"-----------saveRunRecordingAndTask end【虚节点保存服务】--------------"
);
if
(
StringUtils
.
isNotBlank
(
virFlow
.
getFlowCron
())){
virFlow
.
setTriggerNextTime
(
new
CronExpression
(
virFlow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
(
virFlow
.
getTriggerNextTime
())).
getTime
());
}
flowService
.
updateByIdSelective
(
virFlow
);
}
...
...
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