[Fix-8296] Fix update process definition error#8309
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #8309 +/- ##
============================================
- Coverage 45.34% 45.32% -0.02%
Complexity 3999 3999
============================================
Files 680 680
Lines 26463 26472 +9
Branches 2849 2848 -1
============================================
- Hits 12000 11999 -1
- Misses 13330 13342 +12
+ Partials 1133 1131 -2
Continue to review full report at Codecov.
|
| Collectors.toMap( | ||
| TaskDefinition::getCode, | ||
| taskDefinitionLog -> taskDefinitionLog, | ||
| (entityOld , entityNew) -> entityOld |
There was a problem hiding this comment.
I am actually not sure the logic here, but I guess you want to retain the latest taskDefinitionLog in the map?
If so, you bettered compared by id or operateTime to determine which should retain.
There was a problem hiding this comment.
In the production environment where I upgraded from 2.0.2-release to 2.0.3-release, when entering the workflow definition modification content from the process instance page, the front end would send two identical data, which caused this error. However, I am currently unable to reproduce this problem in standalone mode. It makes me confused.
There was a problem hiding this comment.
@JinyLeeChina plz check this. i am not sure its as same as the issue #8043.
the logic maybe like this according to @JinyLeeChina .
any part of the workflow changed would lead to the workflow's version change.
so when you changed one taskDefinition, the taskDefinition has two version now, but the workflow doesn`t. When ui query this workflow it returns two taskDefinition with same code but different version and this cause the duplicate error
There was a problem hiding this comment.
After several days of careful investigation, I probably found the cause of this situation.
Steps to reproduce:
1.Create a workflow with dependent nodes in 1.3.9, and the dependent nodes contain more than 1 dependency.
2.Create a new process definition by using copy workflow and then modify copyed workflow content randomly.
3.Upgrade version from 1.3.9 to 2.0.3.
4.Update process instance/definition.
The reason is that after using the copy workflow, the dependency will be copied, resulting in multiple identical pre tasks. At this time, there will be multiple workflow definitions and workflow relationships in the request sent by saving the workflow definition.
There was a problem hiding this comment.
@JinyLeeChina plz check this. i am not sure its as same as the issue #8043.
the logic maybe like this according to @JinyLeeChina .
any part of the workflow changed would lead to the workflow's version change. so when you changed one taskDefinition, the taskDefinition has two version now, but the workflow doesn`t. When ui query this workflow it returns two taskDefinition with same code but different version and this cause the duplicate error
Yes, I also think this is the same problem as #8043. It has been fundamentally solved in version 203. There are design changes from 202 to 203. From 2.0.0 to 2.0.2, the version is designed with task as the core, and the version is designed with workflow as the core after 2.0.3. Therefore, the PR submitted in #8043 is for this design change. At the same time, the problem of repeated key is also fundamentally solved, not just the bug
|
Kudos, SonarCloud Quality Gate passed! |
|
Thank you for your contribution. I don't think this PR can be merged. |










Purpose of the pull request
This pr will close #8296