Windchill - Custom Utility Examples
- March 15, 2016
- 5 replies
- 6809 views
I'm using this blog entry to post some of the custom utilities I have created. As I create new custom pages that interact with Windchill data, I will add them to this entry. I will include all the code so you can implement them and comment on improvements, etc. As always, use my code at your own risk, and test before implementing in production.
These examples were developed to provide functionality that wasn't included OOTB in Windchill at the time. I still don't think utilities exist to perform these exact functions. We have migrated data into the system several times from several different sources. Sometimes it is easier, or only possible using PTC tools, to import the data as-is. That results in non-standard data that requires some modification to bring it in-line with standards used by content already in the system.
So far, my custom pages don't interact with OOTB Windchill pages. Windchill includes a framework that makes that possible, and you can do some amazing things with it. My examples are very basic and make use of the fact that Windchill runs on a web server. Standard functionality can be extended using standard web server capabilities along with the Windchill API. I use html and JSP for these functions because I can easily implement code with a web page front end, allowing any user to run from a client. Inside the JSP code, java code can also be included to use any of the available Windchill API functionality making the possibilities nearly endless.
The renaming and associating utilities attached below all contain an html front-end page that prompts the user to upload an input csv file to the server. Once that occurs, the code in the jsp performs the functions based on info provided in the input file.
In order to run with the proper authority, place custom jsp files under the <WT_HOME>\codebase\wtcore directory. The html page can be accessed in the browser by using an address that corresponds to the codebase directory that contains the html file, like http://<your server>/wtcore/jsp/com/<your company>/EPMAssoc.html. The html page runs the jsp located in the same folder.
The EPMDoc associating utility adds links between pre-existing EPM Documents and WT Parts. Each line of the input csv file contains three values: association type,WTPart number, EPMDoc number. Where association type is either owner, image or content. Since only one owner link can exist per WTPart, a new one won't be created if one already exists. In that case, the association will be skipped.
The WTDoc associating utility creates a Described By link between pre-existing WTParts and WTDocs. Each line of the input csv file contains two values: WTPart number, WTDoc number.
.

