Skip to main content

EXAMPLE (WOOD_SMALL.JSON)

Let’s say that we have a tiny factory structure that we want to import. One factory, with one line beneath it. Factory objects resides in the “locations” domain.

AVIX understands location types “factory”, “building”, “line”, “workStation”, “humanResource” and “machineResource”

The reader is advised to look at the example files while reading the documentation.

JSON

The JSON message contains a root JSON object with some important fields.

 

“header”

A “header” object

{
   "header": {
      "version": 1,
      "defaultMsl": "sv"
   },

“version” is the version of the import format. The format version described in this document is “1”
“default-msl” is the default “Most significant language” to use. This is only used when importing i18n strings and is optional.

“domains”

The “domains” object contains information for the different domains. See domains sections for more detailed information.

Each domain (like “locations”) contains two lists, “topLevel” and “objects”

"domains": {
	"locations": {
		"topLevel": [
			{
				"operation": "sync",
				"type": "root",
				"refList": [
					"oid-m-1"
				]
			}
		],
		"objects": [
			{
				"type": "factory",
				"id": "oid-m-1",
				"originId": "GT-0001",
				"originSource": "EXCEL",
				"attributes": {
					"name": "Green tech",
					"abbreviation": "0001"
				},
				"children": [
					{
						"operation": "sync",
						"type": "childLocations",
						"list": [
							{
								"id": "oid-mr-1",
								"originId": "ac12c9b21a9ca615bcbacdde128940d3",
								"originSource": "EXCEL",
								"refId": "oid3981"
							}
						]
					}
				]
			},

“topLevel”

A list of JSON objects that describes update operations.

"topLevel": [
	{
		"operation": "sync",
		"type": "root",
		"refList": [
			"oid-m-1"
		]
	}
],

“operation”

The update operation type that should be used for this list. “sync”, “add” or “remove”

“type”

The type (name) of the list

“refList”

A list of references to PLM objects in the import message. This is the top level objects that should be imported. The start of traversal.

“objects”

A list of JSON objects that describes PLM objects

"objects": [
	{
		"type": "factory",
		"id": "oid-m-1",
		"originId": "GT-0001",
		"originSource": "EXCEL",
		"attributes": {
  			"name": "Green tech",
			"abbreviation": "0001"
		},
		"children": [
			{
			"operation": "sync",
			"type": "childLocations",
			"list": [
				{
					"id": "oid-mr-1",
					"originId": "ac12c9b21a9ca615bcbacdde128940d3",
					"originSource": "EXCEL",
					"refId": "oid3981"
				}
			]
		}
	]
},

"type"

The neutral type of the PLM object.

"id"

The id of the PLM object. This id should be unique in the scope of the import message. This id is not used to match PLM objects from the source and target systems. It is “only” used to consistently describe the network of information in the import message

"originId"

The id of this object in the source system. This id is the default way of matching PLM objects from the source and target systems. AVIX will (try) to persist this id on the target side so that the PLM objects can be matched in the future.

“keyType”

The key type for how the matching between source and target PLM objects should be done for this object. The key type framework can be extended through code, but the standard types are “origin” and “number”. The actual attribute on the target system that will be used to match can vary depending on type, but in most cases, it will be the “abbreviation” attribute. The default “keyType” is origin.

“attributes”

JSON object that describes the attributes that should be updated. What attributes that exists on the target PLM object depends on the type of PLM object. Examples are “name”, “abbreviation”, “time”.

"attributes": {
	"name": "Green tech",
	"abbreviation": "0001"
}

 

“children”

A list of JSON objects that describes update operations for (PLM) child relations between the current PLM object and other PLM objects. Lists of (PLM) child relations can be updated using the three different types of operations “sync”, “add”, “remove”.

"children": [
	{
		"operation": "sync",
		"type": "childLocations",
		"list": [
			{
				"id": "oid-mr-1",
				"originId": "ac12c9b21a9ca615bcbacdde128940d3",
				"originSource":"EXCEL",
				"refId":"oid3981"
			}
		]
	}
]

"type"

The neutral type of the (PLM) child relation.

list”

A list of JSON objects that describes (PLM) relation objects.

“id”

The id of the (PLM) relation object
See above for PLM objects

"originId"

See above for PLM objects

refId”

A reference to the child PLM object in the import message.