cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Customizing commonSchedule Queue to add a custom job

kkazi
1-Newbie

Customizing commonSchedule Queue to add a custom job

Hi all,

I have a requirement where in I want to execute a java class as a job. I want to add my custom job to the 'commonScheduleQueue' available under 'Queue Management' in Utilities.

Does any one has an idea or can point me in the right direction ?

I have seached through the customization guide and help center but found no info on this.

There is info about customizing and adding publish Jobs, but I am searching to add a custom job to 'commonScheduleQueue' .

Thanks in advance,

Kazi

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Jarrett,

I intend to run an automatic download job to download files from our server to the ptc server.

For a more user friendly approach, automatic download of files from the server would help.

I have found a solution, but cannot validate the correctness of it.

I have been through the customization guide for PTC Windchill 10.2M10 and the help center topics, but could not find any topic for customizing the ‘Common Schedule Queue’ to add an independent job to it.

A little bit of re-engineering led me to the queueInitializers.xconf file located at: \Windchill\codebase\wt\queue\queueInitializers.xconf

This is what I did:

1. I created my own Java class to be executed. This is a replica/edited version of the com.ptc.tml.queue.TranslationScheduleQueue.Java

2. Made an extra entry for my custom class in the queueInitializers.xconf. So the automatic download process runs as a job in the common schedule queue.

3. Changed the getInterval() method to fetch the interval of the custom job from the database. This interval was set using my custom screen.

So you see, there is my custom settings screen to set the time interval to execute my job.

The common schedule queue shows my job in its list of jobs. A user can set the time interval for the job which will automatically download the requied files to the ptc server. Moreover, the user also has the option to completely shut the automatic download procedure.

Thanks for showing interest and for taking pains to help me. I am going to do a full testing round to check if this approach has any flaws, but if you have some experience about this and can validate whether my approach is correct or if there is any flaw, it would be great.

Cheers!

Kazi

View solution in original post

3 REPLIES 3

Hi Khudadad,

Could you elaborate on the intentions you have for this new custom job?

Regards,

Jarrett

Hi Jarrett,

I intend to run an automatic download job to download files from our server to the ptc server.

For a more user friendly approach, automatic download of files from the server would help.

I have found a solution, but cannot validate the correctness of it.

I have been through the customization guide for PTC Windchill 10.2M10 and the help center topics, but could not find any topic for customizing the ‘Common Schedule Queue’ to add an independent job to it.

A little bit of re-engineering led me to the queueInitializers.xconf file located at: \Windchill\codebase\wt\queue\queueInitializers.xconf

This is what I did:

1. I created my own Java class to be executed. This is a replica/edited version of the com.ptc.tml.queue.TranslationScheduleQueue.Java

2. Made an extra entry for my custom class in the queueInitializers.xconf. So the automatic download process runs as a job in the common schedule queue.

3. Changed the getInterval() method to fetch the interval of the custom job from the database. This interval was set using my custom screen.

So you see, there is my custom settings screen to set the time interval to execute my job.

The common schedule queue shows my job in its list of jobs. A user can set the time interval for the job which will automatically download the requied files to the ptc server. Moreover, the user also has the option to completely shut the automatic download procedure.

Thanks for showing interest and for taking pains to help me. I am going to do a full testing round to check if this approach has any flaws, but if you have some experience about this and can validate whether my approach is correct or if there is any flaw, it would be great.

Cheers!

Kazi

kkazi
1-Newbie
(To:kkazi)

Just to add to it...

Adding/checking an entry at start-up should be done via queueInitializers.properties. To the best of my knowledge that hasn't been made into an "official" xconf file. Which means if that is what they have done it's not officially supported.

Adding an entry to queueInitializers.properties and providing code to executed in relation to the entry is the "official" and proper way to add/check entries at run-up.


Top Tags