Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bpm
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
王厚康
bpm
Commits
d2941c59
Commit
d2941c59
authored
Aug 27, 2019
by
yanlj@bbdtek.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取当前任务节点的所有分支节点
parent
47b93f87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
5 deletions
+53
-5
TaskOperateController.java
src/main/java/com/bbd/bpm/controller/taskOperate/TaskOperateController.java
+40
-5
BtnBean.java
src/main/java/com/bbd/bpm/dto/BtnBean.java
+13
-0
No files found.
src/main/java/com/bbd/bpm/controller/taskOperate/TaskOperateController.java
View file @
d2941c59
package
com
.
bbd
.
bpm
.
controller
.
taskOperate
;
import
com.bbd.bpm.dto.BtnBean
;
import
com.bbd.bpm.dto.PageUtil
;
import
com.bbd.bpm.dto.SysCode
;
import
com.bbd.bpm.dto.request.CompleteTaskRequest
;
...
...
@@ -15,10 +16,7 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.activiti.bpmn.model.BpmnModel
;
import
org.activiti.bpmn.model.FlowElement
;
import
org.activiti.bpmn.model.SequenceFlow
;
import
org.activiti.bpmn.model.UserTask
;
import
org.activiti.bpmn.model.*
;
import
org.activiti.engine.HistoryService
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.RuntimeService
;
...
...
@@ -372,7 +370,44 @@ public class TaskOperateController {
BpmnModel
bpmnModel
=
repositoryService
.
getBpmnModel
(
myTask
.
getProcessDefinitionId
());
UserTask
userTask
=
(
UserTask
)
bpmnModel
.
getFlowElement
(
myTask
.
getTaskDefinitionKey
());
List
<
SequenceFlow
>
outgoingFlows
=
userTask
.
getOutgoingFlows
();
resp
.
setData
(
outgoingFlows
);
List
<
BtnBean
>
buttons
=
new
ArrayList
<>();
outgoingFlows
.
forEach
(
sequenceFlow
->
{
FlowElement
targetFlowElement
=
sequenceFlow
.
getTargetFlowElement
();
if
(
targetFlowElement
instanceof
ExclusiveGateway
){
List
<
SequenceFlow
>
out
=
((
ExclusiveGateway
)
targetFlowElement
).
getOutgoingFlows
();
out
.
forEach
(
sequenceFlow1
->
{
if
(
StringUtils
.
isNotBlank
(
sequenceFlow1
.
getName
()))
{
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtnKey
(
sequenceFlow1
.
getName
());
btn
.
setBtnValue
(
sequenceFlow1
.
getId
());
buttons
.
add
(
btn
);
}
});
}
if
(
targetFlowElement
instanceof
UserTask
)
{
if
(
StringUtils
.
isNotBlank
(
targetFlowElement
.
getName
()))
{
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtnValue
(
targetFlowElement
.
getName
());
btn
.
setBtnKey
(
targetFlowElement
.
getName
());
buttons
.
add
(
btn
);
}
else
{
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtnValue
(
"提交"
);
btn
.
setBtnKey
(
"提交"
);
buttons
.
add
(
btn
);
}
}
if
(
targetFlowElement
instanceof
EndEvent
)
{
BtnBean
btn
=
new
BtnBean
();
btn
.
setBtnValue
(
"结束"
);
btn
.
setBtnKey
(
"结束"
);
buttons
.
add
(
btn
);
}
});
resp
.
setData
(
buttons
);
resp
.
setSuccess
(
true
);
resp
.
setMessage
(
"根据任务id获取本节点的所有出路成功"
);
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/bbd/bpm/dto/BtnBean.java
0 → 100644
View file @
d2941c59
package
com
.
bbd
.
bpm
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
BtnBean
implements
Serializable
{
String
btnValue
;
String
btnKey
;
}
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