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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Move a document after state change

ptc-2091390
1-Newbie

Move a document after state change

I'm looking for a method to relocate a document from a product to a library automatically. Current workflow sets the state after receiving management review, but I would like it to automatically relocate the document to a common library for others to review. Also, a method to convert MS office documents to pdf would be ideal. any examples?

2 REPLIES 2

This should get you started with moving an object from one container to another:

WTDocument doc = null; //get document

Folder folder = null; //get folder in new container

WTValuedHashMap map = new WTValuedHashMap();

map.put(doc,folder);

wt.dataops.containermove.ContainerMoveHelper.service.moveAllVersions(map);

And for saving docs as PDF, look into Aspose. It's a pretty awesome library. http://www.aspose.com/java/word-component.aspx

Hi Joseph,

Matthew's example covers the api to call in the workflow. In order to trigger Matthew's code

In your workflow :

  1. Use a 'Synchronise' object select the 'Class Event' radio tab.
  2. In the 'Windchill Class' down downselect the type of your primaryObject.
  3. In the 'Event' drop down select 'STATE_CHANGE'.
  4. In the routing expression use Matthew's code.



Announcements

Top Tags