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

We are happy to announce the new Windchill Customization board! Learn more.

Publishing the 'As Stored' Configuration from Workflow code

iwebb
2-Guest

Publishing the 'As Stored' Configuration from Workflow code

I am trying to use the following code to publish the 'As Stored' configuration of ProE files (Winchill 10.1 M030):-


int configSpec = <value>;


PublishConfigSpec publishConfigSpec = new PublishConfigSpec();
publishConfigSpec.setConfigSpec(configSpec);
publishConfigSpec.activateConfigSpec();
Publish.doPublish(
false,
true,
doc,
publishConfigSpec.getEPMActiveNavigationCriteria(),
publishConfigSpec.getPartActiveNavigationCriteria(),
true,
"Rep: "+doc.getNumber(),
"Description",
publishConfigSpec.getStructureType(),
null);


The ConfigSpec Integer parameter was set to 1 when I found this code - this publishes the 'Latest' configuration.


I have tried the following values with these results:-


configSpec = 0; Latest
configSpec = 1; Latest
configSpec = 2; Lifecycle: In Work
configSpec = 3; Latest
configSpec = 4; Effectivity: <date>
configSpec = 5; Latest
configSpec = 6; Latest
configSpec = 7; Latest
configSpec = 8; Latest
configSpec = 9; Latest
configSpec = 10; Latest


configSpec = -1; Latest


Any ideas what value I should use for 'As Stored' Configuration ?


Thanks

1 REPLY 1

You can set the configspec to 5 and use publishConfigSpec.activateConfigSpec(String , Locale ) method



PublishConfigSpec publishConfigSpec = new PublishConfigSpec();


publishConfigSpec.activateConfigSpec(doc,null);






Also, you can try below API's to get "As Stored" configuration.



EPMDocConfigSpec publishConfigSpec = EPMDocConfigSpec.newEPMDocConfigSpec(stConfigSpec);




I have not tested above API's, check it works for you.


Hope this helps !!!


Thanks,


Shreyas


Top Tags