Extending Document Management Domain to Add a Soft Attribute
This example shows you how to extend the Document Management domain to add a soft attribute on a WTDocument soft type.
To extend the domain to add the soft attribute, create a custom configuration file DocumentsExt.json at <Windchill>/codebase/rest/custom/domain/DocMgmt/<version>/entity.
{
"extends”: "Document",
"description”: "This config extends Documents.json.”,
"attributes”: [
{
"name":"ODATASTR1",
"internalName":"ODATASTR1",
"type":"String"
},
{
"name":"ODATAINT1",
"internalName":"ODATAINT1",
"type":"Int16"
},
{
"name":"ODATAFPN1",
"internalName":"ODATAFPN1",
"type":"Double"
},
{
"name":"ODATABOOL1",
"internalName":"ODATABOOL1",
"type":"Boolean"
},
{
"name":"ODATADATE1",
"internalName":"ODATADATE1",
"type":"DateTimeOffset"
}
]
}
To create a WTDocument with these extended soft attributes use the following request:
POST /Windchill/servlet/odata/<version>/DocMgmt/Documents HTTP/1.1
{
"Name": "Test1",
"Description": "Test1_Desc",
"Title": "Test1_Title",
"ODATASTR1": "This is String attribute",
"ODATAINT1": 1,
"ODATAFPN1": 1.555,
"ODATABOOL1": true,
"ODATADATE1": "2017-10-09T09:42:39Z",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:48788507')"
}