Project

General

Profile

Actions

Task #2379

closed

Improve ImportAutomaticRoleAttributesFromCSVExecutor for importing automatic roles by user attributes, eav and by contract attributes, eav

Added by Roman Kučera over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roman Kučera
Target version:
Start date:
07/09/2020
Due date:
% Done:

100%

Estimated time:
Owner:

Description

Now you can only import automatic roles definition by one or two contract EAV and that is not enough.

Implement new options into task:
  • create definition by identity attribute
  • create definition by identity eav attribute
  • create definition by contract attribute
  • create definition by contract eav attribute

number of attributes and eav attributes must be dynamic.
Dynamic number of EAV attributes is used in https://github.com/bcvsolutions/czechidm-extras/blob/40b8ea05074601d981b491c9a43cd7e78a51bbb0/Realization/backend/idm-extras/src/main/java/eu/bcvsolutions/idm/extras/scheduler/task/impl/ImportCodeListFromCSV.java

Also you should be able to create definition with multiple rules. E.g definition by identity attribute and for example contract EAV
This task must support different types of attributes not only String.
For example define these rules:
  • isPrimary = false
  • contract state = empty (not out of evidence)
  • some contract eav = some string value
  • some identity eav = some string value
Actions #1

Updated by Roman Kučera over 4 years ago

  • Description updated (diff)
Actions #2

Updated by Roman Kučera over 4 years ago

  • Description updated (diff)
Actions #3

Updated by Roman Kučera over 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 70

Implementation in https://github.com/bcvsolutions/czechidm-extras/commits/2379-improve-auto-role-import

You can import rules by identity, identity EAV, contract, contract EAV.
Some more testing need to be done.

TODO tests and documentation

Actions #4

Updated by Roman Kučera over 4 years ago

  • % Done changed from 70 to 80
Actions #5

Updated by Roman Kučera over 4 years ago

  • % Done changed from 80 to 90

Tests implemented.
Line coverage 75% because of there is no reason to test method getFormAttributes

Actions #6

Updated by Roman Kučera over 4 years ago

  • Target version changed from 1.9.0 to 2.5.0
Actions #7

Updated by Roman Kučera over 4 years ago

New LRT was created, because the old LRT was really reusable and it was easier to create new one. The old is still there, and we can discuss to mark it as deprecated and remove it in some next version for example.

Actions #8

Updated by Ondřej Kopr over 4 years ago

I just made review. Whole functionality works :) there is just some minor things:
  • check max length for new automatic role name , now is only DefaultFieldLengths.NAME,
  • method taskNotCompleted is not used, you can delete this method,
  • task catches errors but without returning correct resultOperation, please return specific result operation for failed task,
  • (optional) some configuration properties are required and missing default values. You can setup default values for these configurations for each IdmFormAttributeDto,
  • for extras version 2.5.0 is possible translate long running task name and parameters please do it :-P.

In processed items are rules not automatic roles, is this correct?

The current review is for me OK. I leave task opened because after some consultation on presentation is possible that you will made some changes :).

I checked little performance test for one role with 500 rules and your taks creates 500 rules in 12 second. I dont recommended automatic role with 500 rules because recalculation for one role takes more than 10 minutes.

Actions #9

Updated by Roman Kučera over 4 years ago

Ondřej Kopr wrote:

I just made review. Whole functionality works :) there is just some minor things:
  • check max length for new automatic role name , now is only DefaultFieldLengths.NAME,
  • method taskNotCompleted is not used, you can delete this method,
  • task catches errors but without returning correct resultOperation, please return specific result operation for failed task,
  • (optional) some configuration properties are required and missing default values. You can setup default values for these configurations for each IdmFormAttributeDto,
  • for extras version 2.5.0 is possible translate long running task name and parameters please do it :-P.

In processed items are rules not automatic roles, is this correct?

The current review is for me OK. I leave task opened because after some consultation on presentation is possible that you will made some changes :).

I checked little performance test for one role with 500 rules and your taks creates 500 rules in 12 second. I dont recommended automatic role with 500 rules because recalculation for one role takes more than 10 minutes.

Thx, I fixed all issues in https://github.com/bcvsolutions/czechidm-extras/commit/d0ebb1b7b4bc2aac4a4029ce26584c3fe2237aad
About logging rules into processed items, this behavior is intended, because I think that it's useful to see on FE how many rules where imported. I just fixed the number of processed items so it won't display for example 7/3 but correctly 7/7

Fixed test https://github.com/bcvsolutions/czechidm-extras/commit/a2fcc334115c1fede823bd2f8fd7918bbe39aeaf

Actions #10

Updated by Roman Kučera over 4 years ago

Right now I am doing some more refactoring based on our internal discussion. Some abstract LRT class will used

Actions #11

Updated by Peter Štrunc over 4 years ago

  • Target version changed from 2.5.0 to 2.6.0

Postponing to 2.6.0 until refactoring is done

Actions #12

Updated by Peter Štrunc over 4 years ago

Hey @kucerar,
how is it going with the refactoring? Could you please look at this merge request https://github.com/bcvsolutions/czechidm-extras/pull/38 and confirm that it contains everything needed?

Thanks

Actions #13

Updated by Roman Kučera over 4 years ago

@sourek I checked the MR a it looks good to me, all commits should be there.
After you merge it into develop, I will just test the LRT quickly to see if everything works correctly, because @doischert makes some changes in the abstract class.

Actions #14

Updated by Roman Kučera over 4 years ago

Added changes from #2390 into develop branch. cherry pick was unusable so I moved the changes manually.
I retest this LRT on develop with the new changes and and it works as intended.
Behavior is same as in LTS version #2390
commit https://github.com/bcvsolutions/czechidm-extras/commit/7505c4898f830868339d48f822e56a5d55489be6

Actions #15

Updated by Peter Štrunc over 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

Great stuff, thanks. Closing this ticket.

Actions

Also available in: Atom PDF