code to republish failed jobs
Hi members,
Are you all aware of any code to auto republish failed jobs in windchill ?
Hi members,
Are you all aware of any code to auto republish failed jobs in windchill ?
This is doable.
But we need to know how the publishing job is being triggered.
Does this pertain to ALL publishing jobs including a manual create representation?
I wrote some code that would publish from a workflow and return the results of the job.
In our case we needed to get the published PDF and copy it across the network to a folder but the same technique would apply here. The code still needed to determine if the publishing was successful or not.
In your case you need to go one more step. You need to determine WHY it was unsuccessful. The CAD Worker did not start.
To get to that level of granularity you need to read the log. This is the same log displayed in the WVS Job Monitor.
If you need to republish ONLY if the CAD Worker does not start you can read the log that is displayed in WVS Job Monitor.

Here's an image of a Windchill shell that has run code that gets the publishing job's log and writes the log to the shell.
This is from the same publishing job log shown above. Note the html tags.

If the log contains the error in question such as:
"No worker can be started"
or
"Error, did not find available worker of type"
or whatever you want to trigger the republish then the code republishes the Representable.
BTW I also coded to republish only once. So, only two tries to publish (one initial publish and one republish). You donβt want to get into an infinite loop.
Hopefully this helps.
David
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.