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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Windchill - Custom Utility Examples

Darrell
12-Amethyst

Windchill - Custom Utility Examples

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.

.

5 REPLIES 5
daraki
13-Aquamarine
(To:Darrell)

Hi Darrel,

 

Thanks much for sharing this! I'm trying to use the WTDocAssoc function but haven't been successful. Would you be able to help? We are using 11.0 M030.

 

I'm not sure where to start as I'm new to this, but here's what I've tried:

1. I've placed the html and jsp files under <WT_HOME>\codebase\wtcore\jsp

2. Modifed the file paths in the jsp file to match our Windchill installation

3. Created WTDocAssoc.csv with the two values; WTPart number, WTDoc number

 

4a. Open the html in Internet Explorer > Select the csv file in step 3 > Click on Upload File button

Nothing happens.

4b. Open the html in Chrome > Select the csv file in step 3 > Click on Upload File button

Result is a text dump of the WTDocAssoc.jsp fileJSPChromeErr.png

 

It seems like the jsp code isn't being executed at all. Any help is appreciated.

 

RandyJones
19-Tanzanite
(To:Darrell)

Like Darrell stated in his blog you have to access the code thru the web server. ie

http://YourWindchillServer.yourDomain.com/Windchill/wtcore/WTDocAssoc.jsp

Accessing by opening as a file, as you are doing in your screenshot, in a webbrowser will not work.

daraki
13-Aquamarine
(To:Darrell)

Hi Randy,

 

Thanks much for the reply, that did the trick!

The code is being executed but now I'm getting an error message - "No such service: com.cat.mining.plm.Windchill" - which is in this line in the jsp file.

 

Would you know if the service name is different between 10.2 and 11.0, and if so, what the correct service name would be?

 

asdf.png

Darrell
12-Amethyst
(To:Darrell)

I updated the example code I attached to this blog originally based on daraki's replies above. I can't attach it to this reply, so I had to make a new blog post. You can get the new files there.

Announcements


Top Tags