CreateExportTreeLevel Functions
The following functions export data from a hierarchical table based on the tree level and possibly a top node identifier.
CreateExportTreeLevel—Exports data from a specified table based on a specified tree level and optional top node identifier. The fields exported are those in the Table Format file for the user group that you used for login.
CreateExportTreeLevelSession—Exports data as described in the previous bullet using a session token returned by the GetSessionToken function.
CreateExportCustomTreeLevel—Exports data from an array of fields from one or more specified tables based on the tree level and possibly a top node identifier. In the requested field array, you can include fields from parent tables.
CreateExportCustomTreeLevelSession—Exports data as described in the previous bullet using a session token returned by the GetSessionToken function.
Syntax
The following is the syntax for an HTTP request using the CreateExportTreeLevel function:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/CreateExportTreeLevel
HTTP/1.1
Host: HostName
Content-Type: application/x-www-form-urlencoded
Content-Length: length

UserName=string&Password=string&GroupName=string&ProjectName=string&SystemName=string&Table=string&ParentIdentifier1=string&TreeLevel=string&TopNodeIdentifier=string
Parameters
The CreateExportTreeLevel and CreateExportCustomTreeLevel functions use the login parameters for Windchill Risk and Reliability user accounts. The CreateExportTreeLevelSession and CreateExportCustomTreeLevelSession functions use the single login parameter for sessions. For more information, see Login Parameters.
In addition to login parameters, all CreateExportTreeLevel functions use these parameters:
ProjectName—The name of the Windchill Risk and Reliability Project. This value is case-sensitive.
SystemName—The name of the System file. This value is case-sensitive.
Table—The name of the Windchill Risk and Reliability table from which to export records. This value is case-sensitive.
ParentIdentifier1—The identifier of the FMEA in the FMEA Table from which to export data. This value is not case-sensitive and applies only to FMEAs.
ParentIdentifier2—The identifier of the FMEA tree item in the FMEA Worksheet from which to export data. This value is not case-sensitive and applies only to the FMEA Worksheet.
TreeLevel—For the FMEA worksheet, the type of items to export. The values for this parameter are:
0=Item
1=Mode
2=Cause
3=Effect
4=Action
The TreeLevel and TopNodeIdentifier parameters are often used together. For example, to export only modes for item 4, you would set TreeLevel to 1 and TopNodeIdentifier to Item4. Not specifying a value for TopNodeIdentifier exports all modes in the FMEA, optionally filtered by your FMEA Tree selection if a value is supplied for ParentIdentifier2.
TopNodeIdentifier—The identifier for the top-most node for which to export data as explained in the previous example. When you enter a top node identifier, it has priority over the tree level value. Data is exported for all children of the specified node.
The following is an example of an HTTP POST request using the CreateExportTreeLevel function:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/CreateExportTreeLevel
HTTP/1.1
Host: vm-test
Content-Type: application/x-www-form-urlencoded
Content-Length: length

UserName=Bill&Password=b3am3r&GroupName=Manager&ProjectName=Tablet PC
&SystemName=Tablet PC&Table=System Tree Items&TreeLevel=2&TopNodeIdentifier=A3
Returns
Assume that the user is authenticated and the specified parameter values are found. The specified level of system tree data is returned in the AdditionalData tag in JSON format. To easily read this data, paste it into a JSON validator.
If the ParentIdentifier1 or filter values are either not specified or invalid, they are ignored. The data is then exported unfiltered.
<?xml version="1.0" encoding="utf-8"?>
<DataEngineResponse xmlns="http://tempuri.org/">
<Success>true</Success>
<AdditionalData>[{"Name"":"DRAM Controller","PartNumber":"DRAMC7001",
"Identifier":"A3U1","ReferenceDesignator":"U1","Description":"DRAM
controller board","Manufacturer":"Memory Unlimited","FailureRate":
"0.958604","MTBF":"1E+006","TaggedPart":"false","ProblemList":"",
"HasChildren":"false"},{"Name":"Dynamic RAM","PartNumber":"DRAM512-31",
"Identifier":"A3U2-U3","ReferenceDesignator":"U2-U3","Description":
"31ns DRAM","Manufacturer":"Memory Unlimited","FailureRate":"0.396516",
"MTBF":"3E+006","TaggedPart":"false","ProblemList":"","HasChildren":
"false"}]</AdditionalData>
</DataEngineResponse>
If the call fails, the AdditionalData tag provides the reason for the failure.