Installation Control

A guide for developers making ION Actions on abomInstallation events.

Creating Ion Actions for A-Bomb Installations

Objective

This outlines the steps to develop ion actions for A-bomb installations, focusing on identifying and utilizing necessary IDs for successful execution of the context query. This aids in developing ION Actions.

Key Steps

Step 1: Understand the Context for Ion Actions 0:00

  • Create an abomInstallation Action and start out with this base template for the context query (INITIAL SETUP SHOWN IN IMAGE BELOW):

query ($buildRequirementId: ID!, $partInventoryId: ID!) {
  abomInstallation(
    buildRequirementId: $buildRequirementId
    partInventoryId: $partInventoryId
  ) {
    id
    partInventory {
      id
    }
  }
}
  • The inputs necessary to test the context for this rule will be the following.

{
  "buildRequirementId":INSERT ID HERE, 
  "partInventoryId":INSERT ID HERE
}
  • Recognize that A-bomb installations require two IDs:

    • Build Requirement ID

    • Part Inventory ID

  • These IDs are essential for rule context development.

  • Once the ION Action is live, these IDs will be passed into the ion action during execution. To help develop these rules we recommend the following steps to know what IDs to test with.

Step 2: Install GraphQL Network Inspector 1:32

  • Install the GraphQL Network Inspector tool to monitor the execution of your ion actions.

  • This tool helps you see the IDs and data being processed so you can effectively develop the ION Action.

Step 3: Execute a Mutation to Install Part Inventory 2:15

  • Right click and open the inspect tool, toggle to the GraphQL tab so you can see what mutations are called.

  • Replicate the action you are trying to control, in this case installing something onto an aBOM.

  • Focus on the mutation called install part inventory.

  • See that the request includes both a Build Requirement ID and Part Inventory ID.

Step 4: Analyze the Response for IDs 3:14

  • Check the response tab for the InstallPartInventory query which will contain a partInventoryId, which may differ from the one passed in during the request (in the case were splitting happened from a partial install).

  • Note the buildRequirementId and the new partInventoryId for your records, you can pass these into the inputs within the ION Actions context interface to see what the context will return.

Step 5: Save the Context of the Rule Query 5:26

  • Pass in the input variables based on the query response to understand what this specific context returned. This will help you define the logic to use within the code portion of the ION Action. In the example image above the id's happened to be:

{
  "buildRequirementId":2622, 
  "partInventoryId":2079
}
  • Save the context query of your ION action with the explicit save icon below the play button to avoid re-entering the query formatting in future sessions. (You will need to specify the query inputs each time.)

Step 6: Access Origin Part Inventory Attributes 6:28

  • If you split an inventory, you can use the originPartInventory field to access information related to the original inventory item "pre" the split.

  • Now that you know what the context will return, write code within the code tab to determine installation eligibility!

    • ION Actions code can now access the context in the following manor: context.get("abomInstallation", {}).get("partInventory", {}).get(.......

Cautionary Notes

  • Ensure that you are using the correct IDs to avoid errors in your ion actions.

Tips for Efficiency

  • Regularly use the GraphQL Network Inspector to familiarize yourself with the IDs and data flow.

https://loom.com/share/d8dd4e1a7eb844d4bf74e3a11f5457b1

Last updated

Was this helpful?