Using Work Definition Metadata
A
work definition metadata entry (
PTC.SCA.SCO.WorkDefinitionMetadata) provides information about the associated work definition, including whether or not it is a clone. If the associated work definition is a clone, the metadata indicates the source work definition from which it was cloned. If the work definition was imported, the metadata can indicate the
external system that was the source for the work definition.
When a
work definition is cloned, a work definition metadata entry is automatically created for the clone. If there are child work definitions included in the clone, a work definition metadata entry is created only for the root work definition of the clone.
Work definition metadata entries are not automatically created when a work definition is imported. Work definition metadata entries are also not automatically created for a cached work definition from which a clone is copied, nor is an existing work definition metadata entry updated if the associated work definition is cloned. If you want work definition metadata entries to be created for imported work definitions, or to be created or updated for cached work definitions, this must be done manually.
A work definition metadata entry does not need to exist for a work definition in order for the work definition to be cloned. If a work definition metadata entry does exist for a work definition, there is no requirement for the IsCached value to be true in order for the work definition to be cloned.
Examples
For example, a cached work definition with a UID of 123 is cloned, creating a new work definition with a UID of 456. The work definition metadata entry that is created for the clone appears as follows:
• WorkDefinitionUID—465
• SourceWorkDefinitionUID—123
• IsCached—false
• ExternalSystemUID—null
A work definition metadata entry for the cached work definition could be manually created or updated, with values similar to the following:
• WorkDefinitionUID—123
• SourceWorkDefinitionUID—null
• IsCached—true
• ExternalSystemUID—null
Services
The following services are available to manage work definition metadata entries:
• CreateWorkDefinitionMetadatas—Creates one or more new work definition metadata entries.
• DeleteWorkDefinitionMetadata—Deletes a work definition metadata entry.
• GetWorkDefinitionMetadata—Retrieves the work definition metadata entry for the specified work definition UID.
• GetWorkDefinitionMetadatas—Retrieves a list of all work definition metadata entries in the system. A filter can be applied with an offset and a limit to narrow the list of returned results.
• UpdateWorkDefinitionMetadatas—Updates one or more work definition metadata entries.
These services can be executed from the default production order manager. (PTC.SCA.SCO.DefaultProductionOrderManager).
|
Any time that you execute CreateWorkDefinitionMetadatas or UpdateWorkDefinitionMetadatas in ThingWorx Composer, you must ensure that the IsCached checkbox is selected (true) or cleared (false) as appropriate. Since IsCached is a Boolean field, if the checkbox is cleared or left blank, the system reads this as a value of false.
This is not a concern when the services are called from a mashup or another service.
|