<?xml version="1.0" encoding="ISO-8859-1"?>
<ss:description type="trigger" id="com.autodesk.XML.DailyTrigger"
		xmlns:ss="urn:Autodesk:Server"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="urn:Autodesk:Server Schema.xsd">
	<ss:title>
		Daily
	</ss:title>
	<ss:options>
		<ss:label/>
		<ss:option name="hour">
			<ss:label>Hour</ss:label>
			<ss:tooltip>
				Enter the hour of the day the trigger will fire.
			</ss:tooltip>
			<ss:spinner>
				<ss:integer min="0" max="23" default="12" />
			</ss:spinner>
		</ss:option>
		<ss:option name="minute">
			<ss:label>Minute</ss:label>
			<ss:tooltip>
				Enter the minute in the hour the trigger will fire.
			</ss:tooltip>
			<ss:spinner>
				<ss:integer min="0" max="59" default="0" />
			</ss:spinner>
		</ss:option>
	</ss:options>
	<ss:code>
from com.autodesk.actions import Workflow
import time
from java.util import Calendar, Date, TimerTask

class DailyTimerTask(TimerTask):
	def __init__(self, w):
		workflow = w

	def run():
		workflow.trigger()

def main(workflow, hour, minute):
	if workflow == None or minute == None or hour == None:
		return

	timer = Timer()
	task = DailyTimerTask()

	# This loop gets a new calendar instance each time it runs. This
	# ensures the trigger fires a day after the last time the triggered
	# event completed. If a task takes longer than 24 hours the trigger
	# will not be fired until the day after the task has finished running.
	# There will not be two tasks running at the same time.
	while not workflow.stopRequested():
		# If the time is later than the trigger time, wait until tomorrow.
		cal = Calendar.getInstance()
		if hour &lt; cal.get(Calendar.HOUR) or (hour == cal.get(Calendar.HOUR) and minute &lt;= cal.get(Calendar.MINUTE))
			cal.roll(Calendar.DAY, 1)
		timer.schedule(task, cal.getTime())

	</ss:code>
</ss:description>
