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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Export Classification Attributes for Part in ESIResponse

SD
4-Participant
4-Participant

Export Classification Attributes for Part in ESIResponse

 
 
 

I need to export Classification attributes for Part in ESIResponse file. I want to do it a specific XML structure like:

<ClassificationAttributes>
<ClassificationAttributeMapping attribute="width" value="20" units="mm"></ClassificationAttributeMapping>
<ClassificationAttributeMapping attribute="height" value="40" units="mm"></ClassificationAttributeMapping>
</ClassificationAttributes>

 

How can I achieve this? Should I be adding more schema in ESIResponseMetaInformation.xsd and also in ESIResponseMetaInfo.xml? 

 

I tried to do following wherein:

- Added more schema to - ESIResponseMetaInformation.xsd

- Defined elements in - ESIResponseMetaInfo.xml

- In adjustPartElement hook when I get hold of Element for Part, I get the IeNode from it and query for childNodes but don't get anything. I expected to get <ClassificationAttributes>. If I could get that then I can wrap it an Element and add Att to it for 

- <ClassificationAttributeMapping attribute="width" value="20" units="mm"></ClassificationAttributeMapping>

- <ClassificationAttributeMapping attribute="height" value="40" units="mm"></ClassificationAttributeMapping> 

 

Please suggest if this would be the right way to move forward or not

6 REPLIES 6
avillanueva
22-Sapphire II
(To:SD)

I just did this recently for View and DefaultTraceCode but those core attributes. Yes, both would need to be updated. I am not sure your call out is correct. I think the classification attributes are really IBA attributes at the heart of it so you will need to get the right name to call out those attributes. I am also not sure that logic for writing out the response will know what to do with them. You might need customization to get the values if it does not work. I will dig up the changes I made to get the attributes I added. It at least answers your first part of your question.

SD
4-Participant
4-Participant
(To:avillanueva)

 

Thanks for your response. I am already able to fetch the classification attributes for the Part and put them in the Response XML. But they come as <attributemapping> like below.

 

<Part>

<Classification>/Parts/Mechanical/Heater</Classification>

<Class_Temperature>20</Class_Temperature>

<Class_Material>Cushion</Class_Material>

</Part>

 

But the format I want to achieve is like below:

<Part>

   <Classification>/Parts/Mechanical/Heater</Classification>

   <ClassificationAttributes>

      <Class_Temperature>20</Class_Temperature> 

      <Class_Material>Cushion</Class_Material>

   </ClassificationAttributes>

</Part>

 

I made schema changes in ESIResponseMetaInformation.xsd and ESIResponseMetaInfo.xml to support this structure.

 

I am trying to write code like below in adjustPartElement hook

 

com.infoengine.object.IeNode partNode = element.getNode();

 

com.infoengine.object.IeNode classAttributeNode = new com.infoengine.object.IeNode("classificationAttributes");
partNode.addNode(classAttributeNode);

 

Element classAttributeElement = new Element(classAttributeNode);

 

Att newAtt = new Att(attrName, attrValue);

classAttributeElement.addAtt(newAtt );

 

But this is not yielding right results.

 

Let me know if you have any ideas.

Casey_Swain
13-Aquamarine
(To:SD)

Hello,

I'm also trying to get classification attributes out to ESI.  I'm stuck at getting even you're first response format.  I can get it to send the binding node, but not a test attribute value.  The first test attribute I picked has units, but I can't believe that's the issue.  Could you possibly share that portion of your response meta-data definition file?  I've have mapped as below at the moment:

. <esi:attributeMapping sourceAttribute="Classification">Classification</esi:attributeMapping>

. <esi:attributeMapping sourceAttribute="xjf063">Thickness</esi:attributeMapping>

 

But all I'm getting is:

 .    <Classification>FASTENER-WASHER-PLAIN.1632768989843</Classification>

 .   <Thickness></Thickness>

 

Happy to discuss progress if you want to.

 

Sincerely,

Casey

pkgna
13-Aquamarine
(To:SD)

We have done a customization so that we can send the classification to SAP

 

The response file will look like as follows

<Part>
<ObjectID>OR:wt.part.WTPart:16589357398:407127582-1271670139093-27422385-109-44-253-132@pdmlink.vestas.net</ObjectID>
<Class>com.ptc.windchill.esi.Part</Class>
<LastChangedBy>ravku</LastChangedBy>
<Number>29256198</Number>
<StartEffectivity></StartEffectivity>
<EndEffectivity></EndEffectivity>
<StartSerialNumberEffectivity></StartSerialNumberEffectivity>
<EndSerialNumberEffectivity></EndSerialNumberEffectivity>
<StartLotNumberEffectivity></StartLotNumberEffectivity>
<EndLotNumberEffectivity></EndLotNumberEffectivity>
<SerialNumberEffectivityCxtPartNumber></SerialNumberEffectivityCxtPartNumber>
<LotNumberEffectivityCxtPartNumber></LotNumberEffectivityCxtPartNumber>
<DefaultUnit>ea</DefaultUnit>
<Name>TEST</Name>
<PartType>Component</PartType>
<Source>make</Source>
<State>RELEASED</State>
<View>Design</View>
<IsPhantom>false</IsPhantom>
<Version>0</Version>
<Iteration>4</Iteration>
<PreviousVersion></PreviousVersion>
<IsConfigurable>false</IsConfigurable>
<IsCollapsible>false</IsCollapsible>
<Weight>1</Weight>
<MaterialGroup>100</MaterialGroup>
<PreliminaryUNSPSC>3116231320</PreliminaryUNSPSC>
<SDCPreferenceCode>Preferred</SDCPreferenceCode>
<HazardousIndicator></HazardousIndicator>
<UNNumber></UNNumber>
<SDSReference></SDSReference>
<DGIndicatorProfile></DGIndicatorProfile>
<TraceCode>0</TraceCode>
<TraceMethod>80</TraceMethod>
<TraceIdentifier>9</TraceIdentifier>
<AsBuildIndicator>N</AsBuildIndicator>
<MSIOptionMarker>01</MSIOptionMarker>
<SpendClass>E0</SpendClass>
<MaterialReturnable>1</MaterialReturnable>
<EUCommodityCode>73269098</EUCommodityCode>
<Supersedes></Supersedes>
<ReplacementType></ReplacementType>
<Alternates></Alternates>
<TargetID>QE2:</TargetID>
<Classification>29256198~UNSPSC~3116231320~APPLICATION~31~</Classification>
<Classification>29256198~UNSPSC~3116231320~FUNCTION_KIT~test~</Classification>
<Classification>29256198~UNSPSC~3116231320~CLASS_NODE~PARTS KIT~</Classification>
<Classification>29256198~UNSPSC~3116231320~PACKAGE_DETAILS~78~</Classification>
<Classification>29256198~UNSPSC~3116231320~FUNCTION~~</Classification>
</Part>

 

 

 

 

Casey_Swain
13-Aquamarine
(To:pkgna)

That looks promising!  Can you please share your configuration steps?  Did you have to modify the renderers?

pkgna
13-Aquamarine
(To:Casey_Swain)

Hi Casey,

Yes, You have to modify the renderer for it. Also if you are using real number with unit, you need to take care of that also

Announcements

Top Tags