Combining the concepts in Procedure – Invoking Publishing from Custom Code/Workflow with Filtering All Publishing you can open up additional flexibility for general publishing. The technique simply requires you to insert the use of the doPublish method from the Publisher class into the filterMethod shown in the previous subsection. Since the filter method must return a Boolean, simply return Boolean.FALSE and use the doPublish method to cause Publish Jobs to be queued up for execution.
For example you want to provide specific naming information for publishes that were not made from Windchill stored data.
The problem I having is I'm unable to determine the parameters that were fed to the job to begin with. A typical doPublish method call will include the following parameters:
viewableLink - If true and the data has already been published, the viewable data will be passed back to allow access by getViewableLink
forceRepublish - Overwrites an existing representation should one already exist
objectReference - Reference of the Representable to be published
configSpec - The EPM Config Spec to be used during the product structure tree walk, if null, as-stored or latest is used.
partConfigSpec - The Part Config Spec to be used during the product structure tree walk, if null, latest is used.
defaultRep - Should the created representation be the default or not. The first representation in always default.
repName - Name of The representation to be created, if null default name will be used
repDescription - Description of the representation to be created , if null no description will be used
structureType - The type of structure walk to be performed, NONE, EPM, PART, EPM_PLUS_PARTS
actionString - Option String, see PublisherAction class, if no options can be null
jobSource - Source that submitted the job, 0=unknown, 1=manual, 2=checkin, 3=schedule
In order to make an informed decision on how to process the publishing request, I need to know these things. For example, submitting a manual publish request will definitely pre-set some of these values:
How do I capture these values? PTC tech support is telling me the filterMethod is a lightweight class that doesn't have access to the publishing event request parameters. Does anyone here in the community have a workaround? Some other way that I can capture these values prior to the doPublish event actually being called?