CFLib.org – Common Function Library Project

IsScheduledTask(Task)

Last updated October 16, 2002

author

Rob Brooks-Bilson

Version: 1 | Requires: CF6 | Library: UtilityLib

Description:
Returns true if the specified task name exists as a scheduled task in the CF Administrator.

Return Values:
Returns a Boolean.

Example:

<CFOUTPUT>
Is "Test" a scheduled task? #IsScheduledTask("test")#
</CFOUTPUT>

Parameters:

Name Description Required
Task Task name you want to verify. Yes

Full UDF Source:

<!---
 Returns true if the specified task name exists as a scheduled task in the CF Administrator.
 
 @param Task 	 Task name you want to verify. (Required)
 @return Returns a Boolean. 
 @author Rob Brooks-Bilson (rbils@amkor.com) 
 @version 1, October 16, 2002 
--->
<CFFUNCTION NAME="IsScheduledTask" RETURN="Boolean">
  <CFARGUMENT NAME="TaskName" REQUIRED="True" TYPE="String">
  <!--- var local vars for the func --->
  <CFSET Var TaskXML="">
  <CFSET Var GetTasks="">
  
  <!--- get the scheduler xml file.  It's stored as WDDX --->
  <CFFILE ACTION="Read"
          FILE="#Server.ColdFusion.RootDir#\lib\neo-cron.xml"
          VARIABLE="TaskXML">
  
  <!--- convert the WDDX to CFML - and array of structs --->        
  <CFWDDX ACTION="WDDX2CFML" INPUT="#TaskXML#" OUTPUT="GetTasks"> 
  
  <!--- search the array of structs for the name passed to the func --->
  <CFIF ListContainsNoCase(StructKeyList(GetTasks[1]), Arguments.TaskName) EQ 0>
    <CFRETURN False>
  <CFELSE>
    <CFRETURN True>
  </CFIF>
</CFFUNCTION>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson