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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Export attributes for an object to an xml-file

MikaelJohansson
1-Newbie

Export attributes for an object to an xml-file

Hi

Does anyone know how to export atributes and its values for an object in Windchill to an xml-files?

This is an example of the output that I would like to have:

<?xml version="1.0" encoding="UTF-8" ?>

- <document>
<created_by>WMIKJOH</created_by>
<product_name>BRACKET</product_name>
<materialr>STEEL</material>
</document>

/Mikael

2 REPLIES 2

InfoEngine would be the way to do this. (Note, i'm not an InfoEngine expert, just fooled around enough to get some things to work)

Under your Windchill loadpoint there is a tasks folder. Underneath that folder create an xml file and put the following code in that file

<%@page language="java"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<ie:webject name="Get-Properties" type="MGT">
<ie:param name="AUTHORIZATION" data="${@SERVER[]authorization[]}"/>
<ie:param name="ATTRIBUTE" data="wt.federation.ie.VMName"/>
<ie:param name="GROUP_OUT" data="properties"/>
</ie:webject>
<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="INSTANCE" data="${properties[0]wt.federation.ie.VMName[0]}" valueSeparator=";" delim=";" />
<ie:param name="ATTRIBUTE" data="number" />
<ie:param name="ATTRIBUTE" data="name" />
<ie:param name="ATTRIBUTE" data="containerName" />
<ie:param name="ATTRIBUTE" data="versionInfo.identifier.versionId" />
<ie:param name="ATTRIBUTE" data="<IBA Logical Identifier>" />
<ie:param name="ATTRIBUTE" data="<IBA Logical Identifier>" />
<ie:param name="TYPE" data="wt.part.WTPart"/>
<ie:param name="WHERE" data="containerName='<YOUR CONTAINER NAME>'" />
<ie:param name="GROUP_OUT" data="parts"/>
</ie:webject>
----
The where part is optional, but in this case I'm telling it to search in a specific context (Replace <YOUR CONTAINER NAME> with the name of the context you want to search in, or if you want it to search system wide remove that line all together.
For each attribute you want to pull back add the logical identifier of the IBA. I think you can also remove all the attribute lines and just put in one line and set data="*" but i'd have to test it out.
To run this you would use the following url from a browser
http://<server name>/Windchill/servlet/IE/tasks/<subfolder(s)/<filename>.xml
Hope this helps
Steve D.

Thanks Steve

I realy appreciate your thorough response.

I will try, and let you you know how I did.

/Mikael

Announcements


Top Tags