Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
e587d68f
authored
Nov 25, 2024
by
Lesan
Committed by
Gitee
Nov 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 解决存在循环节点时的bug
parent
00a19cfc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/components/bpmnProcessDesigner/package/penal/custom-config/ElementCustomConfig.vue
+9
-0
No files found.
src/components/bpmnProcessDesigner/package/penal/custom-config/ElementCustomConfig.vue
View file @
e587d68f
...
...
@@ -245,6 +245,7 @@ function findAllPredecessorsExcludingStart(elementId, modeler) {
const
elementRegistry
=
modeler
.
get
(
'elementRegistry'
)
const
allConnections
=
elementRegistry
.
filter
((
element
)
=>
element
.
type
===
'bpmn:SequenceFlow'
)
const
predecessors
=
new
Set
()
// 使用 Set 来避免重复节点
const
visited
=
new
Set
()
// 用于记录已访问的节点
// 检查是否是开始事件节点
function
isStartEvent
(
element
)
{
...
...
@@ -252,6 +253,14 @@ function findAllPredecessorsExcludingStart(elementId, modeler) {
}
function
findPredecessorsRecursively
(
element
)
{
// 如果该节点已经访问过,直接返回,避免循环
if
(
visited
.
has
(
element
))
{
return
}
// 标记当前节点为已访问
visited
.
add
(
element
)
// 获取与当前节点相连的所有连接
const
incomingConnections
=
allConnections
.
filter
((
connection
)
=>
connection
.
target
===
element
)
...
...
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