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

Does anyone know the proper workflow to create and EPMDocument from Template via the API???

dhoang
5-Regular Member

Does anyone know the proper workflow to create and EPMDocument from Template via the API???

I'm able to create EPMDocuments through the API and through the EnterpriseHelper via a save-as but does anyone know the workflow to use when creating one from a Template stored in Windchill?

 

The API documentation looks like we need to do the following:

1. Call EnterpriseHelper.service.saveCopy(RevisionControlled original)

2. Edit any attribute values on the object that we want to change

3. Call EnterpriseHelper.service.saveFromTemplateObject(RevisionControlled original, RevisionControlled copy)

 

This workflow works and successfully creates an EPMDocument but it doesn't carry forward any of the data from the template.  All meta data fields are cleared and the content is not copied (but this is ok because we don't care about the content as we'll be uploading new content any way)

 

I'm assuming I'm doing something wrong or my understanding of the Java Doc is wrong but I can't find any other resources on how to do this. I've been able to use the above workflow and before step 3 I can retrieve all the meta data from the original object and update the copy, but if this is the way it needs to be done, why even have a saveFromTemplateObject function??

 

Any help is appreciated.

0 REPLIES 0
Top Tags