MonarcAppFO icon indicating copy to clipboard operation
MonarcAppFO copied to clipboard

Import/export analysis with an included "Obligation légal GDPR" asset

Open ThierryPGT opened this issue 8 years ago • 10 comments

Hello, try to create a simple asset with existing object

  • Service
    • Front Office
    • Back Office
    • Obligation legal GDPR

Export analysis (Focus on Service), no password, only the model Try to import the asset in a existant analysis. Nothing is imported. Don't hesitate for more détails CU Thierry Petitgenet

ThierryPGT avatar Dec 12 '17 10:12 ThierryPGT

HI Thierry,

Seems there is a little bug with the clear export/import. You can do the job with the encrypted one with the password.

Have a nice day

Jérôme

jerolomb avatar Dec 12 '17 13:12 jerolomb

The file you export is it just containing [object object] ? If it's the case just clean the cache of your browser. In all the case, can you make a test with a cleaned cache ?

jerolomb avatar Dec 12 '17 15:12 jerolomb

I don't understand [object object] ? The file is containing the asset "Service " that contains the three assets Font-office, Back-office And Obligation légal GDPR. I have cleared the cache. With or without password, it's the same result, asset is not or partially imported in the new analysis.

ThierryPGT avatar Dec 12 '17 16:12 ThierryPGT

I just asked you to look into the file which is exported and tell us if the json is a complete one or if it just contains [object object].

You can for example edit the file to look into with notepad on windows.

jerolomb avatar Dec 13 '17 07:12 jerolomb

The error is raised from here: https://github.com/monarc-project/zm-core/blob/master/src/MonarcCore/Validator/UniqueCode.php#L49 this is weird. I investigate more.

cedricbonhomme avatar Dec 13 '17 12:12 cedricbonhomme

The problem seems to be when we have a "Front office" and a "Back office" in the Service asset. It is working if for example we only have a "Back Office" and "Obligation legal GDPR".

During the import of the previously exported file (Service.json), we can see that the import procedure is abrupted during the import of the second asset (Front office):

Service
    Back Office
        Gestion serveurs
        Réseau & télécom
        Organisation informatique
        Développements logiciels
        Salle informatique
        Gestion des backups
        Postes de travail admin
        Bâtiment
        Administrateur système
    Front Office
        Employés

The problem is raised when trying to import "Employés" from "Font Office".

At this stage, the content of fields (https://github.com/monarc-project/zm-core/blob/master/src/MonarcCore/Validator/UniqueName.php#L44) is:

Array
(
    [name1] => Employés
    [anr] => 10
)
Array
(
    [name2] => Employees
    [anr] => 10
)
Array
(
    [name3] => Mitarbeiter
    [anr] => 10
)
Array
(
    [name4] => Werknemers
    [anr] => 10
)

cedricbonhomme avatar Dec 18 '17 10:12 cedricbonhomme

the test isValid() from UniqueName.php is called from: https://github.com/monarc-project/zm-core/blob/master/src/MonarcCore/Service/ObjectExportService.php#L291 (line 175 in exchangeArray())

cedricbonhomme avatar Dec 18 '17 10:12 cedricbonhomme

In this case, as the integration method is "Fusion", items with the same name, should be overwritten, no ?

ThierryPGT avatar Dec 18 '17 11:12 ThierryPGT

If by "fusion" you mean "merge", yes. My problem is that with the content I pasted just above, I don't see duplicates with 'Employees'.

cedricbonhomme avatar Dec 18 '17 11:12 cedricbonhomme

Right. In this case, the object "Employees" has been created in two separated risk analysis. The name is the same, but not the internal reference number that is created by the system.

ThierryPGT avatar Dec 18 '17 11:12 ThierryPGT