Avatar of Coast Line
Coast LineFlag for Canada

asked on 

retrieving the Scheduled Task already which exists in the CFADMIN

I create a Cfschedule Task Progmatically, Now the Cfschedule task has been created, on the next vists, i had to run that schedular again. So just wanna check if that specific Schedular with Name exists, just use the cfschedular RUN command otherwise if it is coming first time, Create the Update for the Cfschedular which will create the schedular

1. I know it can be done through underlying serviceFactory Method, But i cannot use this because this can be blocked anytime.

2. I had seen a UDF at the CFLIB which checks for the Existing Task, but that is also checking for the XML/neo something file.

3. I like the Solution of 2nd one but can be modified like it should parse the path automatically and fetch the contents of the XML file and then parse it and find the specifc Task Name!

Well i really have no idea how to do what i asked, but u experts can guide me!

Really a Worth 500 points Answer!
Web ServersWeb Development SoftwareColdFusion Language

Avatar of undefined
Last Comment
_agx_
Avatar of SidFishes
SidFishes
Flag of Canada image

scheduled tasks are stored in neo-cron.xml which is in the \lib directory of the coldfusion program directory AFAIK, You can't really parse the path automatically as cf path parsing only works for serveable files. It is possible to get the task name though.
Avatar of _agx_
_agx_
Flag of United States of America image

I like the Solution of 2nd one but can be modified like it should parse the path automatically and fetch the contents of the XML file and then parse it and find the specifc Task Name!

The IsScheduledTask function already does all that. So I'm not sure what you're asking ?

Though if you're on a shared host, they may not allow you access to the XML files either
Avatar of _agx_
_agx_
Flag of United States of America image

if that specific Schedular with Name exists, just use the cfschedular RUN command otherwise if it is coming first time, Create the Update for the Cfschedular


You don't need a special function for that. Just RUN the task. CF will tell you if it doesn't exist! A cftry / cfcatch should be all you need.

<cftry>
       <cfschedule action="run" task="A task that doesn't exist">  
    <cfcatch>
         task doesn't exist. update/create it with <cfschedule ...>
    </cfcatch>
</cftry>
Avatar of Coast Line
Coast Line
Flag of Canada image

ASKER

@agx, i think your point is valid as we can wrap around try catch and if will through an error and catch will create the schedular

Hmm! seems valid to me but needs more clarification
Avatar of _agx_
_agx_
Flag of United States of America image

Hmm! seems valid to me but needs more clarification
No, it really is that simple. What is your question?
Avatar of Coast Line
Coast Line
Flag of Canada image

ASKER

my question was that my servers do bounce every few days and schedulled tasks gets cleared off! also wanna make such a secure way that it should ho for some internal undocumeneted or restricted way to check the file and run the scheduleer
Avatar of _agx_
_agx_
Flag of United States of America image

do bounce every few days and schedulled tasks gets cleared off!

What does "cleared off" mean? Scheduled tasks exists until _you_ delete them.  

make such a secure way that it should ho for some internal undocumeneted or restricted way to check the file and run the scheduleer

It's not clear what you're asking.  Could you rephrase that?
Avatar of Coast Line
Coast Line
Flag of Canada image

ASKER

i mean to say currently i am using the ServiceFactory Java Method which may be blocked!

second i do not want to use the method which calls its neoxml file
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Web Servers
Web Servers

A web server refers to the software that helps to deliver web content that can be accessed either through the Internet or through an intranet. The primary function of a web server is to store, process and deliver web pages to clients. The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP). The most common use of web servers is to host websites, but there are other uses such as gaming, data storage, running enterprise applications, handling email, FTP, etc.

33K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo