Functions Available in the PTC Common Domain
The following functions are available in the PTC Common domain:
GetEnumTypeConstraint()
The function GetEnumTypeConstraint() is used to query the valid values for a property, which are represented as EnumType. These values are used for implementing validations on client side.
GetCSRFToken()
The function GetCSRFToken() is used to get the value of the nonce token that is used while creating, updating, or deleting entities in the system.
GetJWTFormRendererUrl()
The unbound function GetJWTFormRendererUrl() returns the URL to the e-signature page for tasks that require re-authentication.
For more information on requiring electronic signatures on workflow activities in Windchill, refer to the Windchill Help Center.
GetAllStates()
The function GetAllStates() returns a list of life cycle states, which are available and can be selected in Windchill. The life cycle states that cannot be selected in Windchill are not returned. The life cycle states are retrieved from the StateRb.rbinfo file.
GetAllStates() is an unbound function, which is available in all the domains which import the PTC Common domain.
If the URL used to execute the function is not formed correctly, the function throws the URL malformed exception.
GetWindchillMetaInfo()
See GetWindchillMetaInfo() for details.
GetWindchillVersion()
The GetWindchillVersion() function returns information similar to the windchill version command in the Windchill shell. For more information on the Windchill shell, see About the windchill Command in the Windchill Help Center. The function returns a list of installed modules along with the currently installed version of Windchill. Each installed module is represented as a Complex Type. For example:
[{
"AssemblyId":"mpml",
"AssemblyVersion":"13.0.0.0",
"AssemblyName":"windchill 13.0.0.0 mpmlink"
},
{
"AssemblyId":"odata",
"AssemblyVersion":"2.6.0.0",
"AssemblyName":"windchill 2.6 REST Services"
}]
GetUniqueRichTextImageNames()
The GetUniqueRichTextImageNames() function generates unique file names for rich text images that should be used for uploading the image files based on their image type and count. The function returns a complex type property RichTextImageUniqueFileNames with imageNamesToGenerateFor passed as the input parameter in the request. The parameter imageNamesToGenerateFor is an OData-formatted JSON array in which each JSON element contains two parameters: image type and the count of unique filenames to be generated for the specified image type. Only the following image types are supported: JPG, JPEG, PNG, GIF, and WEBP.
The function is available to all domains that import the PTC Common domain.
The function is the first stage in the three-stage upload process of rich text images to a Windchill object.
* 
We recommend using the GetUniqueRichTextImageNames() function before creating or updating a Windchill object to upload images. The generated file names are unique and must not be reused.
The following example demonstrates this request:
URI
GET /Windchill/servlet/odata/PTC/GetUniqueRichTextImageNames(imageNamesToGenerateFor=@p1)?@p1=[{"imageType":"jpg","count":1},{"imageType":"png","count":2}]
Sample Response
{
"@odata.context": "https://upg075ub46910.rd-plm-devops.bdns.ptc.com:2443/Windchill/servlet/odata/v5/PTC/$metadata#Collection(PTC.RichTextImageUniqueFileNames)",
"@PTC.AppliedContainerContext.LocalTimeZone": "GMT",
"value": [
{
"FileType": "jpg",
"FileNames": [
"abacada1-8f7a-42d0-8c02-0650e039091a.jpg"
]
},
{
"FileType": "png",
"FileNames": [
"5826bdae-1e2e-4e7f-a772-e66b1bc02094.png",
"1c6bc2a6-c952-47f3-8a26-f24ab1b33c06.png"
]
}
]
}
Refer to the example topic Three-Stage Upload of Rich Text Images to a Windchill Object demonstrating the complete three-stage process.
Refer to the domain EDM for a complete list of functions.
Was this helpful?