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
6b7066b5
Commit
6b7066b5
authored
Jan 07, 2021
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开始工作流增加运行标识
parent
fc5dbe84
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+5
-5
JobUtils.java
...xecutor-plugin/src/main/java/com/byit/utils/JobUtils.java
+2
-1
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
6b7066b5
...
@@ -1524,18 +1524,18 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1524,18 +1524,18 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
dataNotBank
(
workspaceName
,
"工作空间名称不允许为空!"
);
ValidationUtil
.
dataNotBank
(
workspaceName
,
"工作空间名称不允许为空!"
);
//获取工作流名称
//获取工作流名称
String
flowName
=
jsonObject
.
getString
(
"flowName"
);
String
flowName
=
jsonObject
.
getString
(
"flowName"
);
String
runId
=
jsonObject
.
getString
(
"runId"
);
ValidationUtil
.
dataNotBank
(
flowName
,
"工作流名称不允许为空!"
);
ValidationUtil
.
dataNotBank
(
flowName
,
"工作流名称不允许为空!"
);
ValidationUtil
.
dataNotBank
(
runId
,
"运行标识不允许为空,请检查参数 'runId' 是否存在!"
);
Workspace
byName
=
workspaceMapper
.
getByName
(
workspaceName
);
Workspace
byName
=
workspaceMapper
.
getByName
(
workspaceName
);
ValidationUtil
.
isTrueValidation
(
byName
==
null
,
"没有此工作空间"
);
ValidationUtil
.
isTrueValidation
(
byName
==
null
,
"没有此工作空间"
);
List
<
RunRecording
>
runRecordings
=
runRecordingMapper
.
runIngRunRecording
(
flowName
,
byName
.
getWorkspaceId
());
List
<
RunRecording
>
runRecordings
=
runRecordingMapper
.
runIngRunRecording
(
flowName
,
byName
.
getWorkspaceId
());
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
runRecordings
),
"没有正在运行中的实例!"
);
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
runRecordings
),
"没有正在运行中的实例!"
);
List
<
RunRecording
>
collect
=
runRecordings
.
stream
().
filter
(
runRecording
->
"3"
.
equals
(
runRecording
.
getFlowStatus
())).
collect
(
Collectors
.
toList
());
List
<
RunRecording
>
collect
=
runRecordings
.
stream
().
filter
(
runRecording
->
"3"
.
equals
(
runRecording
.
getFlowStatus
())
&&
runId
.
equals
(
runRecording
.
getRunId
())).
collect
(
Collectors
.
toList
());
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
collect
),
"没有暂停的实例!"
);
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
collect
),
"该实例不是暂停状态!"
);
List
<
String
>
runIds
=
collect
.
stream
().
map
(
RunRecording:
:
getRunId
).
collect
(
Collectors
.
toList
());
String
join
=
StringUtils
.
join
(
runIds
,
","
);
StopFlowParam
stopFlowParam
=
new
StopFlowParam
();
StopFlowParam
stopFlowParam
=
new
StopFlowParam
();
stopFlowParam
.
setRunIds
(
join
);
stopFlowParam
.
setRunIds
(
runId
);
stopFlowParam
.
setFlowName
(
flowName
);
stopFlowParam
.
setFlowName
(
flowName
);
stopFlowParam
.
setAllStartFlow
(
"1"
);
stopFlowParam
.
setAllStartFlow
(
"1"
);
reStartSchedule
(
stopFlowParam
);
reStartSchedule
(
stopFlowParam
);
...
...
byit-myth-executor/myth-executor-plugin/src/main/java/com/byit/utils/JobUtils.java
View file @
6b7066b5
...
@@ -378,10 +378,11 @@ public class JobUtils {
...
@@ -378,10 +378,11 @@ public class JobUtils {
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
}
public
static
ResponseResult
unsuspendFlow
(
String
flowName
,
String
workspaceName
){
public
static
ResponseResult
unsuspendFlow
(
String
flowName
,
String
workspaceName
,
String
runId
){
Map
<
String
,
String
>
map
=
new
HashMap
<>(
5
);
Map
<
String
,
String
>
map
=
new
HashMap
<>(
5
);
map
.
put
(
"flowName"
,
flowName
);
map
.
put
(
"flowName"
,
flowName
);
map
.
put
(
"workspaceName"
,
workspaceName
);
map
.
put
(
"workspaceName"
,
workspaceName
);
map
.
put
(
"runId"
,
runId
);
//发送请求 添加任务
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_START_UNSUSPENDFLOW
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
String
response
=
createHttpRequest
(
REQUEST_FLOW_START_UNSUSPENDFLOW
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
log
.
debug
(
"--------------------开始接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------开始接口调用成功,结果为:{}------------------------"
,
response
);
...
...
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