Defect #1727
closedFailed event during manual contract end with automatic roles
100%
Description
Situation:
- identity has automatic role by attribute or by organization
- the contract is manually ended (by setting valid to)
- IdmIdentityContract UPDATE event ends with the attached exception
The role is removed, so it seems that only problem on 9.7.0 is the error in the event.
But on version 9.6.4, when it is automatic role by attribute, there is no failed event, but Audit - Requests for roles - can't be displayed with the exception:
org.springframework.orm.jpa.JpaObjectRetrievalFailureException: Unable to find eu.bcvsolutions.idm.core.model.entity.IdmIdentityRole with id ad8b8a02-8abe-4a60-94c1-61ce22a5161a; nested exception is javax.persistence.EntityNotFoundException: Unable to find eu.bcvsolutions.idm.core.model.entity.IdmIdentityRole with id ad8b8a02-8abe-4a60-94c1-61ce22a5161a
So on 9.6.4 the problem probably affects data consistency.
(I tested only manual contract end, I didn't test contract end by HR process.)
Files
Related issues
Updated by Alena Peterová over 5 years ago
- Related to Task #1700: Optimisation of manual contract end added
Updated by Radek Tomiška over 5 years ago
- Assignee changed from Ondřej Kopr to Radek Tomiška
Updated by Radek Tomiška over 5 years ago
When role was removed synchronously, then all assigned roles were removed in the same time (direct, automatic, sub roles). Now automatic roles are recounted before asynchronous request is processed => request cannot remove automatic roles and sub roles now => three asychronous processes have to be executed for successfull role removal now, will be fixed :/.
Updated by Radek Tomiška over 5 years ago
- Status changed from New to Needs feedback
- Assignee changed from Radek Tomiška to Vít Švanda
- Target version set to Quartz (9.6.6)
- % Done changed from 0 to 90
I checked processors for automatic roles and I fixed it an other way, which was already prepared for automatic roles by tree structure - invalid contracts are ignored, when automatic roles are processed. I implemented it for all automatic role processors => just one asynchronous role request is executed to role removal.
Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/7a2490852cf2f3b6532565f211cac1def63ca21b
Could you do a feedback, please?
Updated by Vít Švanda over 5 years ago
- Status changed from Needs feedback to In Progress
- Assignee changed from Vít Švanda to Radek Tomiška
Updated by Vít Švanda over 5 years ago
Works correctly, but after I set validFrom of contract to the past, two role request were generated. First for remove all direct and automatic roles and second for update the automatic role (assigned by tree node). The second request is redundant.
Updated by Radek Tomiška over 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
We did another tests and is not reproducible any more., even when more direct roles are removed.