Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A data domain (domain) can cross-reference another in its definition creating a relationship between two or more domains. In the following diagram, the "Student" domain student domain makes a cross-reference to the "Country" domain country domain:

When a "student" master data record (MDR) student MDR is POSTed, the request body would include a reference to a specific "country" master  master data record:

Code Block
{
	"studentID": "XYZ-123",
	"name": "Juana Masa",
	"homeCountry": "/mdr/country:1/MEX",
	"birthday": "946684800"
}


When the "Student" student MDR is referenced (i.e. GET)  the response will insert the appropriate "Country" information country information:

Code Block
{
	"studentID": "XYZ-123",
	"name": "Juana Masa",
	"homeCountry": {
		"name": "Mexico",
		"abbreviation": "MEX",
		"capitalCity": "Mexico City"
	},
	"birthday": "946684800"
}

...

The cross-reference can be to an entire master data record (e.g. all of the properties for Mexico in  in the MDR):

    "homeCountry": "/mdr/country:1/MEX",

...

To reference another domain, include the cross-reference property definitions "type": "uri",   "uriType": "xref"  and   and "xrefLocation". The "xrefLocation" is the UUID or MDR  is the  MDR path to another  reference master data record  MDR or even a property of the master data recordanother MDR.  

Code Block
languagejs
{
	"name": <reference-name>,
	"modelSchema": {
		"properties": {
			"<property1>": {
				"type": "uri",
				"uriType": "xref",
				"xrefLocation": "<path (or UUID) of a domain or domain property>",
				""
				...other item1 properties....
			},
			"<property2>": {
				 ... 
			}
		}
	}
}

...

When defining a reference, the " domain" path  path to the reference is used.  When POSTing data for the reference the "/mdr" MDR path is used. Some examples will help clarify:

...

When POSTing the reference, the "xrefLocation" entry  entry in the modelSchema model schema for referencing a complete master data record MDR would be:

   "xrefLocation": "/reference/{domain-name}[:version]"

...

When POSTing the data for the reference use the "displayName" of  of the desired master record MDR e.g.:

Code Block
"homeCountry": "/mdr/country:1/MEX"

...

When POSTing the reference, the "xrefLocation" entry  entry in the modelSchema model schema for referencing a property of a master data record MDR would be:

    "xrefLocation": "/reference/{domain-name}[:version][/property]"
e.g.

...