Create a JSON Route Import Document

A JSON route import document consists of two parts:
  • exportMetaData: This is data specific to the definition of what is being imported and how the data maps between a source and the final Plant Application destination.  The meta data consists of two parts:
    • .modelProperties: A collection of propertyName and propertyValue pairs to define the set of model properties and their values for the route import. For example:
      {
              "propertyName": "routeName",
              "propertyValue": "routeNameValue"
            },
            {
              "propertyName": "routeDescription",
              "propertyValue": "routeDescriptionValue"
            }
      You must define the name/value pairs for setting a route name and route description. To successfully import a route, the following property names are supported:
      • routeName
      • routeDescription (optional)
      • producedMaterialName
      • bomFormulationName (optional)
      • status (draft, released, and archived are the only supported values)
      • revision
      • approvedBy (optional)
      • approvedOn (optional)
    • .sourceProperties: a collection of name-to-ID mappings required to update the segmentDefinition from a source to the target IDs:
      • .propertypath: the JSON path of the entity within the segmentDefinition.  Example: segments[0].billOfMaterials[0].materialId
      • .sourceValue: the value in the JSON that represents the entity in the path. Example: 43
      • .sourceName: the description name of the value. Example: material1
      • .transformation: how the transformation of the source to destination data is to be transformed.  Example: targetValueLookup is a supported value that indicates the target can be mapped using lookup.
      • .context: any contextual information to help identify a relationship where same names could be used. E.g., unit names can be duplicated on lines. If the sourceName is the unit name, more contextual information is required to determine the unit id, such as its parent with a name and an ID.
        {
                "propertyPath": "segments[2].plannedUnits[0].unitId",
                "sourceName": "AT_Welder5",
                "sourceValue": "2195",
                "transformation": "targetValueLookup",
                "context": {
                  "parentSourceName": "All Terrain Bikes",
                  "parentSourceValue": 1
                }
              }
  • .segmentDefinition: the raw segment definition document of a route created by Plant Applications. If importing a route from a source other than Plant Applications, this segmentDefinition must be created by an integrator. The purpose of the exportMetaData.sourceProperties is to provide the context of IDs within the segment definition document of the source, into names and then provide a transformation identification of those IDs into the IDs of the target system and create a segment definition document for the target system. For example:
     {
            "propertyPath": "segments[0].billOfMaterials[0].materialId",
            "sourceValue": 43,
            "sourceName": "material1",
            "transformation": "targetValueLookup",
            "context": null
          }
    The above example identifies the first bill of materials array item for segment 0. The material id of the source is 43, its name is material1 and the transformation is targetValueLookup. The import service will use a lookup from a service within the target system searching for name = material1 and finding the ID. The import service will then replace the value 43 in segments[0].billOfMaterials[0].materialId to create the segment definition document for the target.
    Note:
    • Most transformations are targetValueLookup, which identifies the need to use a lookup to obtain a target value.
    • Configservice is another supported transformation value. The configService of the target is used to identify the target value to replace in the segment definition document. This is applicable to couchDB URL replacements.