Interface ObjectMetadataInterface

The ObjectMetadataInterface tells about the metadata documents linked to a part instance and its genealogy or children.

The ObjectMetadataInterface is included in the PartInstanceInfoInterface or ChildrenPartInstanceInfoInterface, which is retrieved by an IdCardGetterInterface or ChildrenIdCardGetterInterface.

The ObjectMetadataInterface shows the metadata documents attached to a part instance.

Such metadata documents may be :

  • A part metadata document : this document is shared among all the instances of the same part (a bolt for example).
  • A link metadata document : when defining a child of a part instance, a metadata document may be set to define the link between the two part instances. The child part instance includes the link metadata document (as such, the root part instance of the DMU cannot have a link metadata document and thus its link metadata document is empty).
  • An instance metadata document : the given part instance may have specific information attached to it (not shared by all the instances of the same part, as a serial number for example).

All these documents follow the same pattern :

  • A string document id, which is a unique string inside the DMU that identifies the document.
  • The actual metadata object.

Please remember that metadata documents cannot be queried by their string id but by their integer ids (see Search).

The link metadata document also features specific information (the "effectivity" property) that are used for the configurations (ConfContextInterface, Main concepts) of the DMU. A configuration is a set of included or excluded effectivities. Any link that satisfies the requirements in term of effectivities is included in the configuration, meaning the child part instance of the link will be available in the given configuration. If not, the given child part instance will not be included. Any link metadata document may thus have an effectivity property.

The ObjectMetadataInterface is organized by document types (part metadata documents, link metadata documents, part instance metadata documents).

There is a unique instantiation chain of part instances, starting from the root part instance to a specific part instance (this is the definition of a part instance). The ObjectMetadataInterface may include the documents of such a chain if included in a PartInstanceInfoInterface, if included in a ChildrenPartInstanceInfoInterface, then the documents are the one of the children of the requested part instance. The retrieveIdCard and retrieveChildrenIdCard will return the same number of PartInstanceInfoInterface than the number of part instances that were queried.

A chain, or children are exposed by the ObjectMetadataInterface as arrays. All the arrays have the same size, the size of the chain of the part instances, or the number of children of a part instance. In the case of a chain, the first item in the chain is the root part instance, the last item is the part instance that was queried by retrieveIdCard. In the case of a children list, the order is irrelevant.

Warning : the metadata documents content may change depending on the given configuration, as such, some fields may appear or not depending on the chosen configuration.

The ObjectMetadataInterface also shows if a part instance in the chain or children has any attached document (see DocumentContentGetterInterface and AttachedDocumentInfoInterface) attached to it. A boolean array (size fo the instantiation chain, number of children) exposes this property.

Here is an example of an ObjectMetadataInterface :

{
"partmd": [{
"id": "469ce189fc6c4c70a8a1d32dda2b8005",
"metadata": {
"Input Format and Emitter": "CATIA V5R19 SP0 HF0",
"Name": "Main car",
"Original Name": "Main car",
"OriginalUnits": {
"Original length unit (m)": 0.0010000000000000002,
"Original mass unit (kg)": 1,
"Original time unit (s)": 1
}
}
}, {
"id": "c12cd6c431ef415597d8c13df06bcaf9",
"metadata": {
"Input Format and Emitter": "CATIA V5R19 SP0 HF0",
"Name": "REMONTAGE-VITRAGE",
"Original Name": "REMONTAGE-VITRAGE",
"OriginalUnits": {
"Original length unit (m)": 0.0010000000000000002,
"Original mass unit (kg)": 1,
"Original time unit (s)": 1
},
"PartNumber": "REMONTAGE-VITRAGE",
"subsystem": "5200-Vitrages",
"system": "5000-Exter"
},
}, {
"id": "cd303e312a0641a4b9f84ba496cf2ae5",
"metadata": {
"Design Name": "3507-5219-A02-Plexi-zone-AV-CBI-080113",
"Design Status": "Published",
"Input Format and Emitter": "CATIA V5R19 SP0 HF0",
"Issue": "A",
"Last update": "06/12/2012",
"Name": "3507-5219-A02-Plexi_zone_AV-CBI-080113",
"Original Name": "3507-5219-A02-Plexi_zone_AV-CBI-080113",
"OriginalUnits": {
"Original length unit (m)": 0.0010000000000000002,
"Original mass unit (kg)": 1,
"Original time unit (s)": 1
},
"PartNumber": "3507-5219-A02-Plexi_zone_AV-CBI-080113",
"subsystem": "5200-Vitrages",
"system": "5000-Exter"
}
}
],
"linkmd": [{}, {
"id": "linkmd_withoutconf_46",
"metadata": {
"branch": "test"
}
}, {}
],
"instancemd": [{}, {}, {}
],
"hasattacheddocuments": [false, false, false]
}

The ObjectMetadataInterface may be queried by the following code :
/** 
* Sample to illustrate the use of an IdCardGetterInterface with the parsing of
* PartInstanceInfoInterface to display some information about a part instance.
*/
import {
VisibilityContextInterface, IdCardGetterInterface, IdCardGetterInterfaceSignal,
InfiniteEvent, PartInstanceInfoInterface, PartInstanceInfoStatusFlag, DataSessionInterface,
} from 'generated/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// created previously
let lVisibilityContext : VisibilityContextInterface;
// the `part instance id` to get
let lPartInstanceId : number;
// what to do when we have retrieved id card information ?
let onIdCardReady : (_pEvent: InfiniteEvent, _pCallbackData: Object | undefined) => void;

// create an idCardGetter
const lIdCardGetterInterface : IdCardGetterInterface = lDataSession.createIdCardGetter();
// what to do when result is ready ?
lIdCardGetterInterface.addEventListener(IdCardGetterInterfaceSignal.IdCardReady, onIdCardReady);

// onIdCardReady will be called when data is available
onIdCardReady = (_pEvent: InfiniteEvent, _pCallbackData: Object | undefined) : void =>
{
if (lIdCardGetterInterface.getLastError().length !== 0) {
// do nothing in case of error
// perhaps some GUI code ?
}
const lPartInstanceInfos : Array<PartInstanceInfoInterface> | undefined = lIdCardGetterInterface.getPartInstanceInfos();
if (!lPartInstanceInfos || lPartInstanceInfos.length !== 1)
{
// no data (isCancelled ?)
return;
}
// we required only one `part instance`, as such, only one result should be retrieved
// iterate over the instantiation chain, but take the first chain since one `part instance` retrieved
const lCurrentChain : PartInstanceInfoInterface = lPartInstanceInfos[0];

// number of items
const lNbAncestors : number = lCurrentChain.getAncestors().length;
const lOffsetToPartInstance : number = lNbAncestors - 1;
// we get the `part` metadata of the given `part instance` (and not their parents - grand parents) => lNbAncestors-1
const lPartMetadata : Object = lCurrentChain.getIdCardHierarchy().partmd[lOffsetToPartInstance];
// some fancy output
console.log(JSON.stringify(lPartMetadata));

// get the flags in order to get information about the `part instance`
const lFlags : number = lCurrentChain.getAncestorsStatusFlags()[lOffsetToPartInstance];
if ((lFlags & PartInstanceInfoStatusFlag.PI_Displayable) !== 0)
{
console.log('this part instance is displayable')
}
}

// trigger the retrieval
lIdCardGetterInterface.retrieveIdCard(lPartInstanceId, lVisibilityContext);

or :
/** 
* Sample to illustrate the use of an ChildrenIdCardGetterInterface with the parsing of
* PartInstanceInfoInterface to display some information about a part instance.
*/
import {
VisibilityContextInterface, ChildrenIdCardGetterInterface, ChildrenIdCardGetterInterfaceSignal,
InfiniteEvent, ChildrenPartInstanceInfoInterface, PartInstanceInfoStatusFlag, DataSessionInterface
} from 'generated/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// created previously
let lVisibilityContext : VisibilityContextInterface;
// the `part instance id` to get
let lPartInstanceId : number;
// what to do when we have retrieved id card information ?
let onChildrenIdCardReady : (_pEvent: InfiniteEvent, _pCallbackData: Object | undefined) => void;

// create an ChildrenIdCardGetter
const lChildrenIdCardGetterInterface : ChildrenIdCardGetterInterface = lDataSession.createChildrenIdCardGetter();
// what to do when result is ready ?
lChildrenIdCardGetterInterface.addEventListener(ChildrenIdCardGetterInterfaceSignal.ChildrenIdCardReady, onChildrenIdCardReady);

// onChildrenIdCardReady will be called when data is available
onChildrenIdCardReady = (_pEvent: InfiniteEvent, _pCallbackData: Object | undefined) : void =>
{
if (lChildrenIdCardGetterInterface.getLastError().length !== 0) {
// do nothing in case of error
// perhaps some GUI code ?
}
const lPartInstanceInfos : Array<ChildrenPartInstanceInfoInterface> | undefined = lChildrenIdCardGetterInterface.getPartInstanceInfos();
if (!lPartInstanceInfos || lPartInstanceInfos.length !== 1)
{
// no data (isCancelled ?)
return;
}
// we required only one `part instance`, as such, only one result should be retrieved
// iterate over the instantiation chain, but take the first chain since one `part instance` retrieved
const lCurrentChildren : ChildrenPartInstanceInfoInterface = lPartInstanceInfos[0];

// number of items
const lNbChildren : number = lCurrentChildren.getChildren().length;
if (lNbChildren <= 0)
{
console.log('this part instance is a leaf');
return;
}
// take the last child
const lChildInstanceOffset : number = lNbChildren - 1;
// we get the `part` metadata of the last child of the `part instance`
const lPartMetadata : Object = lCurrentChildren.getChildrenIdCard().partmd[lChildInstanceOffset];
// some fancy output
console.log(JSON.stringify(lPartMetadata));

// get the flags in order to get information about the `part instance`
const lFlags : number = lCurrentChildren.getChildrenStatusFlags()[lChildInstanceOffset];
if ((lFlags & PartInstanceInfoStatusFlag.PI_Displayable) !== 0)
{
console.log('the last child of the part instance is displayable')
}
}

// trigger the retrieval
lChildrenIdCardGetterInterface.retrieveChildrenIdCard(lPartInstanceId, lVisibilityContext);

With async calls :
/** 
* Sample to illustrate the asynchronous use of an IdCardGetterInterface with the parsing of
* PartInstanceInfoInterface to display some information about a part instance.
*/
import {
VisibilityContextInterface, IdCardGetterInterface, AsyncPartInstanceInfoResult,
AsyncResultReason, PartInstanceInfoInterface, PartInstanceInfoStatusFlag, DataSessionInterface
} from 'generated/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// created previously
let lVisibilityContext : VisibilityContextInterface;
// the `part instance id` to get
let lPartInstanceId : number;
// what to do when we have retrieved id card information ?

// create an idCardGetter
const lIdCardGetterInterface : IdCardGetterInterface = lDataSession.createIdCardGetter();

const fetchIdCard = async () : Promise<any> =>
{
// trigger the retrieval
const lResult : AsyncPartInstanceInfoResult = await lIdCardGetterInterface.asyncRetrieveIdCard(lPartInstanceId, lVisibilityContext);
if (lResult.reason !== AsyncResultReason.ARR_Success) {
// do nothing in case of error
// perhaps some GUI code ?
}

const lPartInstanceInfos : Array<PartInstanceInfoInterface> | undefined = lIdCardGetterInterface.getPartInstanceInfos();
console.assert(lPartInstanceInfos === lResult.value);
if (!lPartInstanceInfos || lPartInstanceInfos.length !== 1)
{
// no data (isCancelled ?)
return;
}
// we required only one `part instance`, as such, only one result should be retrieved
// iterate over the instantiation chain, but take the first chain since one `part instance` retrieved
const lCurrentChain : PartInstanceInfoInterface = lPartInstanceInfos[0];

// number of items
const lNbAncestors : number = lCurrentChain.getAncestors().length;
const lOffsetToPartInstance : number = lNbAncestors - 1;
// we get the `part` metadata of the given `part instance` (and not their parents - grand parents) => lNbAncestors-1
const lPartMetadata : Object = lCurrentChain.getIdCardHierarchy().partmd[lOffsetToPartInstance];
// some fancy output
console.log(JSON.stringify(lPartMetadata));

// get the flags in order to get information about the `part instance`
const lFlags : number = lCurrentChain.getAncestorsStatusFlags()[lOffsetToPartInstance];
if ((lFlags & PartInstanceInfoStatusFlag.PI_Displayable) !== 0)
{
console.log('this part instance is displayable')
}
}

fetchIdCard();

or :
/** 
* Sample to illustrate the asynchronous use of an ChildrenIdCardGetterInterface with the parsing of
* PartInstanceInfoInterface to display some information about a part instance.
*/
import {
VisibilityContextInterface, ChildrenIdCardGetterInterface, AsyncChildrenPartInstanceInfoResult,
ChildrenPartInstanceInfoInterface, PartInstanceInfoStatusFlag, AsyncResultReason, DataSessionInterface
} from 'generated/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// created previously
let lVisibilityContext : VisibilityContextInterface;
// the `part instance id` to get
let lPartInstanceId : number;

// create an ChildrenIdCardGetter
const lChildrenIdCardGetterInterface : ChildrenIdCardGetterInterface = lDataSession.createChildrenIdCardGetter();

const retrieveIdCard = async () : Promise<any> =>
{
// trigger the retrieval
const lResult : AsyncChildrenPartInstanceInfoResult = await lChildrenIdCardGetterInterface.asyncRetrieveChildrenIdCard(lPartInstanceId, lVisibilityContext);

if (lResult.reason !== AsyncResultReason.ARR_Success || lResult.value === undefined)
{
// do nothing in case of error
// perhaps some GUI code ?
return;
}
const lPartInstanceInfos : Array<ChildrenPartInstanceInfoInterface> = lResult.value;
// we required only one `part instance`, as such, only one result should be retrieved
// iterate over the instantiation chain, but take the first chain since one `part instance` retrieved
const lCurrentChildren : ChildrenPartInstanceInfoInterface = lPartInstanceInfos[0];

// number of items
const lNbChildren : number = lCurrentChildren.getChildren().length;
if (lNbChildren <= 0)
{
console.log('this part instance is a leaf');
return;
}
// take the last child
const lChildInstanceOffset : number = lNbChildren - 1;
// we get the `part` metadata of the last child of the `part instance`
const lPartMetadata : Object = lCurrentChildren.getChildrenIdCard().partmd[lChildInstanceOffset];
// some fancy output
console.log(JSON.stringify(lPartMetadata));

// get the flags in order to get information about the `part instance`
const lFlags : number = lCurrentChildren.getChildrenStatusFlags()[lChildInstanceOffset];
if ((lFlags & PartInstanceInfoStatusFlag.PI_Displayable) !== 0)
{
console.log('the last child of the part instance is displayable')
}
}

retrieveIdCard();

The ObjectMetadataInterface contains fields that are included in the [AttributesDictionaryInterface](AttributesDictionaryInterface.html). Just look for the given attribute in the [AttributesDictionaryInterface](AttributesDictionaryInterface.html).

Any field may have the given type, an array of the given type or null (depending on getAttributeType). Any field may have not be included in the AttributesDictionaryInterface, in this case, such metadata cannot be filtered, since it cannot be indexed. Such data that cannot be indexed can be found in the nonindexedpartmd, nonindexedlinkmd or nonindexedinstancemd fields.

Consider now the following example :

Dictionary :

[{
"attributeName": "Name",
"nestedPath": "",
"attributeType": "string",
"numericType": "invalid",
"min": null,
"max": null
}, {
"attributeName": "PartNumber",
"nestedPath": "",
"attributeType": "string",
"numericType": "invalid",
"min": null,
"max": null
}, {
"attributeName": "test_display_idcard.arrays.bool",
"nestedPath": "",
"attributeType": "boolean",
"numericType": "invalid",
"min": null,
"max": null
}, {
"attributeName": "test_display_idcard.arrays.date",
"nestedPath": "",
"attributeType": "date",
"numericType": "invalid",
"min": 1525435633000,
"max": 1528114033000
}, {
"attributeName": "test_display_idcard.arrays.date_range",
"nestedPath": "",
"attributeType": "date range",
"numericType": "invalid",
"min": null,
"max": null
}, {
"attributeName": "test_display_idcard.nested.int",
"nestedPath": "test_display_idcard.nested",
"attributeType": "number",
"numericType": "int32",
"min": 1,
"max": 2
}, {
"attributeName": "test_display_idcard.scalars.double",
"nestedPath": "",
"attributeType": "number",
"numericType": "float64",
"min": 1,
"max": 2
}, {
"attributeName": "test_display_idcard.scalars.double_range",
"nestedPath": "",
"attributeType": "number range",
"numericType": "float64",
"min": null,
"max": null
}
]

ObjectMetadataInterface :
{
// metadata from component part metadata, this metadata will be shared by all instances of this component
"partmd": [{
// the actual metadata
"metadata": {
// "attributeName": "Name" is a string or a string array or null (see dictionary)
"Name": "Sample",
// "attributeName": "PartNumber" is a string or a string array or null (see dictionary)
"PartNumber": "DMU_sample",
// no attribute "test_display_idcard" since it only contains sub-objects
"test_display_idcard": {
// no attribute "test_display_idcard.arrays" since it only contains sub-objects
"arrays": {
// "attributeName": "test_display_idcard.arrays.bool" is a bool or an array of bool or null (see dictionary)
"bool": [true, false],
// "attributeName": "test_display_idcard.arrays.date" is a date or an array of date or null (see dictionary), dates are expressed as number of milliseconds since January 1, 1970, 00:00:00 UTC.
"date": [1528114033000, 1525435633000],
// "attributeName": "test_display_idcard.arrays.date" is a date range or an array of date range or null (see dictionary), dates are expressed as number of milliseconds since January 1, 1970, 00:00:00 UTC.
// here gte stands for greater than or equal
// gt stands for strictly greater than
// lte stands for lower than or equal
// lt stands for strictly lower than
// when retrieving range metadata types, they should always contain at least gt, gte, lte and/or lt.
// any range without any of these values is considered invalid.
// if the data in "gte" for example is not a number, then the field is not indexed and
// "test_display_idcard.arrays.date_range.gte would be be included in ObjectMetadataInterface.nonindexedpartmd or ObjectMetadataInterface.nonindexedlinkmd
// or ObjectMetadataInterface.nonindexedinstancemd.
"date_range": [{
"gte": 1530706033000,
"lte": 1530792433000
}, {
"gte": 1533384433000,
"lte": 1533470833000
}
]
},
// no attribute "test_display_idcard.nested" since it is an array of object
"nested": [{
// "attributeName": "test_display_idcard.nested.int" is a 32 bit integer or an array of integers or null
// it is a nested metadata (inside an array of object, whose top node is "test_display_idcard.nested"
// its nested path is therefore "test_display_idcard.nested" (see dictionary)
"int": 1
}, {
// "attributeName": "test_display_idcard.nested.int" is a 32 bit integer or an array of integers or null
// it is a nested metadata (inside an array of object, whose top node is "test_display_idcard.nested"
// its nested path is therefore "test_display_idcard.nested" (see dictionary)
"int": 2
}
],
// no attribute "test_display_idcard.scalars" since it only contains sub-objects
"scalars": {
// "attributeName": "test_display_idcard.scalars.double" is a 64 bit float or an array of double or null (see dictionary)
"double": 1.234,
// "attributeName": "test_display_idcard.scalars.double_range" is a double range or an array of double range or null (see dictionary).
// here gte stands for greater than or equal
// gt stands for strictly greater than
// lte stands for lower than or equal
// lt stands for strictly lower than
// when retrieving range metadata types, they always contain at least gt, gte, lte and/or lt.
"double_range": {
"gte": 10,
"lt": 12
},
// "attributeName": "test_display_idcard.scalars.hugetext" should be included in the dictionary
// but when looking for it, no value can be found for "test_display_idcard.scalars.hugetext"
// in this example, for readability, hugetext has been stripped but it actually contains
// the full lorem ipsum, exceeding the indexing capability of the 3djuump architecture
// as no other hugetext values are set, only one value could have been indexed, but failed to do so
// the "test_display_idcard.scalars.hugetext" has therefore no indexed value, and then is not available in the dictionary
// "test_display_idcard.scalars.hugetext will be included in ObjectMetadataInterface.nonindexedpartmd or ObjectMetadataInterface.nonindexedlinkmd
// or ObjectMetadataInterface.nonindexedinstancemd.
//
"hugetext": "Lorem ipsum ...",
// "attributeName": "test_display_idcard.scalars.null" should be included in the dictionary
// but when looking for it, no value can be found for "test_display_idcard.scalars.null"
// "test_display_idcard.scalars.null" always contain null, the "test_display_idcard.scalars.null" has
// therefore no indexed value, and then is not available in the dictionary
// "test_display_idcard.scalars.null will be included in ObjectMetadataInterface.nonindexedpartmd or ObjectMetadataInterface.nonindexedlinkmd
// or ObjectMetadataInterface.nonindexedinstancemd.
"null": null
}
}
},
// internal id of the document, as declared by your DMU provider
"id": "partmd_sample"
}
],
// link metadata documents from parents to children, here we display the root node, we have am empty link
// metadata document for the root
"linkmd": [{}],
// no instance metadata document (specific for this instance, not shared among instances)
"instancemd": [{}],
// do we have annotations
"hasannotations": [false],
// do we have attached documents ?
"hasattacheddocuments": [false]
}

Please refer to [PartInstanceInfoInterface](PartInstanceInfoInterface.html) and [ChildrenPartInstanceInfoInterface](ChildrenPartInstanceInfoInterface.html) to get more information about metadata requests.
Data Retrievers

See

Hierarchy

  • ObjectMetadataInterface

Properties

hasannotations: boolean[]

Tells if the part instance has annotations attached to it.

hasattacheddocuments: boolean[]

Each part instance may have specific documents attached to it.

This is a list that tells if any part instance in the part instance genealogy / children has documents.

See

IdCardGetterInterface

instancemd: ({} | {
    id: string;
    metadata?: Object;
})[]

Each part instance may have specific metadata attached to it with a specific document.

This is a list of all the instance metadata documents of the part instance and its genealogy, or the list of instance metadata documents of the children of this part instance.

The document may be empty, meaning no information is available for the specific ancestor (or current part instance), or specific child.

  • "id" is the name of the instance metadata document (unique across the DMU).
  • "metadata" is the optional instance metadata of this specific part instance.
linkmd: ({} | {
    effectivity?: Object;
    id: string;
    metadata?: Object;
})[]

Each child of an instance is linked to its parent with an optional link metadata document.

This is a list of all the link metadata documents of the part instance and its genealogy, or the list of link metadata documents of the children of this part instance.

If defined, the link document is retrieved and included in the definition of the child.

The document may be empty, meaning no information is available for the specific ancestor (or current part instance), or specific child.

  • "id" is the name of the link metadata document (unique across the DMU).
  • "metadata" is the optional metadata included in the link between the part instance (parent or current part instance).
  • "effectivity" is the optional effectivity (configuration information) included in the part instance (parent or current part instance, or child depending on the call).
nonindexedinstancemd: string[]

Tells the fields of the instance metadata document that are either:

The name of the attribute is the path (concatenated with '.') and optionally a number (if the type is an array), or gt, gte, lt, lte for range values.

nonindexedlinkmd: string[]

Tells the fields of the link metadata document that are either:

The name of the attribute is the path (concatenated with '.') and optionally a number (if the type is an array), or gt, gte, lt, lte for range values.

nonindexedpartmd: string[]

Tells the fields of the part metadata document that are either:

The name of the attribute is the path (concatenated with '.') and optionally a number (if the type is an array), or gt, gte, lt, lte for range values.

partmd: ({} | {
    id: string;
    metadata?: Object;
})[]

The part metadata document is shared among all part instances of the same part.

This is a list of all the part metadata documents of the part instance and its genealogy, or the part metadata documents of the children of the part instance.

A part is the definition of a single element of the DMU that may be instantiated multiple times. This is the genealogy chain or children list of part metadata documents. Any missing document for the given chain/list is represented by an empty object.

The document may be empty, meaning no information is available for the specific ancestor, or this part instance has no child.

  • "id" is the name (string) of the part metadata document (unique across the DMU) for this part instance.
  • "metadata" is the optional metadata of the part instance (parent or current part instance).