Writing data to host material attributes

In MI Materials Gateway for Windchill, you can write data from Granta MI attributes to the Windchill data object that is created when a material is assigned, using host material attribute mapping.

Note: Materials data will only be added when the Windchill data object is first created, and will only be updated subsequently if the material is version controlled in Granta MI, and the assignment is updated via MI Materials Gateway.

If you have enabled assignment of processes, surface treatments, or colors in Windchill, you can configure data to be written on these assignments in the same way.

To configure MI Materials Gateway to use host material attribute mapping:
  1. Open gateway.config in a text editor.
  2. Locate the <HostConfiguration> option you would like to enable:
    There is a host configuration option for each type of assignment:
    • MaterialRecordMappingDef for material assignments
    • ProcessRecordMappingDef for process assignments
    • SurfaceTreatmentRecordMappingDef for surface treatment assignments
    • ColorRecordMappingDef for color assignments
    For each type of assignment, you can specify any number of mappings. For example, the configuration below specifies one mapping each for material, process, and surface treatment assignments, and two mappings for color assignments.
    <Host a:host="MIMaterialsGateway_Windchill"> 
        <HostOption a:name="MaterialRecordMappingDef">GRANTA_MATERIAL_SUPPLIER:Supplier
        = {Supplier}</HostOption> 
        <HostOption a:name="ProcessRecordMappingDef">GRANTA_PROCESS_TEMPERATURE:Temperature
        = {Temperature}</HostOption> 
        <HostOption a:name="SurfaceTreatmentRecordMappingDef">GRANTA_DESCRIPTION:
        {Description}</HostOption> 
        <HostOption a:name="ColorRecordMappingDef">GRANTA_COLOR_PROP1:Color 
        from Granta MI</HostOption>
        <HostOption a:name="ColorRecordMappingDef">GRANTA_COLOR_PROP2:Written by 
        MI Materials Gateway</HostOption> 
        </Host> 
    
    Each mapping consists of two parts:
    • The name of an attribute on the Windchill data object.
    • A formatted string that specifies the data that will be written to that Windchill attribute. This can include any combination of fixed strings and Granta standard names that identify a Granta MI attribute on the record being assigned, using the following syntax:
      • FixedString1 to specify a fixed string of text
      • {StandardNameA} to specify the value of the Granta MI attribute identified by StandardNameA
      • FixedString1{StandardNameA}FixedString2{StandardNameB} to specify a combination of fixed strings and attribute values
    For example, the first mapping in the example above:
    <HostOption a:name="MaterialRecordMappingDef">GRANTA_MATERIAL_SUPPLIER:Supplier = {Supplier}</HostOption>

    specifies that when a material is assigned to a part, the attribute GRANTA_MATERIAL_SUPPLIER on the Windchill material object will be given a value consisting of the fixed string ‘Supplier = ‘ followed by the value of an attribute on the Granta MI material record that has the standard name Supplier.

    A Windchill attribute (of type String) with the name specified must already exist in Windchill, and must be configured on the relevant Windchill data object type.

    Note: The Windchill attribute must be modifiable. You cannot use host material attribute mapping to write to a non-modifiable attribute.

    Any Granta MI attributes that are used in the mapping must be identified by a standard name in Granta MI. You can use MI Admin to define standard names for MI attributes, as described in Configuring standard names.

    The following Granta MI attribute data types are supported: Integer, Point, Range, Short Text, Long Text, Single-Valued Discrete, Multi-Valued Discrete, Hyperlink, Date, Logical. In all cases, the attribute value is written to the Windchill data object as a text attribute (with type String).