Scheduled Tasks

Team-Fly    

ColdFusion® MX: From Static to Dynamic in 10 Steps
By Barry Moore
Table of Contents
The Next Step: Advanced ColdFusion Functionality


ColdFusion MX gives you the capability to schedule tasks to run at a nominated time or interval. The ColdFusion Server maintains a list of events or tasks to be run. This is similar to task schedulers that you find in many operating systems.

You can schedule tasks to run by using the <CFSCHEDULE> tag, ColdFusion Administrator, or directly through the server's Registry settings. Which method you use will depend on your expertise and your access level to the server machine. If your application is being hosted by a commercial hosting provider, you might only be able to use the <CFSCHEDULE> tag.

Scheduled tasks simply invoke and run a certain nominated ColdFusion template. The following code illustrates the use of the <CFSCHEDULE> tag:

 <CFSCHEDULE ACTION="UPDATE"              TASK="employee query"              OPERATION="HTTPRequest"              URL="http://localhost/tasks/dbquery.cfm"              STARTDATE="01/01/02"              STARTTIME="01:00am"              ENDDATE="01/01/03"              INTERVAL="Daily">

This code would run a task called employee query daily. Every day, the server would use an HTTP call to run the dbquery.cfm template. This template might do something like query a database and insert the information into an array or structure that gets used throughout the application.


    Team-Fly    
    Top
     



    ColdFusion MX. From Static to Dynamic in 10 Steps
    ColdFusion MX: From Static to Dynamic in 10 Steps
    ISBN: 0735712964
    EAN: 2147483647
    Year: 2002
    Pages: 140
    Authors: Barry Moore

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net