Skip to main content
1-Visitor
February 15, 2018
Question

How to create a Scheduler which can execute a custom class daily once in Windchill ?

  • February 15, 2018
  • 2 replies
  • 7949 views

Hi,

 

Right now we are fetching modified attribute values and we make a report daily once.

for now we are using CRON job script for executing the custom class on daily basis.

 

Is any way in Windchill to do same thing without using CRON job. 

Is any way in Windchill, so i can execute a program in Windchill on daily basis without user interpretation ?

 

Regards,

Vivek

 

 

 

2 replies

1-Visitor
February 15, 2018

Hi Vivek,

 

you can create your own scheduled queue (wt.queue.ScheduleQueue).

sheduleQueue = QueueHelper.manager.createScheduleQueue(name).

sheduleQueue.addEntry(....)

 

Florent

vuchekar1-VisitorAuthor
1-Visitor
February 15, 2018

Hello Florent,

 

Thanks for your response.

will you please explain this little more so i can pickup this fast.

 

Regards,

Vivek

1-Visitor
February 15, 2018

I recommend you to have a look on the customizer guide and the JavaDoc API.

 

Basically, you need to create a scheduleQueue using the method

public static ScheduleQueue newScheduleQueue(String name)

And add schedule task in this queue, using this method:

public ScheduleQueueEntry addEntry(WTPrincipal princ,
 String t_method,
 String t_class,
 Class[] arg_types,
 Object[] args,
 Timestamp sched_time)

 The method and class arguments specify the public static method you have implemented, arg_types and args are the arguments for the method, and finally the sched_time for the task itself.

 

You'll likely have to schedule the next task in your custom method.


Florent

18-Opal
April 26, 2021

Vivek,

 

We had the drive that stores the content files get fill up because the responsible party had never run “Remove Unreferenced File”. As a result the user’s could not upload files.

What I did to keep this from ever happening again is to write a batch file that runs the OOTB Remove Unreferenced Files Java tool and then using Windows Task scheduled the batch file to run once a month on the server where the vaults reside.

Works great.

 

Just thought I’d throw that out as another way to schedule any class to run on Windchill at regular intervals.

 

David

 

 

23-Emerald IV
April 26, 2021

@d_graham,

FWIW, cleanup of unreferenced files can automatically be scheduled now:

https://support.ptc.com/help/wnc/r12.0.1.0/en/index.html#page/Windchill_Help_Center/FileVaultConfigAutoCleanup.html