Topic
  • 5 replies
  • Latest Post - ‏2013-02-13T20:11:19Z by SystemAdmin
SystemAdmin
SystemAdmin
648 Posts

Pinned topic Selective Export/Import Relationship attribute issue

‏2013-02-13T11:53:24Z |
Hi all,

By Selective Export/Import I try to deploy two Catalogues. The Items of one Catalog have a relationship attribute with the another one.

I Export/Import the structure and content of these Catalogs (without dependencies errors). All correct unless the relationship attribute.
All the information about this attribute has not pass (the content).

I miss a step? There is a known issue about these?

Thanks

Version: 6.0.0-FP012#03
Updated on 2013-02-13T20:11:19Z at 2013-02-13T20:11:19Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Selective Export/Import Relationship attribute issue

    ‏2013-02-13T12:21:18Z  
    Hi,

    Well, if you try to get a value of a relationship attribute via a script, you get some number. It is ID of item in the database, not a primary key. So I suppose, when you are exporting a content of an item this ID is saved in an export file. Then when you are importing the item into a new environment, there is no a item with the same ID in the new environment and the relationship attribute stays a blank.
    To confirm above you should look at the content of the item in the export file and see if ID or primary key is stored there.
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Selective Export/Import Relationship attribute issue

    ‏2013-02-13T12:26:00Z  
    Hi,

    According to the InfoCenter, the company import doesn't support importing relationship attribute information.
  • StefanR
    StefanR
    6 Posts

    Re: Selective Export/Import Relationship attribute issue

    ‏2013-02-13T12:31:57Z  
    Hi,

    According to the InfoCenter, the company import doesn't support importing relationship attribute information.
    I hope following developerworks article helps:
    http://www.ibm.com/developerworks/data/library/techarticle/dm-1209mdmimportexport/index.html
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Selective Export/Import Relationship attribute issue

    ‏2013-02-13T16:24:13Z  
    • StefanR
    • ‏2013-02-13T12:31:57Z
    I hope following developerworks article helps:
    http://www.ibm.com/developerworks/data/library/techarticle/dm-1209mdmimportexport/index.html
    Its clear, I have to do myself... what I was trying to avoid! :S

    Next time I will think hard about creating a relationship attribute or not.

    Thank you all for the information :)
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Selective Export/Import Relationship attribute issue

    ‏2013-02-13T20:11:19Z  
    Its clear, I have to do myself... what I was trying to avoid! :S

    Next time I will think hard about creating a relationship attribute or not.

    Thank you all for the information :)
    Hi Victor,

    I came across the same problem as you.
    So a recommendation is not to use a relationship attribute but a linked item since that is being processed correctly.

    I have created some kind of new import. This is what is stated in the original environment_catalog_content_import_script:

    else if ( attr_value.startsWith("RELATIONSHIP_INFO") ) //Fix WPC00033069
    {
    // XXX-Wolf-15-dec-Srikanth-16-jan-FIXED Relationship will have to be handled eventually though
    // XXX-Srikanth-16-jan Relationships are handled in recursive import.

    // skip because this can cause circular dependencies - items can be
    // related to items in the same catalog or catalogs not yet loaded -
    // this has to be taken care of in a second pass
    }

    So, understandable it is too complex the import should test if the other catalog is available.

    I did it like this.
    First import the catalogs and content. They do not fail, just the relationship fields are empty.
    Then i replaced the environment_catalog_content_import_script with my own script and ran the import again. The script did do nothing else then take the value from the import and put it in the fields.
    I have added my script. I just put in the fields hardcoded, but you can also do it if it has anything do to with RELATIONSHIP_INFO:

    item.setEntryRelationshipAttrib(attr_name, ctg, attr_name_value[3]);//[3] is the place where the link is stored

    that should do it.

    Regards,
    Han