Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The DefaultIdentityLinkIterceptor.java creates duplicate identityLinks on ProcessInstance #3900

Open
billerby opened this issue May 23, 2024 · 0 comments

Comments

@billerby
Copy link

Describe the bug
The DefaultIdentityLinkIterceptor.handleCompleteTask method creates a new PARTICIPANT IdentityLink on the ProcessInstance the tasks belongs to every time a task completes.

Expected behavior
There should be a check if such an IdentityLink already exists before creating it. This is done in some of the other methods in the class by calling the addUserIdentityLinkToParent which does such a check.

Noticed that we had a lot of duplicates in the IdentityLink-tables for processes with a lot of tasks.

Code

        public void handleCompleteTask(TaskEntity task) {
                if (Authentication.getAuthenticatedUserId() != null && task.getProcessInstanceId() != null) {
                    ExecutionEntity processInstanceEntity = CommandContextUtil.getExecutionEntityManager().findById(task.getProcessInstanceId());
                    IdentityLinkUtil.createProcessInstanceIdentityLink(processInstanceEntity,
                            Authentication.getAuthenticatedUserId(), null, IdentityLinkType.PARTICIPANT);
                }
            }

Additional context
This is present on the main branch.

@billerby billerby changed the title The DefaultIdentityLinkIterceptor.java create duplicate identityLinks on ProcessInstance The DefaultIdentityLinkIterceptor.java creates duplicate identityLinks on ProcessInstance May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant