WVS Job Scheduler Administration
Scheduling Jobs
To access the Schedule Job window, from the Windchill Navigator, select Utilities from Site, Organizations, Projects, Products, or Libraries, and then select WVS Job Scheduler Administration.
Job Scheduler Administration operates in the context in which the job exists. For example, if you schedule a job to publish all CAD documents from a specific product, it publishes all CAD documents in that product only.
Use the following procedure to schedule a publish job:
1. From the Schedule Job window, enter the name of the job in the Name field.
You can enter up to 200 characters. This is a required field.
2. In the Description field, enter a brief description of the publishing job.
The description must be less than 200 characters.
3. Select the Only create log file check box if you do not want the scheduler to actually submit publish jobs, but only produce a log file of what would be published. This allows you to write a new schedule job and test it without actually submitting the job.
4. Under Job Type, select the type of job you want. Available options are Publish Job, Interference Detection Job, Print Job, Thumbnail Job, and Cleanup Job. The Job field updates accordingly.
5. From the Job list, select the job parameters to include in the selected Job Type.
Publish Job—The following options are available:
PublishAllEPMDocumentsNoRepresentation
PublishAllLatestEPMDocumentsNoRepresentation
PublishAllPartsNoRepresentation
RepublishAllDefaultRepresentations
PublishAllEPMDocuments
RepublishAllOutOfDateRepresentations
PublishAllWTDocumentsNoRepresentation
PublishAllLatestWTDocumentsNoRepresentation
PublishAllWTDocuments
PublishAllLatestWTDocuments
SISAutomatedTranslationPublish—Available if Services Information Manager Workers (SIS Workers) are configured.
Interference Detection Job—A single option is available.
InterferenceDetectionDefinition
a. Specify an existing Interference Detection Definition to process. Click Search to open the Search for Interference Detection Definition window. The Search Results pane opens populated with the available IDD’s
b. Select Use Latest Iteration to use the most recent version of the selected Interference Detection Definition.
* 
If Use Latest Iteration is selected, Search lists only the latest iterations of the Interference Detection Definitions.
Print Job has only one option to send a job to a printer.
Thumbnail Job—The following options are available:
GenerateRepresentationThumbnails
GenerateLatestRepresentationThumbnails
AddRepresentation3DThumbnails
AddLatestRepresentation3DThumbnails
RegenerateRepresentationThumbnails
RegenerateLatestRepresentationThumbnails
AddRepresentationSmallThumbnails
AddLatestRepresentationSmallThumbnails
* 
To publish mini-thumbnail representations, use the AddRepresentationSmallThumbnails and AddLatestRepresentationSmallThumbnails Thumbnail Job options. If mini-thumbnails are not needed, use the “Generate” and “Add 3D” Thumbnail Job names.
Cleanup Job—The following options are available:
DeletedCompletedJobs
DeletedCompletedSuccessfulJobs
In the Delete jobs older than 0 days field, specify which jobs to delete. Enter 0 to delete jobs older than today’s jobs, and 1 to delete jobs older than yesterday’s jobs, and so on.
* 
In the above list, “latest” means the document iteration most recently checked in to Windchill. So if “PublishAllLatestWTDocuments” is selected, only the most recent WTDocument iteration are published, and all older iterations will not.
The above lists of jobs are those supplied by default in Windchill. You can define your own job parameters. See Introduction to WVS Jobs and Queues for more information.
6. Determine whether you want to have the job execute immediately, or if you want to set it to execute at a specified time.
To have the job executed immediately, select the Immediately check box in the Start job field.
To set the job to execute at a specified time, select the Month, Day, Year, Hour, and Minute at which you want the schedule job to begin.
7. Determine if you want the job to be executed only once at a specified start time, or if you want the job to be executed repeatedly at a specified interval.
To execute the job once at a specified start time, select the Once check box in the Job frequency field.
To execute the job repeatedly, specify the Day, Hour, and Minute interval at which you want the publishing job to reoccur.
8. Click Schedule.
The publish job now appears in the Scheduled Jobs table.
To delete a publish job, click in the last column in the row of the publish job.
To refresh the list of publish jobs, click Refresh list .
When the job has executed, if the log file is open, the name of the schedule job appears as a link. Select the link to display the log file listing the items that have been sent for publishing. When the Only create log file option is selected, the link displays the list of items that would have been selected for publishing.
Setting Automated Publishing Schedules
With WVS Job Scheduler Administration, requests can be submitted to the Windchill Schedule queue for processing. Examples are provided below. Set automated publishing schedules specific to your site, to automate the publishing of certain types of data on a regular basis.
The first time that a scheduled job is submitted, a new Windchill schedule queue called WVSScheduleQueue is created. You can use the Windchill Queue Management utility to confirm that this queue exists and is active. The schedule queue submits a publish request at the date and time specified, with the specified frequency.
Settings in the wvs.properties file define the jobs that are available for selection from the Schedule Job page of the WVS Job Scheduler Administration utility. There are a number of example jobs already configured. An appropriate schedule job can be created if you have specific requirements.
There are two parts to the process of creating a Schedule Job:
Configuring the wvs.properties file
Writing the java code to select the objects to be published
The following property defines the list of available entries (where <n> is an increasing, sequential integer, starting with 1).
Schedulejobs<n>=<schedulename>
The schedulename is then used to find additional properties of the following forms:
<schedulename>.description=pull-down description

<schedulename>.class=<ClassContainingMethod>

<schedulename>.method=<nameOfMethod>

<schedulename>.enableOnContainers=<true/false>
The <schedulename>.description property defines the text that appears in the Job Type drop-down menu in the Scheduled Jobs pane. The class and method are used to identify the specific method that is invoked by the schedule job. The value of enableOnContainers determines if this schedule job is displayed in the list of jobs when the scheduler UI is invoked in a specific context. This indicates that the schedule job contains code to filter the objects to be published based on the context.
The following are the signatures of the publish job method:
public static QuerySpec <nameOfMethod>()
Or
public static QueryResult <nameOfMethod>()
Or
public static WTList <nameOfMethod>()
If a QuerySpec is returned, then PersistenceHelper.manager.find() is used to make the query and return a QueryResult. This QueryResult or the one returned directly from the schedule jobs method contains the EPMDocuments/WTParts/WTDocuments/Representations that are to be sent for publishing.
A default configuration spec is used. If the QueryResult contains a Representation, then that is sent for republishing. If the QueryResult contains a WTDocument, all publishable files (that is, those with worker XXX=mapping defined in wvs.properties) are sent for publishing.
If finer control is required over the submitted publish jobs, the schedule job method can return an empty QueryResult or WTList, and in the schedule job code use the doPublish method to submit the publish jobs as required.
To obtain the current container context for the schedule job, use the following method call in the jobs method:
WTContainerRef cr = com.ptc.wvs.server.schedule.ScheduleJobs.
getCurrentContainer();
The following example schedule job method publishes all EPMDocuments in the current context:
public static QuerySpec allEPMDocuments()
{
QuerySpec qs = null;
try {
qs = new QuerySpec(EPMDocument.class);
WTContainerRef cr = com.ptc.wvs.server.schedule.ScheduleJobs.getCurrent
Container();
if( cr != null ) {
ContainerSpec cs = new ContainerSpec();
cs.addSearchContainer(cr);
qs.setAdvancedQueryEnabled(true);
qs.appendWhere(WTContainerHelper.getWhereContainerIn(cs, EPMDocument.
class),new int[]{0});
}
} catch (Exception e ) { e.printStackTrace(); }
return qs;
}
To obtain debug information for a schedule job, set the following property to true in the wvs.properties file:
publish.publishqueuehelper.verbose=true
* 
For more information about WVS Job Scheduler Administration, refer to Customizing Windchill Visualization Services.
Was this helpful?