Your code seems fine to me.  What is the problem that you are experiencing?

Regards,

Howie

----- Original Message ----- 
From: "Vishal Narayan" <[EMAIL PROTECTED]>
To: "inFusion Support List" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, May 17, 2002 3:02 AM
Subject: [iMS] Scheduler Appn - how to disable schedule after execution ?


> I am using the Infusion Scheduler Demo as part of a bulk mailing 
> application I am building around IMS-SE. Nearly all of my schedules are 
> going to be one-time mailings only (or repeat at random intervals of time) 
> , and therefore I want, as a precaution, to disable the schedule after it 
> executes successfully for the first time.
> 
> My templates look like this:
> 
> Getevents.cfm
> ---------------------
> 
> <CFSetting EnableCFOutputOnly="YES">
> 
> <cfset FreqList="s,n,h,d,ww,m"> 
> <!--- Retrieve schedule --->
> <cfquery name="GetEvents" datasource="Scheduler">
>     Select ID,template,params,frequency,frequencytype from ScheduledTasks 
> where enabled=1 and Next<Now()
>        and StartDate<now() and Now()<EndDate
> </cfquery>
> <cfoutput Query="GetEvents"> 
> ID=#ID#
> Template=#Template#
> URLString=#params#
> Param="result"
> Value="ok"
> <!--- set up next event to prevent racing --->
>     <cfquery datasource="Scheduler">
>        update scheduledtasks set 
> Next=#CreateODBCDateTime(DateAdd(ListGetAt(FreqList,Frequencytype),frequency,now()))#
>        where id=#id#
>     </cfquery>    
> </cfoutput>
> 
> EventsDone.cfm
> ------------------------
> <CFSetting EnableCFOutputOnly="YES">
> 
> <!--- Disable succesfully executed events --->
> <cfoutput> 
> <cfquery datasource="Scheduler">
>     update scheduledtasks set Enabled=0 where id in 
> (#form.Successlist#) 
> </cfquery> 
> </cfoutput> 
> 
> The coldfusion template that the scheduler executes has it's last line as : 
> result=OK
> 
> As per the documentation, here's what I think should happen : the 
> getevents.cfm template should generate the event records with param and 
> value settings, and IMS then executes the template specified in the event 
> record. The template has result=ok as its last line, so the scheduler 
> should be able to verify that the schedule executed successfully. The 
> successful event ids should then be received as a comma-separated list in 
> eventsdone.cfm code, and should be accessible as #form.successlist#. So my 
> query in EventsDone.cfm then disables the successfully executed schedules.
> 
> However, this is not happening. Is there something wrong with my code 
> somewhere ?
> 
> Vishal. 
> 
==^=======================================================
     This list server is Powered by iMS
   "The Swiss Army Knife of Mail Servers"
   --------------------------------------
To leave this list please complete the form at 
http://www.coolfusion.com/iMSSupport.cfm
Need an iMS Developer license?  Sign up for a free license here:
http://www.coolfusion.com/iMSDevelopers.cfm
List archives: http://www.mail-archive.com/infusion-email%40eoscape.com/
Note: You are subscribed as [email protected]
==^=======================================================


Reply via email to