cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Working Classification XML load file example 10.2

DonKrause
4-Participant

Working Classification XML load file example 10.2

Hi all,

We're currently implementing Partslink/Classification on 10.2M030.

As you may know, Classification has change dramatically from 10.1 - 10.2.

We have some 60,000+ parts that we'd like to classify, using (preferably) the CSV2XML utility, or by directly creating XML files for loadFromFile, but I cannot seem to locate any information what the file should look like for 10.2.

I did find CS59972, which describes the CSV format for loading this info, but it's only valid for 10.1. The ONE tiny example 10.2 file linked in the article is obfuscated to the point of uselessness.

Given this sample classification tree:

/Root

     Part

          Machine Components

               Bearings

Can somebody please show me a sample XML file the would place part 1000000 in that node?

Thanks very much!

=Don=

1 ACCEPTED SOLUTION

Accepted Solutions
DonKrause
4-Participant
(To:DonKrause)

I've finally nailed the "Magic" required to load the data we're looking for.

Given this sample classification tree:

/Root

     Part

          Machine Components

               Bearings

The "Bearings" node has 2 attributes, Material and BearingType.

Assuming 1000000 is a "Cam Roller" bearing, made from Bronze (Hey, this is a test, it doesn't have to be real..), the following XML file produces the desired results.

<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX24.dtd">

<NmLoader>

<csvBeginCreateOrUpdateWTPart handler="wt.part.LoadPart.beginCreateOrUpdateWTPart" >

    <csvpartName></csvpartName>

    <csvpartNumber>1000000</csvpartNumber>

    <csvtype>separable</csvtype>

    <csvgenericType></csvgenericType>

    <csvcollapsible></csvcollapsible>

    <csvlogicbasePath></csvlogicbasePath>

    <csvsource>buy</csvsource>

    <csvfolder>/Default/1000000-1999999</csvfolder>

    <csvlifecycle></csvlifecycle>

    <csvview></csvview>

    <csvvariation1></csvvariation1>

    <csvvariation2></csvvariation2>

    <csvteamTemplate></csvteamTemplate>

    <csvlifecyclestate></csvlifecyclestate>

    <csvtypedef></csvtypedef>

    <csvclassToUpdate></csvclassToUpdate>

    <csvorganizationName></csvorganizationName>

    <csvorganizationID></csvorganizationID>

    <csvsecurityLabels></csvsecurityLabels>

    <csvserviceable></csvserviceable>

    <csvservicekit></csvservicekit>

    <csvauthoringLanguage></csvauthoringLanguage>

</csvBeginCreateOrUpdateWTPart>

<csvLoadValue handler="com.ptc.core.lwc.server.LoadAttValues.loadValue" >

    <csvname>Classification</csvname>

    <csvrefType></csvrefType>

    <csvrefAtt></csvrefAtt>

    <csvvalue>Bearings</csvvalue>

</csvLoadValue>

<csvLoadValue handler="com.ptc.core.lwc.server.LoadAttValues.loadValue" >

    <csvname>Material</csvname>

    <csvrefType></csvrefType>

    <csvrefAtt></csvrefAtt>

    <csvvalue>DATA|java.lang.String|Bronze</csvvalue>

</csvLoadValue>

<csvLoadValue handler="com.ptc.core.lwc.server.LoadAttValues.loadValue" >

    <csvname>BearingType</csvname>

    <csvrefType></csvrefType>

    <csvrefAtt></csvrefAtt>

    <csvvalue>DATA|java.lang.String|Cam Roller</csvvalue>

<csvEndCreateOrUpdateWTPart handler="wt.part.LoadPart.endCreateOrUpdateWTPart" >

    <csvparentContainerPath></csvparentContainerPath>

</csvEndCreateOrUpdateWTPart>

</NmLoader>

---

Thanks!

=Don=

View solution in original post

6 REPLIES 6

Can you create a sample classified part, use the Export List to File > Export List to CSV action, then convert it to XML?  (which would also include any attributes you have set for that node)? You can export a classified part and a non-classified part to the same CSV file and compare the two.

The easiest way to convert non-classified parts to classified parts is using the Export to Importable Spreadsheet and Import from Spreadsheet actions. However, I'm not sure if this would doable when converting 60,000+ parts spread across multiple containers. This can be done at the folder level, or from the context Details page.

http://support.ptc.com/cs/help/windchill_hc/wc102_hc/WCUpgradeCFTR_ImportExportExcel.html

That was our initial attempt, however, the data in the importable Excel file diverges so far from the example XML file as well as any loader in the csvmap file that we had no luck finding the "magic" to make things work. The sample XML file from CS59972 is so badly obfuscated that making sense of it is not happening..

My gut feeling is that PTC hasn't yet created a loader for this purpose, as the example provided is using really low-level libraries to do it's bidding.

At least 10.1 used IBA types, 10.2 is just using loadValue, and too much information is missing from the example.

Thanks!

=Don=

There is an example XML in Windchill:

<Windchill>\loadFiles\partslink\demoClf\DemoClassification_nodes.xml

Look in the Help Center "Windchill PartsLink Post Installation Instructions"

DonKrause
4-Participant
(To:emartínez)

Those example XML file just load the types/attributes, and bare classification tree. None of the files in that example apply classifications to parts.

Thanks!

=Don=

DonKrause
4-Participant
(To:DonKrause)

I've finally nailed the "Magic" required to load the data we're looking for.

Given this sample classification tree:

/Root

     Part

          Machine Components

               Bearings

The "Bearings" node has 2 attributes, Material and BearingType.

Assuming 1000000 is a "Cam Roller" bearing, made from Bronze (Hey, this is a test, it doesn't have to be real..), the following XML file produces the desired results.

<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX24.dtd">

<NmLoader>

<csvBeginCreateOrUpdateWTPart handler="wt.part.LoadPart.beginCreateOrUpdateWTPart" >

    <csvpartName></csvpartName>

    <csvpartNumber>1000000</csvpartNumber>

    <csvtype>separable</csvtype>

    <csvgenericType></csvgenericType>

    <csvcollapsible></csvcollapsible>

    <csvlogicbasePath></csvlogicbasePath>

    <csvsource>buy</csvsource>

    <csvfolder>/Default/1000000-1999999</csvfolder>

    <csvlifecycle></csvlifecycle>

    <csvview></csvview>

    <csvvariation1></csvvariation1>

    <csvvariation2></csvvariation2>

    <csvteamTemplate></csvteamTemplate>

    <csvlifecyclestate></csvlifecyclestate>

    <csvtypedef></csvtypedef>

    <csvclassToUpdate></csvclassToUpdate>

    <csvorganizationName></csvorganizationName>

    <csvorganizationID></csvorganizationID>

    <csvsecurityLabels></csvsecurityLabels>

    <csvserviceable></csvserviceable>

    <csvservicekit></csvservicekit>

    <csvauthoringLanguage></csvauthoringLanguage>

</csvBeginCreateOrUpdateWTPart>

<csvLoadValue handler="com.ptc.core.lwc.server.LoadAttValues.loadValue" >

    <csvname>Classification</csvname>

    <csvrefType></csvrefType>

    <csvrefAtt></csvrefAtt>

    <csvvalue>Bearings</csvvalue>

</csvLoadValue>

<csvLoadValue handler="com.ptc.core.lwc.server.LoadAttValues.loadValue" >

    <csvname>Material</csvname>

    <csvrefType></csvrefType>

    <csvrefAtt></csvrefAtt>

    <csvvalue>DATA|java.lang.String|Bronze</csvvalue>

</csvLoadValue>

<csvLoadValue handler="com.ptc.core.lwc.server.LoadAttValues.loadValue" >

    <csvname>BearingType</csvname>

    <csvrefType></csvrefType>

    <csvrefAtt></csvrefAtt>

    <csvvalue>DATA|java.lang.String|Cam Roller</csvvalue>

<csvEndCreateOrUpdateWTPart handler="wt.part.LoadPart.endCreateOrUpdateWTPart" >

    <csvparentContainerPath></csvparentContainerPath>

</csvEndCreateOrUpdateWTPart>

</NmLoader>

---

Thanks!

=Don=

Awesome - I was just looking through our internal search trying to find something helpful, and coming up empty.

Thanks for sharing!

Top Tags