flowable / flowable/flowable-engine

The DefaultIdentityLinkIterceptor.java creates duplicate identityLinks on ProcessInstance

Aperta
#3,900 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
7h 8m
PR unite (30g)
2

Descrizione

**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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.