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 ofpropertyName
andpropertyValue
pairs to define the set of model properties and their values for the route import. For example:
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:{ "propertyName": "routeName", "propertyValue": "routeNameValue" }, { "propertyName": "routeDescription", "propertyValue": "routeDescriptionValue" }
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 thesegmentDefinition
from a source to the target IDs:.propertypath
: the JSON path of the entity within thesegmentDefinition
. 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 thesourceName
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, thissegmentDefinition
must be created by an integrator. The purpose of theexportMetaData.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:
The above example identifies the first bill of materials array item for segment 0. The material id of the source is{ "propertyPath": "segments[0].billOfMaterials[0].materialId", "sourceValue": 43, "sourceName": "material1", "transformation": "targetValueLookup", "context": null }
43
, its name ismaterial1
and the transformation istargetValueLookup
. The import service will use a lookup from a service within the target system searching forname = material1
and finding the ID. The import service will then replace the value 43 insegments[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. TheconfigService
of the target is used to identify the target value to replace in the segment definition document. This is applicable to couchDB URL replacements.
- Most transformations are