Request

Response

    Archive Property Definition

    This topic provides instructions on how to archive an existing property definition. By archiving an existing property definition, you will no longer be able to change its attributes or assign values to it. However, you will still be able to read the properties that are available in the archived property definition.

    Note: Archiving a property definition is a permanent action and cannot be undone.

    You will use the following queries in this topic:

    TypeOperationDescription
    mutation archivePropertyDefinition Returns the details of the archived property definitions.

    Step 1 - Archive Property Definition

    The archivePropertyDefinition mutation fetches the ArchivePropertyDefinitionPayload object in response. ArchivePropertyDefinitionPayload returns the details of the archived property definitions.

    1. Enter the following query in the Query Pane of the Manufacturing Data Model Explorer.

      Query

      mutation ArchivePropertyDefinition($propertyDefinitionId: ID!) {
          archivePropertyDefinition(
              input: {propertyDefinitionId: $propertyDefinitionId}
          ) {
              propertyDefinition {
                  id
                  name
                  specification
                  isHidden
                  isReadOnly
                  isArchived
                  description
                  propertyBehavior
                  units {
                      id
                      name
                  }
              }
          }
      }
      
      Show More

    1. In the Query Variables Pane, enter the value of propertyDefinitionId. To know how to obtain propertyDefinitionId, refer to Add Property Definition to Collection topic.

      Query Variables

      {
      "propertyDefinitionId": "cHJvcGRlZn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5ET0NTX1BST1BfREVGX0NPTExFQ1RJT05-cGFyYW1ldGVycy5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcjoxYmZmNjY4Yzk4YTk0MmM1OGFhMzg3OTMwNzJkZDUyNy0xLjAuMA"
      }
      

    1. Click Play. The response will show the details of the archived property definition. You should see a similar response as shown in the following code-block.

      Response

      {
      "data": {
          "archivePropertyDefinition": {
              "propertyDefinition": {
                  "id": "cHJvcGRlZn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5ET0NTX1BST1BfREVGX0NPTExFQ1RJT05-cGFyYW1ldGVycy5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcjoxYmZmNjY4Yzk4YTk0MmM1OGFhMzg3OTMwNzJkZDUyNy0xLjAuMA",
                  "name": "Border Color 1707377111732",
                  "specification": "STRING",
                  "isHidden": false,
                  "isReadOnly": false,
                  "isArchived": true,
                  "description": "border color",
                  "propertyBehavior": "STANDARD",
                  "units": null
                  }
                }
             }
          }
      
      Show More

    Step 2 - Validate if the Property Definition is Archived

    To confirm whether a property has been successfully archived, you can fetch the details of the archived property definition by using the componentVersion query. Archiving a property definition is a permanent action and cannot be undone.

    Note: After archiving, it is not possible to edit the attributes or assign values to an archived property definition. You can still read the properties that are available in archived property definition. Archiving a property definition is a permanent action and cannot be undone.

    1. Enter the following query in the Query Pane of the Manufacturing Data Model Explorer.

      Query

      mutation ArchivePropertyDefinition($propertyDefinitionId: ID!) {
          archivePropertyDefinition(
              input: {propertyDefinitionId: $propertyDefinitionId}
          ) {
              propertyDefinition {
                  id
                  name
                  specification
                  isHidden
                  isReadOnly
                  isArchived
                  description
                  propertyBehavior
                  units {
                      id
                      name
                      }
                  }
                  }
              }
      
      Show More

    1. In the Query Variables Pane, enter the value of componentVersionId. To know how to obtain componentVersionId, refer to Retrieve Items. topic.

      Query Variables

      {
      "propertyDefinitionId": "cHJvcGRlZn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5URVNUX0NQX0RPQ35wYXJhbWV0ZXJzLkNmWG9hQzRLNTNTVHdiNlRuSXJYWFpUQUlFZGRHOUFyOmY4Mzg3MjNiOGQ1MjRjMmFhMzZkNjg3MzU5OWI0YjVhLTEuMC4w"
      }
      

    1. Click Play. The response will show the details of the archived property definition. After archiving a property the value of isArchived becomes true. You should see a similar response as shown in the following code-block.

      Response

      {
          "data": {
              "archivePropertyDefinition": {
                  "propertyDefinition": {
                      "id": "cHJvcGRlZn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5DZlhvYUM0SzUzU1R3YjZUbklyWFhaVEFJRWRkRzlBcn5URVNUX0NQX0RPQ35wYXJhbWV0ZXJzLkNmWG9hQzRLNTNTVHdiNlRuSXJYWFpUQUlFZGRHOUFyOmY4Mzg3MjNiOGQ1MjRjMmFhMzZkNjg3MzU5OWI0YjVhLTEuMC4w",
                      "name": "ERP ID",
                      "specification": "STRING",
                      "isHidden": false,
                      "isReadOnly": false,
                      "isArchived": true,
                      "description": "description",
                      "propertyBehavior": "TIMELESS",
                      "units": null
                  }
              }
          }
      }
      
      Show More