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
77a9cae7
Commit
77a9cae7
authored
May 28, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校验虚节点
parent
97417284
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
ApiFlowService.java
...-admin/src/main/java/com/byit/service/ApiFlowService.java
+1
-1
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+7
-7
No files found.
byit-myth-admin/src/main/java/com/byit/service/ApiFlowService.java
View file @
77a9cae7
...
...
@@ -36,7 +36,7 @@ public interface ApiFlowService {
* @param flow
* @return
*/
void
validateFlow
(
Integer
workspaceId
,
PluginFlow
flow
);
void
validateFlow
(
Integer
workspaceId
,
PluginFlow
flow
,
boolean
isInner
);
/**
* 重跑任务
...
...
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
77a9cae7
...
...
@@ -158,10 +158,10 @@ public class ApiFlowServiceImpl implements ApiFlowService {
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
*
120
:
pluginFlow
.
getConfig
().
getFlowTimeout
());
Flow
oldFlow
=
flowMapper
.
getByWorkSpaceAndName
(
workspaceId
,
pluginFlow
.
getName
());
//判断是否是重发
if
(
pluginFlow
.
isRePublish
(
)){
Flow
oldFlow
=
flowMapper
.
getByWorkSpaceAndName
(
workspaceId
,
pluginFlow
.
getName
());
if
(
(
pluginFlow
.
isRePublish
()
&&
!
isInnner
)
||
(
isInnner
&&
null
!=
oldFlow
)){
String
version
=
oldFlow
.
getVersionName
();
Integer
versionTag
=
Integer
.
valueOf
(
version
.
split
(
"\\."
)[
1
]);
flow
.
setFlowId
(
oldFlow
.
getFlowId
());
...
...
@@ -339,7 +339,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
PluginFlow
flow
=
pluginPackage
.
getFlow
();
//校验工作流参数配置
validateFlow
(
workspace
.
getWorkspaceId
(),
flow
);
validateFlow
(
workspace
.
getWorkspaceId
(),
flow
,
false
);
//校验工作流名称是否重复
HashSet
<
String
>
flowNameSet
=
new
HashSet
<>();
//用来工作流的内嵌关系
...
...
@@ -383,7 +383,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
isTrueValidation
(!(
node
instanceof
PluginFlow
),
"工作流的type设置错误,只有当节点为内嵌工作流是type才允许设置为flow"
);
//校验父工作流和内嵌工作流的执行类型是否一致
ValidationUtil
.
isTrueValidation
(!(
flow
.
getConfig
().
getExecType
().
equals
(((
PluginFlow
)
node
).
getConfig
().
getExecType
())),
"内嵌工作流的调度配置必须和父工作流配置保持一致!"
);
validateFlow
(
workspace
.
getWorkspaceId
(),
(
PluginFlow
)
node
);
validateFlow
(
workspace
.
getWorkspaceId
(),
(
PluginFlow
)
node
,
true
);
if
(
FlowPropertyEnum
.
NO_SCHEDULE
.
getCode
().
equals
(
flow
.
getConfig
().
getScheduleFollow
())){
ValidationUtil
.
dataNotBank
(
((
PluginFlow
)
node
).
getConfig
().
getFlowCron
(),
"工作流设置为不跟随调度时节点必须设置调度时间!"
);
}
...
...
@@ -419,7 +419,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
@Override
public
void
validateFlow
(
Integer
workspaceId
,
PluginFlow
pluginFlow
)
{
public
void
validateFlow
(
Integer
workspaceId
,
PluginFlow
pluginFlow
,
boolean
isInner
)
{
ValidationUtil
.
dataNotBank
(
pluginFlow
.
getName
(),
"工作流名称不允许为空!"
);
ValidationUtil
.
dataNotNull
(
pluginFlow
.
getNodeList
(),
"工作流下属节点不允许为空!"
);
ValidationUtil
.
dataNotNull
(
pluginFlow
.
getConfig
(),
"工作流配置不允许为空!"
);
...
...
@@ -434,7 +434,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
Flow
flow
=
flowMapper
.
getByWorkSpaceAndName
(
workspaceId
,
pluginFlow
.
getName
());
//判断是否是重发
//是重发
if
(
pluginFlow
.
isRePublish
()){
if
(
pluginFlow
.
isRePublish
()
&&
!
isInner
){
ValidationUtil
.
dataNotNull
(
flow
,
"工作流【"
+
pluginFlow
.
getName
()
+
"】不存在!"
);
}
else
{
//不是重发
ValidationUtil
.
isTrueValidation
(
null
!=
flow
,
"工作流【"
+
pluginFlow
.
getName
()
+
"】已存在!"
);
...
...
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