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
71039f07
Commit
71039f07
authored
Jan 18, 2021
by
huangfu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
停止工作流逻辑修改
parent
dd42cad1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
FlowServiceImpl.java
.../src/main/java/com/byit/service/impl/FlowServiceImpl.java
+36
-0
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/FlowServiceImpl.java
View file @
71039f07
...
@@ -431,6 +431,42 @@ public class FlowServiceImpl implements FlowService {
...
@@ -431,6 +431,42 @@ public class FlowServiceImpl implements FlowService {
ValidationUtil
.
dataNotBank
(
param
,
"请求参数不允许为空!"
);
ValidationUtil
.
dataNotBank
(
param
,
"请求参数不允许为空!"
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
param
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
param
);
String
runId
=
jsonObject
.
getString
(
"runId"
);
String
runId
=
jsonObject
.
getString
(
"runId"
);
//查找到运行批次
List
<
RunRecording
>
runRecordingList
=
runRecordingMapper
.
findByRunID
(
runId
);
//查看是否存在运行中的实例
List
<
RunRecording
>
collect
=
runRecordingList
.
stream
().
filter
(
runRecording
->
{
String
flowStatus
=
runRecording
.
getFlowStatus
();
return
ScheduleStatusEnum
.
STOP
.
getCode
().
equals
(
flowStatus
)
||
ScheduleStatusEnum
.
STARTING
.
getCode
().
equals
(
flowStatus
);
}).
collect
(
Collectors
.
toList
());
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
collect
),
"没有正在运行中的实例,请刷新页面后重试!"
);
//遍历运行批次 将实例更改为快速失败
//释放该工作流下所由暂停的节点
collect
.
forEach
(
runRecording
->
{
runRecording
.
setFailFast
(
RunRecordingEnum
.
FAIL_FAST_YES
.
getCode
());
runRecording
.
setFailFast
(
RunRecordingEnum
.
FAIL_FAST_YES
.
getCode
());
if
(
ScheduleStatusEnum
.
STOP
.
getCode
().
equals
(
runRecording
.
getFlowStatus
()))
{
runRecording
.
setFlowStatus
(
ScheduleStatusEnum
.
STARTING
.
getCode
());
}
List
<
JobTask
>
byRunId
=
jobTaskService
.
findByRunId
(
runId
);
List
<
JobTask
>
stopTask
=
byRunId
.
stream
().
filter
(
task
->
JobTriggerStatusEnums
.
STOP
.
getCode
().
equals
(
task
.
getTriggerStatus
())).
collect
(
Collectors
.
toList
());
stopTask
.
forEach
(
task
->
{
task
.
setTriggerStatus
(
JobTriggerStatusEnums
.
START
.
getCode
());
jobTaskService
.
update
(
task
);
});
runRecordingMapper
.
updateRunRecordingById
(
runRecording
);
});
return
new
KillDto
(
true
,
"操作成功!"
);
}
@Deprecated
public
KillDto
killFlow111
(
String
param
)
throws
InterruptedException
{
ValidationUtil
.
dataNotBank
(
param
,
"请求参数不允许为空!"
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
param
);
String
runId
=
jsonObject
.
getString
(
"runId"
);
ValidationUtil
.
dataNotBank
(
runId
,
"运行实例id不允许为空!"
);
ValidationUtil
.
dataNotBank
(
runId
,
"运行实例id不允许为空!"
);
String
workspaceName
=
jsonObject
.
getString
(
"workspaceName"
);
String
workspaceName
=
jsonObject
.
getString
(
"workspaceName"
);
ValidationUtil
.
dataNotBank
(
workspaceName
,
"工作空间名称不允许为空!"
);
ValidationUtil
.
dataNotBank
(
workspaceName
,
"工作空间名称不允许为空!"
);
...
...
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