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
6d08ed46
Commit
6d08ed46
authored
Mar 12, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作流实例是否正在运行中校验
parent
7593c888
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
0 deletions
+37
-0
RunRecordingMapper.java
...ore/src/main/java/com/byit/mapper/RunRecordingMapper.java
+7
-0
RunRecordingService.java
...e/src/main/java/com/byit/service/RunRecordingService.java
+7
-0
RunRecordingServiceImpl.java
...n/java/com/byit/service/impl/RunRecordingServiceImpl.java
+17
-0
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+6
-0
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/mapper/RunRecordingMapper.java
View file @
6d08ed46
...
...
@@ -22,6 +22,13 @@ public interface RunRecordingMapper {
* @return
*/
List
<
RunRecording
>
findRunningRunRecording
();
/**
* 根据工作流查询对应的实例
* @param flowId
* @return
*/
List
<
RunRecording
>
findRunRecordingByFlowId
(
Integer
flowId
);
/**
* 这个方法是会根据任务流的id和运行标识找到唯一对应的一个任务流,这个任务流就是一个虚拟节点
* @param flowId
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/RunRecordingService.java
View file @
6d08ed46
...
...
@@ -22,6 +22,13 @@ public interface RunRecordingService {
List
<
RunRecording
>
findRunningRunRecording
();
/**
* 根据工作流ID查询 是否有正在运行中的实例
* @param flowId
* @return
*/
boolean
findRunRecordingIsRunning
(
Integer
flowId
);
/**
* 这个方法是会根据任务流的id和运行标识找到唯一对应的一个任务流,这个任务流就是一个虚拟节点
* @param flowId
* @param runId
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/RunRecordingServiceImpl.java
View file @
6d08ed46
package
com
.
byit
.
service
.
impl
;
import
com.byit.enums.RunRecordingEnum
;
import
com.byit.mapper.RunRecordingMapper
;
import
com.byit.model.RunRecording
;
import
com.byit.service.RunRecordingService
;
...
...
@@ -33,6 +34,22 @@ public class RunRecordingServiceImpl implements RunRecordingService {
return
runRecordingMapper
.
findRunningRunRecording
();
}
/**
* 是否存在运行的工作流实例
* @param flowId 工作流ID
* @return 是否在正在运行中
*/
@Override
public
boolean
findRunRecordingIsRunning
(
Integer
flowId
)
{
List
<
RunRecording
>
runRecordings
=
runRecordingMapper
.
findRunRecordingByFlowId
(
flowId
);
for
(
RunRecording
runRecording
:
runRecordings
)
{
if
(!
RunRecordingEnum
.
FLOW_STATUS_IS_END
.
getCode
().
equals
(
runRecording
.
getFlowStatus
()))
{
return
true
;
}
}
return
false
;
}
@Override
public
RunRecording
findRunRecordingByFlowIdAndRunId
(
Integer
flowId
,
String
runId
)
{
return
runRecordingMapper
.
findRunRecordingByFlowIdAndRunId
(
flowId
,
runId
);
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
6d08ed46
...
...
@@ -46,6 +46,12 @@
where flow_status = '2'
</select>
<select
id=
"findRunRecordingByFlowId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from run_recording where flow_id = #{flowId,jdbcType=INTEGER}
</select>
<select
id=
"findRunRecordingByFlowIdAndRunId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
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