Template:— inventory_item (invntry_itm)
Context:— UK_Defence
Date: 2010/03/18 11:15:54
Revision: 1.13
Template: inventory_item

XML references to the Template

These can be cut and pasted into the XML as required.

inventory_item

Set up a hyperlink to the template definition.
<template_ref name="inventory_item" context="UK_Defence" />

Set up a table of the template parameters.
<template_table figure_id="?" instance="?" name="inventory_item" context="UK_Defence" >
  <param name="specification">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="related_inventory">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="holding_location">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="id">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="source_organization_id">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="max_stock_level">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="min_stock_level">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="stock_level_unit">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="stock_level_si_unit">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="domestic_management_code">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="management_control_indicator">
    <param_value></param_value>
    <description></description>
  </param>
</template_table>

Setup a template_example:
<template_example name="inventory_item">
  <param_in name="specification" value=""/>
  <param_in name="related_inventory" value=""/>
  <param_in name="holding_location" value=""/>
  <param_in name="id" value=""/>
  <param_in name="source_organization_id" value=""/>
  <param_in name="max_stock_level" value=""/>
  <param_in name="min_stock_level" value=""/>
  <param_in name="stock_level_unit" value=""/>
  <param_in name="stock_level_si_unit" value=""/>
  <param_in name="domestic_management_code" value=""/>
  <param_in name="management_control_indicator" value=""/>
</template_example>

inventory_item
/inventory_item(specification='', related_inventory='', holding_location='', id='', source_organization_id='', max_stock_level='', min_stock_level='', stock_level_unit='', stock_level_si_unit='', domestic_management_code='', management_control_indicator='')/

Path

-- create the inventory_item
%^inventory_item = Managed_resource%
^inventory_item.name = '/IGNORE'
^inventory_item.description = '/IGNORE'

-- Note the optional Managed_resource.quantity attribute is left unused
^inventory_item.item -> @specification

-- Inventory item id
/identifier(
    ID=@id,
    source_organization=@source_organization_id,
    type='Inventory_item_identification_code',
    items=^inventory_item)/

-- not explicitly required but may need to classify different Managed resource instances.
/assigning_reference_data(
    class_name='Inventory_item',
    ecl_id='urn:plcs:rdl:UK_Defence',
    items=^inventory_item)/

-- tjt to consider deleting this
-- assign the authorized_stock_levels
/assigning_resource_property(
    property_class_name='Authorized_stock_level',
    property_ecl_id='urn:plcs:rdl:UK_Defence',
    described_element=^inventory_item)/

-- Assign local reference parameter
%^min_max_stock_level = $assigning_resource_property.property%

-- Create the max and min stock level property Value and Unit
/resource_property_range(
    upper_limit=@max_stock_level,
    lower_limit=@min_stock_level,
    unit=@stock_level_unit,
    unit_ecl_id='urn:plcs:rdl:uk_defence',
    si_unit=@stock_level_si_unit,
    context='Numerical_representation_context',
    context_ecl_id='urn:plcs:rdl:std',
    property=^min_max_stock_level)/

-- domestic_management_code
/identifier(
    ID=@domestic_management_code,
    source_organization=@source_organization_id,
    type='Domestic_management_code',
    items=^inventory_item)/

-- Management_control_indicator
/identifier(
    ID=@management_control_indicator,
    source_organization=@source_organization_id,
    type='Management_control_indicator',
    items=^inventory_item)/

-- related_inventory
Managed_resource_relationship
Managed_resource_relationship.name = '/IGNORE'
Managed_resource_relationship.relating -> ^inventory_item
Managed_resource_relationship.related -> @related_inventory

-- holding_location
Product_based_location_identification
Product_based_location_identification.location_identification = '/IGNORE'
Product_based_location_identification.location_name = '/IGNORE'
Product_based_location_identification.referenced_product -> @holding_location
/location(
    ID='/Null',
    ID_source_organization='/Null',
    location_description='Inventory Item to Facility Relationship')/
%^locale = $location.location%
Location_assignment
Location_assignment.role = '/IGNORE'
Location_assignment.location_for_assignment -> ^locale
Location_assignment.entity_for_location -> ^inventory_item
^locale.alternative_location_representations -> Product_based_location_identification
The following entities are instantiated with attributes as specified:
Entity in path Value Inherited from
Managed_resource.name '/IGNORE'
Managed_resource.description '/IGNORE'
Managed_resource_relationship.name '/IGNORE'
Product_based_location_identification.location_identification '/IGNORE'
Product_based_location_identification.location_name '/IGNORE'
Location_assignment.role '/IGNORE'

XML representation of path

<refpath
   template="inventory_item">
   <comment>
      create the inventory_item
   </comment>
   <bind
      parameter="inventory_item">
      <express_entity
         entity="Managed_resource"
         context="UK_Defence">
         
      </express_entity>
   </bind>
   <assign
      assignment_type="equals"
      context="UK_Defence">
      <target>
         <bound_parameter
            name="inventory_item.name">
            
         </bound_parameter>
      </target>
      <source>
         <string
            value="'/IGNORE' ">
            
         </string>
      </source>
   </assign>
   <assign
      assignment_type="equals"
      context="UK_Defence">
      <target>
         <bound_parameter
            name="inventory_item.description">
            
         </bound_parameter>
      </target>
      <source>
         <string
            value="'/IGNORE' ">
            
         </string>
      </source>
   </assign>
   <comment>
      Note the optional Managed_resource.quantity attribute is left unused
   </comment>
   <assign
      assignment_type="points-to">
      <target>
         <bound_parameter
            name="inventory_item.item">
            
         </bound_parameter>
      </target>
      <source>
         <param_in_ref
            name="specification">
            
         </param_in_ref>
      </source>
   </assign>
   <comment>
      Inventory item id
   </comment>
   <call_template
      name="identifier"
      business_context="UK_Defence">
      <param_in
         name="ID"
         value="@id">
         
      </param_in>
      <param_in
         name="source_organization"
         value="@source_organization_id">
         
      </param_in>
      <param_in
         name="type"
         value="'Inventory_item_identification_code'">
         
      </param_in>
      <param_in
         name="items"
         value="^inventory_item">
         
      </param_in>
   </call_template>
   <comment>
      not explicitly required but may need to classify different Managed resource instances.
   </comment>
   <call_template
      name="assigning_reference_data"
      business_context="UK_Defence">
      <param_in
         name="class_name"
         value="'Inventory_item'">
         
      </param_in>
      <param_in
         name="ecl_id"
         value="'urn:plcs:rdl:UK_Defence'">
         
      </param_in>
      <param_in
         name="items"
         value="^inventory_item">
         
      </param_in>
   </call_template>
   <comment>
      tjt to consider deleting this
   </comment>
   <comment>
      assign the authorized_stock_levels
   </comment>
   <call_template
      name="assigning_resource_property"
      business_context="UK_Defence">
      <param_in
         name="property_class_name"
         value="'Authorized_stock_level'">
         
      </param_in>
      <param_in
         name="property_ecl_id"
         value="'urn:plcs:rdl:UK_Defence'">
         
      </param_in>
      <param_in
         name="described_element"
         value="^inventory_item">
         
      </param_in>
   </call_template>
   <comment>
      Assign local reference parameter
   </comment>
   <bind
      parameter="min_max_stock_level">
      <template_instance
         template="assigning_resource_property"
         parameter="property">
         
      </template_instance>
   </bind>
   <comment>
      Create the max and min stock level property Value and Unit
   </comment>
   <call_template
      name="resource_property_range"
      business_context="UK_Defence">
      <param_in
         name="upper_limit"
         value="@max_stock_level">
         
      </param_in>
      <param_in
         name="lower_limit"
         value="@min_stock_level">
         
      </param_in>
      <param_in
         name="unit"
         value="@stock_level_unit">
         
      </param_in>
      <param_in
         name="unit_ecl_id"
         value="'urn:plcs:rdl:uk_defence'">
         
      </param_in>
      <param_in
         name="si_unit"
         value="@stock_level_si_unit">
         
      </param_in>
      <param_in
         name="context"
         value="'Numerical_representation_context'">
         
      </param_in>
      <param_in
         name="context_ecl_id"
         value="'urn:plcs:rdl:std'">
         
      </param_in>
      <param_in
         name="property"
         value="^min_max_stock_level">
         
      </param_in>
   </call_template>
   <comment>
      domestic_management_code
   </comment>
   <call_template
      name="identifier"
      business_context="UK_Defence">
      <param_in
         name="ID"
         value="@domestic_management_code">
         
      </param_in>
      <param_in
         name="source_organization"
         value="@source_organization_id">
         
      </param_in>
      <param_in
         name="type"
         value="'Domestic_management_code'">
         
      </param_in>
      <param_in
         name="items"
         value="^inventory_item">
         
      </param_in>
   </call_template>
   <comment>
      Management_control_indicator
   </comment>
   <call_template
      name="identifier"
      business_context="UK_Defence">
      <param_in
         name="ID"
         value="@management_control_indicator">
         
      </param_in>
      <param_in
         name="source_organization"
         value="@source_organization_id">
         
      </param_in>
      <param_in
         name="type"
         value="'Management_control_indicator'">
         
      </param_in>
      <param_in
         name="items"
         value="^inventory_item">
         
      </param_in>
   </call_template>
   <comment>
      related_inventory
   </comment>
   <instantiate
      entity="Managed_resource_relationship"
      context="UK_Defence">
      
   </instantiate>
   <assign
      assignment_type="equals"
      context="UK_Defence">
      <target>
         <express_attribute
            entity="Managed_resource_relationship"
            attribute="name"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <string
            value="'/IGNORE' ">
            
         </string>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Managed_resource_relationship"
            attribute="relating"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <bound_parameter
            name="inventory_item">
            
         </bound_parameter>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Managed_resource_relationship"
            attribute="related"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="related_inventory">
            
         </param_in_ref>
      </source>
   </assign>
   <comment>
      holding_location
   </comment>
   <instantiate
      entity="Product_based_location_identification"
      context="UK_Defence">
      
   </instantiate>
   <assign
      assignment_type="equals"
      context="UK_Defence">
      <target>
         <express_attribute
            entity="Product_based_location_identification"
            attribute="location_identification"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <string
            value="'/IGNORE' ">
            
         </string>
      </source>
   </assign>
   <assign
      assignment_type="equals"
      context="UK_Defence">
      <target>
         <express_attribute
            entity="Product_based_location_identification"
            attribute="location_name"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <string
            value="'/IGNORE' ">
            
         </string>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Product_based_location_identification"
            attribute="referenced_product"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="holding_location">
            
         </param_in_ref>
      </source>
   </assign>
   <call_template
      name="location"
      business_context="UK_Defence">
      <param_in
         name="ID"
         value="'/Null'">
         
      </param_in>
      <param_in
         name="ID_source_organization"
         value="'/Null'">
         
      </param_in>
      <param_in
         name="location_description"
         value="'Inventory Item to Facility Relationship'">
         
      </param_in>
   </call_template>
   <bind
      parameter="locale">
      <template_instance
         template="location"
         parameter="location">
         
      </template_instance>
   </bind>
   <instantiate
      entity="Location_assignment"
      context="UK_Defence">
      
   </instantiate>
   <assign
      assignment_type="equals"
      context="UK_Defence">
      <target>
         <express_attribute
            entity="Location_assignment"
            attribute="role"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <string
            value=" '/IGNORE' ">
            
         </string>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Location_assignment"
            attribute="location_for_assignment"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <bound_parameter
            name="locale">
            
         </bound_parameter>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Location_assignment"
            attribute="entity_for_location"
            context="UK_Defence">
            
         </express_attribute>
      </target>
      <source>
         <bound_parameter
            name="inventory_item">
            
         </bound_parameter>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <bound_parameter
            name="locale.alternative_location_representations">
            
         </bound_parameter>
      </target>
      <source>
         <express_entity
            entity="Product_based_location_identification"
            context="UK_Defence">
            
         </express_entity>
      </source>
   </assign>
</refpath>

© UK MOD 2010 — All rights reserved