Skip to main content
11-Garnet
Mar 25, 2022 7:15 AM UTC
Question

How to Stop publishing for Specific WTDocument types?

Is there any way of doing in configuration/customization to stop publishing for specific WTDocument types?

4 replies

17-Peridot
Mar 25, 2022 7:32 AM UTC

You can use the WTProperty

publish.service.filterdocumentpublishmethod  Default Value:  
Synopsis: A method to filter which WTDocuments are published on checkin or upload 
Description: A method can be supplied to provide custom filtering of the WTDocument content that will be published as a result of file upload or checkin (providing they have content that has a worker associated with it). if no method is supplied all WTDocument content that meets the above criteria will be sent for publishing. The property value is specified in the form classname/methodname, with the following signature
public static Boolean methodname(WTDocument doc, ContentItem ci)
a return of Boolean.TRUE indicates the WTDocument should be published, Boolean.FALSE that it should not. 

An example is provided here: https://www.ptc.com/en/support/article/cs52443

 

Translate
11-Garnet
Mar 25, 2022 7:37 AM UTC

Hi @BjoernRueegg, 

 

Thanks for the article.

This property publish.service.filterdocumentpublishmethod will filter/stop publishing only on checkin and upload.

I need to stop publishing on set state.

 

 

Translate
17-Peridot
Mar 25, 2022 12:27 PM UTC

I'm not 100% sure but I think the general method will not filter them:

publish.service.filterpublishmethod  Default Value:  
Synopsis: A method to filter which objects can be published 
Description: A method can be supplied to provide custom filtering of Objects that can be published. All publishing, even from preconverted data, will be checked via this method if one has been supplied. If the publish is to convert data stored in Windchill, then the flag publishFromDB will be TRUE, if the publish is for local data or data from the clipboard publishFromDB will be FALSE. The property value is specified in the form classname/methodname, with the following signature
public static Boolean methodname(Persistable p, Boolean publishFromDB)
a return of Boolean.TRUE indicates the Object can be published, Boolean.FALSE that it can not. 

 

public static Boolean methodname(Persistable p, Boolean publishFromDB)

 

But you will also receive all the EPMDocument jobs. 

Translate
TomU
23-Emerald IV
Mar 25, 2022 1:33 PM UTC

If you're talking about actual sub-types, you should be able filter these out with the publish rules.  Take a look at conditional rules.

 

TomU_0-1648214748709.png

 

https://support.ptc.com/help/wnc/r12.0.2.0/en/index.html#page/Windchill_Help_Center%2FWVSPublishRulesRecentEnhance.html%23

 

https://www.ptc.com/en/support/article/cs111916

 

Translate