Project

General

Profile

Actions

Task #1464

closed

Recalculation of time slices - temporary removed automatic roles

Added by Alena Peterová about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Vít Švanda
Category:
Contractual relationship
Target version:
Start date:
01/22/2019
Due date:
% Done:

100%

Estimated time:
Owner:

Description

Version: 9.3.3 with projspec hotfixes (attached)

User has valid contract. It was split to several slices using past date, but the contract is still valid. But the automatic roles by organization were temporary removed during the recalculation at night.

Before synchronization, there were 2 slices. The synchronization created 2 new slices, the last of them is the new currently used slice:

The synchronization of slices was reconcilation, it updated all slices in IdM.
After that, ClearDirtyStateForContractSliceTaskExecutor handled all slices.
After that SelectCurrentContractSliceTaskExecutor run for 11 minutes, the count is 949, but its processed items are empty.

The slices of the user in ClearDirtyStateForContractSliceTaskExecutor were processed from last to newest. The 1-day slice (from 14.01.2019 to 14.01.2019) was processed between 02:06:34 and 02:08:17, during this period the contract was evidently updated from this slice and so the automatic roles were removed (not only made invalid, but really removed). This visible partly from audit log (attached) and partly from the catalina log.

2019-01-22 02:06:35.057  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [contract-slice-save-processor]([core]) end for [CoreEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmContractSliceDto [id= e629c115-c598-4883-80fc-2ad288a61734], properties: {}]] with order [0].
2019-01-22 02:06:35.058  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [chmi-contract-slice-save-recalculate-processor]([chmi]) start for [CoreEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmContractSliceDto [id= e629c115-c598-4883-80fc-2ad288a61734], properties: {}]] with order [1].
2019-01-22 02:06:35.081  INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager  : Publishing event [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto
 [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]]
2019-01-22 02:06:35.105  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-before-save-processor]([acc]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [-1000].
2019-01-22 02:06:35.106  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-before-save-processor]([acc]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [-1000].
2019-01-22 02:06:35.106  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-save-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [0].
2019-01-22 02:06:35.140  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-save-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [0].
2019-01-22 02:06:35.141  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-formable-save-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [50].
2019-01-22 02:06:35.141  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-formable-save-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [50].
2019-01-22 02:06:35.141  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-end-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [200].
2019-01-22 02:06:35.147  INFO 14022 --- [task-executor-4] chmuIsAccountDisabled                    : Start 'chmuIsAccountDisabled' script.
2019-01-22 02:06:35.154  INFO 14022 --- [task-executor-1] i.c.m.e.p.c.IdentityContractEndProcessor : Change identity [*******] state [LEFT]
....... account management etc........

2019-01-22 02:08:16.738  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-end-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [200].
2019-01-22 02:08:16.738  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-publish-change-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content:
 eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [10000].
2019-01-22 02:08:16.755  INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager  : Publishing event [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]]
2019-01-22 02:08:16.755  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-entity-generate-values-processor]([core]) start for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]] with order [-100].
2019-01-22 02:08:16.756  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-entity-generate-values-processor]([core]) end for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]] with order [-100].
2019-01-22 02:08:16.756  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [entity-event-save-processor]([core]) start for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]] with order [0].
22-Jan-2019 02:08:16.802 INFO [event-task-executor-2] eu.bcvsolutions.idm.connector.jdbc.beanshell.JDBCConnector.init(JDBCConnector.java:131) Connector INIT.
22-Jan-2019 02:08:16.846 INFO [event-task-executor-2] eu.bcvsolutions.idm.connector.jdbc.beanshell.JDBCConnection.startConnection(JDBCConnection.java:94) Connection started for user FRWS
2019-01-22 02:08:16.853  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [entity-event-save-processor]([core]) end for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= 0e313fa5-a588-444d-af6c-136054982c6b], properties: {}]] with order [0].
2019-01-22 02:08:16.853  INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager  : Event [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= 0e313fa5-a588-444d-af6c-136054982c6b], properties: {}]] is completed
2019-01-22 02:08:16.853  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-publish-change-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [10000].
2019-01-22 02:08:16.854  INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager  : Event [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] is completed

.............

2019-01-22 02:08:17.516  INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [chmi-contract-slice-save-recalculate-processor]([chmi]) end for [CoreEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmContractSliceDto [id= e629c115-c598-4883-80fc-2ad288a61734], properties: {}]] with order [1].

Updating of the contract from the slice in the end created event Contract NOTIFY, which has empty content.

The second event was created by processing the newest slice a few seconds after the 1-day slice (02:08:20). This second event probabaly corrected the final state of the automatic roles - thanks to 22.01.2019 02:21:06 core:identity-contract-update-by-automatic-role-processor


Files

ChmiContractSliceSaveRecalculateProcessor.java (4.81 KB) ChmiContractSliceSaveRecalculateProcessor.java Alena Peterová, 01/22/2019 09:50 AM
DefaultChmiEntityEventManager.java (1.35 KB) DefaultChmiEntityEventManager.java Alena Peterová, 01/22/2019 09:51 AM
contract_slices_after.png (50.5 KB) contract_slices_after.png Alena Peterová, 01/22/2019 10:00 AM
audit_for_user.png (155 KB) audit_for_user.png Alena Peterová, 01/22/2019 10:18 AM
audit_for_user_2.png (135 KB) audit_for_user_2.png Alena Peterová, 01/22/2019 10:18 AM
entity_events.png (29.3 KB) entity_events.png Alena Peterová, 01/22/2019 10:33 AM
entity_event_empty_content.png (41.6 KB) entity_event_empty_content.png Alena Peterová, 01/22/2019 10:34 AM
night_tasks.png (45.1 KB) night_tasks.png Alena Peterová, 01/22/2019 10:39 AM
Actions #1

Updated by Vít Švanda about 5 years ago

  • Status changed from New to In Progress
Actions #2

Updated by Vít Švanda about 5 years ago

  • Target version set to Onyx (9.3.4)
  • % Done changed from 0 to 80
Actions #3

Updated by Vít Švanda about 5 years ago

I fixed this issues.

I use this solutions:

LRT for recalculation dirty slices is now diveded to 4 steps:

1 - recalculation of slices with valid contracts,
2 - recalculation of slices with future valid contracts,
3 - recalculation of slices with invalid contracts,
4 - recalculation of slices to delete,

For step 4, I had to implemented recalculation for deleted slices. If sync try to delete slice, is that slice marked as dirty. Slice is not deleted in this phase! As last is in LRT for slice recalculation are that slices deleted.

I fixed problem with executing a HR processes during bulk recalculation too.

Tests and release remains.

Commit: https://github.com/bcvsolutions/CzechIdMng/commit/12690dfdecf73f5ea5a28c367e797d49cba8ee3f

Actions #4

Updated by Vít Švanda about 5 years ago

ChmiContractSliceSaveRecalculateProcessor.java can be deleted is implemented in 9.3.4. EntityEventManager not.

Actions #5

Updated by Vít Švanda about 5 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Vít Švanda to Ondřej Kopr
Actions #6

Updated by Ondřej Kopr about 5 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Ondřej Kopr to Vít Švanda
  • % Done changed from 80 to 100

I made code review seems like little big changes in recalculation of contract slices. Code is awesome. From my code in LRT ClearDirtyStateForContractSliceTaskExecutor stay not kamen on kamen.

Actions #7

Updated by Vít Švanda about 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF