Migrate to the new aBOM API - ION Manual

Actions needed

This project will introduce breaking changes.

  1. API: If you are using the API to call any of the below mutations or a query that uses any of the below fields, you will need to update your mutations/queries.
  2. Actions: If you have any ION actions (rules) using any of the objects below, those will be disabled when this project is released and you will need to update those after release.
  3. Webhooks: If you have any webhooks listening to any of the objects below, you will need to update your webhook listeners after release.
  4. Analytics: If you have any SQL queries referencing abom_items or abom_edges those will need to be updated.

If the above does not apply to you then no changes necessary!

Changes overview

Below shows an example of a car assembly that is partially installed and the differences between the old structure and the new structure.

Old structure:

Inventory Type SN
1 Car Assembly 45
2 12
3 13
ABOM Item Type Qty
1 Car Assembly 1
2 Wheel Assembly 1
3 Wheel Assembly 1
4 Wheel Assembly 2
5 Fastener 50

New structure:

ABOM Installation Type SN
1 Car Assembly 45
2 12
3 13
Build Requirement Type Qty
1 Wheel Assembly 4
2 Fastener 50

Old structure:

New structure:

Mutation/query changes

Below shows the full list of items that are going away.

Going away

Mutations

GQL Objects/Queries

Fields

(and any count fields generated from these relationships)

Examples

API: Installing a part

Old structure: Previously, you would have to update an existing abom_item with an inventory to install that inventory. The abom_item at that point may get swapped if the inventory being installed is already linked to an abom_item.

Update aBOM item

mutation UpdateABomItem($input: UpdateABomItemInput!) {
    updateAbomItem(input: $input) {
        abomItem {
            id
            updatedById
            partInventoryId
        }
    }
}
{
    "input": {
        "id": 1,
        "partInventoryId": 1,
        "etag": "etag"
    }
}

New structure: Now installing a part is done via creating an aBOM installation. aBOM installations link inventories to buildRequirements. Conversely, uninstalling a part is done by deleting aBOM installations.

Create aBOM installation

mutation CreateAbomInstallation($input: CreateAbomInstallationInput!) {
    createAbomInstallation(input: $input) {
        abomInstallation {
            buildRequirementId
            buildRequirementReferenceDesignatorId
            partInventoryId
            quantity
        }
    }
}
{
    "input": {
        "buildRequirementId": 1,
        "partInventoryId": 3,
        "quantity": 1
    }
}

SQL: Query for an inventory’s aBOM

Old structure:

select
parent_part.part_number,
parent_part.description,
parent_inventory.serial_number,
parent_inventory.lot_number,
parent_inventory.quantity,
child_part.part_number,
child_part.description,
child_inventory.serial_number,
child_inventory.lot_number,
child_abom_item.quantity as 'installed quantity'

from parts_inventory parent_inventory
inner join parts parent_part on parent_part.id = parent_inventory.part_id
inner join abom_items parent_abom_item on parent_inventory.id = ai.part_inventory_id
inner join abom_edges ae on ae.parent_abom_item_id = parent_abom_item.id
inner join abom_items child_abom_item on child_abom_item.id = ae.child_abom_item_id
inner join parts_inventory child_inventory on child_abom_item.part_inventory_id = child_inventory.id
inner join parts child_part on child_part.id = child_abom_item.part_id

where parent_inventory.id = 105

New structure:

select
parent_part.part_number,
parent_part.description,
parent_inventory.serial_number,
parent_inventory.lot_number,
parent_inventory.quantity,
child_part.part_number,
child_part.description,
child_inventory.serial_number,
child_inventory.lot_number,
ai.quantity as 'installed quantity'

from parts_inventory parent_inventory
inner join parts parent_part on parent_part.id = parent_inventory.part_id
inner join part_inventory_build_requirements pibr on pibr.part_inventory_id = parent_inventory.id
inner join abom_installations ai on pibr.build_requirement_id = ai.build_requirement_id
inner join parts_inventory child_inventory on ai.part_inventory_id = child_inventory.id
inner join parts child_part on child_part.id = child_abom_item.part_id

where parent_inventory.id = 105