Grouping Assets by Location

Adding a Location

Locations associate an Asset with a ‘home’ that can help when governing sharing policies with OBAC and ABAC. Locations do not need pinpoint precision and can be named by site, building, or other logical grouping.

It may be useful to indicate an Asset’s origin. For example, if tracking traveling consultant’s Laptops, you may wish to associate them with a ‘home’ office.

Creating a Location

  1. Create your Location.

In the Dashboard, select Add Location in the Sidebar.

Adding a Location

The RKVST YAML runner is executed as a series of steps, each step representing a single operation with an action.

In order to create a Location, we use the action LOCATIONS_CREATE_IF_NOT_EXISTS.

---
steps:
  - step:
      action: LOCATIONS_CREATE_IF_NOT_EXISTS
  1. Add information about the Location you are creating.

The following screen will appear:

The Location Webform

You may add a description and a selector. The selector is the identifying attribute used to check if your location exists before attempting to create it. In this case, we use display_name which represents the name of the Location.

---
steps:
  - step:
      action: LOCATIONS_CREATE_IF_NOT_EXISTS
      description: Create UK factory location. 
    selector:
      - display_name
  1. Enter the required Location Name and Address, or in the case of the YAML Runner, Coordinates.
Adding the Location Details

Use latitude and longitude to describe the physical location.

---
steps:
  - step:
      action: LOCATIONS_CREATE_IF_NOT_EXISTS
      description: Create UK factory location. 
    selector:
      - display_name
    display_name: UK Factory
    description: Industrial Warehouse in Bristol Harbor
    latitude: 51.4477
    longitude: -2.5980
  1. There is an option to add Extended Attributes to a Location. This is useful to add metadata to a Location, i.e. a site contact’s number and email address.

Use the Extended Attributes Tab.

Adding Extended Attributes to a Location

Like Assets and Events, Locations may also have Extended Attributes added as key-value pairs.

---
steps:
  - step:
      action: LOCATIONS_CREATE_IF_NOT_EXISTS
      description: Create UK factory location. 
    selector:
      - display_name
    display_name: UK Factory
    description: Factory in Bristol Harbor
    latitude: 51.4477
    longitude: -2.5980
    attributes:
      address: Princes Wharf, Wapping Rd, Bristol BS1 4RN, UK
      Primary_Contact: Jill Tiller
      Primary_Mobile_Number: +447700900077
  1. Complete your Location.

Click Create Location.

Submitting a Location

Use the archivist_runner to run your YAML file!

$ archivist_runner \
      -u https://app.rkvst.io \
      --client-id <your-client-id> \
      --client-secret <your-client-secret> \
      UK_factory_location.yaml
  1. Navigate to Manage Locations in the Sidebar to see a list of existing Locations.

    Managing a Location

  2. You can inspect details of a single Location. Click the desired Location row.

    Viewing a Location

Assigning a Location to an Asset

Adding at Asset Creation

  1. To assign a pre-existing Location to an Asset during Asset creation, you need only select it.

Choose the desired Location from the Location drop-down.

Creating an Asset with an Existing Location

A pre-exisiting Location can be added during Asset creation, using the Location ID as an identifier (e.g. locations/<UUID>).

---
steps:
  - step:
      action: ASSETS_CREATE_IF_NOT_EXISTS
      description: Create an asset with pre-existing Location. 
      asset_label: My First Container 
    selector: 
      - attributes: 
        - arc_display_name
    behaviours: 
      - RecordEvidence
      - Attachments
    attributes: 
      arc_display_name: My First Container
      arc_display_type: Shipping Container
      arc_home_location_identity: <your-location-id>
    confirm: true

The YAML Runner also allows you to create new locations at Asset Creation.

---
steps:
  - step:
      action: ASSETS_CREATE_IF_NOT_EXISTS
      description: Create an asset.
      asset_label: My First Container 
    selector: 
      - attributes: 
        - arc_display_name
    behaviours: 
      - RecordEvidence
      - Attachments
    attributes: 
      arc_display_name: My First Container
      arc_display_type: Shipping Container
    location: 
      selector: 
        - display_name
      display_name: UK Factory
      description: Container Origin
      latitude: 52.2025
      longitude: 0.1311
      attributes: 
        action: LOCATIONS_CREATE_IF_NOT_EXISTS
        location_label: UK Factory
    confirm: true

Adding to a pre-existing Asset

  1. To assign a pre-existing asset with a new Location, you need to identify the Location Identity. To do this, view the Location details by clicking the Location row.
Location Identity
  1. Then create an Event for the Asset and specify the identity of the new Location as noted in step 1, against the arc_home_location_identity key.
Updating an Existing Asset with a new Location

For more information on creating Events, please visit Creating an Event Against an Asset.

Note - The EVENTS_CREATE action must contain at least one key-value pair for event_attributes.
---
steps:
  - step:
      action: EVENTS_CREATE
      description: Add Location to existing Asset.
      asset_label: <your-asset-id> 
    operation: Record
    behaviour: RecordEvidence
    event_attributes: 
      new_event: Record Asset Location
    asset_attributes:
      arc_home_location_identity: <your-location-id>
    confirm: true
Note - You need to include the full locations/<UUID> reference as using only the UUID will not be recognized.
  1. In the following screenshot, note the Location of our Asset has been updated.
Completed update of Asset Location

Edit this page on GitHub