Feature #2550
closedExport+import of a virtual system - empty additional attributes in virtual requests, error when using the "rights" attribute
100%
Description
Tested on the version 10.4.7
Export + import of a virtual system doesn't create the virtual system with the same attributes (in VsAccount form definition), which leads to some issues when using this imported system.
A) "rights" attribute causes errors when implementing the virtual requests- Create a virtual system
- Export the system
- Import the system
- Create 2 roles which assign the system and set some value to the "rights" attribute
- Assign the roles to a user
- Mark the virtual request as implemented - not possible, red message "Some error occured on server" appears
2020-11-02 19:01:58.887 ERROR 4184054 --- [http-nio-8080-exec-2] e.b.i.c.e.ExceptionControllerAdvice.handle : [65338c09-0303-4028-8124-0e5b7883a858] java.lang.IllegalArgumentException: Form attribute [czechidm:virtual-system-basic:eu.bcvsolutions.idm.vs.connector.basic.BasicVirtualConnector:1.0.1:systemId=e88a55cf-f62d-4cb6-92e1-29e904873d19:rights] does not support multivalue, sent [2] values. at eu.bcvsolutions.idm.core.eav.service.impl.DefaultFormService.saveAttributeValues(DefaultFormService.java:592) at eu.bcvsolutions.idm.core.eav.service.impl.DefaultFormService.saveValues(DefaultFormService.java:543)
Note: Maybe connected to this #2398?
B) additional empty attributes in virtual requests- Create a virtual system (without default role in my case)
- Remove some of the attributes - phone, titleBefore, titleAfter, rights (https://wiki.czechidm.com/tutorial/adm/virtual_system_-_adding_or_deleting_managed_extended_attributes#deleting_attributes_on_virtual_systems)
- Export the system
- Import it to some other instance of IdM
- Create a role for the system
- Add the role to some user
- Mark the virtual request as implemented
- Change the last name of the user
- The virtual request contains empty attributes that shouldn't be there (which is confusing, especially when there is a lot of them)
Workaround: Delete the additional attributes from the VsAccount form definition of the imported system
Attached is the exported ZIP file and the screenshots of the form definition "VsAccount" from both instances. We can see the additional attributes in the imported instance that shouldn't be there.
Note: If we add some new singlevalued attributes different from the default attributes, they are imported correctly
Files
Related issues
Updated by Radek Tomiška about 4 years ago
- Is duplicate of Feature #2398: When copying default virtual system, multivalued attribute 'rights' is not created as multivalued in its form definition added
Updated by Radek Tomiška about 4 years ago
- Is duplicate of deleted (Feature #2398: When copying default virtual system, multivalued attribute 'rights' is not created as multivalued in its form definition)
Updated by Radek Tomiška about 4 years ago
- Related to Feature #2398: When copying default virtual system, multivalued attribute 'rights' is not created as multivalued in its form definition added
Updated by Vít Švanda about 4 years ago
Here is the same answer as in case # 2398. The VsAccount definition is part of the VS module and not ACC. By default, System Export exports only data from the ACC module.
What you require is export specifically for virtual systems. The current behavior is not a defect.
Related to this task is the need to export data from multiple modules in a single operation, and this export is not possible now. It's not a problem to implement it, but I'm just illustrating why it wasn't done in the first version (it's not a trivial extension).
Updated by Alena Peterová about 4 years ago
I understand, it's just that I wasn't aware of this limitation. I put it to the wiki: https://wiki.czechidm.com/devel/documentation/adm/export_import#virtual_systems now.
Updated by Radek Tomiška about 4 years ago
- Tracker changed from Defect to Feature
- Affected versions deleted (
10.4.7)
Updated by Ondrej Husník over 3 years ago
- Assignee changed from Vít Švanda to Ondrej Husník
- Target version set to 11.1.0
Updated by Ondrej Husník over 3 years ago
- Status changed from New to In Progress
Updated by Ondrej Husník over 3 years ago
Full support of VS export and import has been implemented. The implementation solves both scenarios described in this task.
The first scenario A) "rights" attribute causes errors when implementing the virtual requests is solved by the proper export of VS form definition to the export batch.
The second one B) additional empty attributes in virtual requests was caused by the fact that during the process of VS import there were created all default a attributes in the VsAccount form definition. Attributes which are not listed in the VS configuration are now removed from the VsAccount form definition.
Please could you provide me the feedback?
https://github.com/bcvsolutions/CzechIdMng/commit/6d04116296272436a2fdb517e65b2a1187978a79
https://wiki.czechidm.com/devel/documentation/adm/export_import#virtual_systems
Updated by Ondrej Husník over 3 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Ondrej Husník to Vít Švanda
- % Done changed from 80 to 90
Updated by Vít Švanda over 3 years ago
- Status changed from Needs feedback to In Progress
- Assignee changed from Vít Švanda to Ondrej Husník
- % Done changed from 90 to 100
I did review and tested it. Works awesome, thanks for that.
I found only one minor thing: Please make method SystemExportBulkAction.exportVsDefinition more universal (rename to for example to 'emittExportEvent').
Updated by Ondrej Husník over 3 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Ondrej Husník to Vít Švanda
Thank you for the review. Here is that change.
https://github.com/bcvsolutions/CzechIdMng/commit/6e9158ffce89f5546eebce4a1c114c079db01d61
and another one
https://github.com/bcvsolutions/CzechIdMng/commit/d3cc92c5d6b52c6b07fdbf732e40a38e1e104555
Updated by Vít Švanda over 3 years ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Vít Švanda to Ondrej Husník
Updated by Radek Tomiška over 3 years ago
- Status changed from Resolved to Closed