Deleting from hierarchy

Hi, This is just an observation - I recently imported a storage location hierarchy that has varying levels of depth in different rooms. Mapping from the lowest level results in "Blank()" being appended to those instances where the hierarchy is not so deep. I understand that this is due to the fact that the mapping has been set to work from the lowest level. Not a train smash but it does result in a false count of real locations on the dashboard. Also I tried deleting some of the "Blank()" locations and noted that at the end of the deletion process ca reports "drawer deleted". I suppose the only way to overcome this is to break the data source up onto separate blocks of equal depth then write a mapping for each one and then import them separately. Might help someone

Comments

  • Forgot to mention Ubuntu 16.04,Firefox Browser, CA 1.7.6 Release

  • You can also make sure that the lowest level always has a value in your data source (and an indicator of record type). The parent parameter can skip levels, but the target of the mapping can not.

  • edited March 2019

    Thank You Julia,
    After scouring the documentation I found the following refinery in the Cook Book that seems to work ok, no blanks and correct location count.

    Solution
    Use the useParentAsSubject option along with a storageLocationHierarchyBuilder refinery. In this example, the last level before the first blank level will be the target for the objectSplitter.   Make sure to map the storageLocationHierarchyBuilder to ca_storage_locations.parent_id, rather than just ca_storage_locations.
    

    Rule Type.... Source...........CA table.element...........................Option....................................Refinery
    Mapping.........13.......ca_storage-locations.parent.id.....{useParentAsSubject":}...storageLocationHierarchyBuilder

    Refinery Parameters
    {
    "parents":[{
    "idno": "^14",
    "name": "^13",
    "type": "^15"
    },
    {
    "idno": "^11",
    "name": "^10",
    "type": "^15"
    },
    {
    "idno": "^9",
    "name": "^7",
    "type": "^8"
    }, },
    {
    "idno": "^5",
    "name": "^4",
    "type": "^6"
    },
    {
    "idno": "^3",
    "name": "^1",
    "type": "^2"
    },
    ]
    }

Sign In or Register to comment.