com.sebtools Build 1 Documentation: Component Interaction

Component Interaction

ProgramManager.cfc has some built in methods to deal with NoticeMgr and Scheduler. These will automatically be put in place for either of those components that are passed in (assuming the argument names of "NoticeMgr" and "Scheduler", respectively).


If Noticemgr is passed in to the component then ProgramManager will call the "loadNotices" method. You can write code to create any notices that you want within that method.


If Scheduler is passed in to the component then ProgramManager will set up the "runScheduledTask" method (if there is one) to run every hour. You can create that method and put anything in it that you like.

If you want that method called at a different interval, or to use another method with Scheduler simply create a "loadScheduledTask" method of your own.

For reference, here is the one that is in ProgramManager.cfc itself:

<cffunction name="loadScheduledTask" access="private" returntype="any" output="false" hint="">
	<cfif StructKeyExists(variables,"Scheduler") AND StructKeyExists(This,"runScheduledTask")>
		<cfinvoke component="#variables.Scheduler#" method="setTask">
			<cfinvokeargument name="Name" value="#ListLast(,'.')#">
			<cfinvokeargument name="ComponentPath" value="">
			<cfinvokeargument name="Component" value="#This#">
			<cfinvokeargument name="MethodName" value="runScheduledTask">
			<cfinvokeargument name="interval" value="hourly">