1、一个service的java类
2、在framework/service/servicedef/service.xml中配置上一步的service服务。
<service name="remindSignOn" engine="java"
location="org.surpass.test.services.RemindSignOn" invoke="doSignOnRemindJobs" auth="true"
use-transaction="false" semaphore="wait">
<description>update order status</description>
<required-permissions join-type="AND">
<check-permission permission="SERVICE_INVOKE_ANY"/>
</required-permissions>
<!-- this service has no attributes -->
</service>
比如这是一个提醒签到的定时任务,location 是路径,invoke 是方法名字。
3、在framework/service/data/ScheduledServices.xml中配置最后一步:
<TemporalExpression tempExprId="REMIND_SIGNON" tempExprTypeId="FREQUENCY" description="Daily Morning" date1="2016-07-01 09:00:00.000" integer1="5" integer2="1"/>
<JobSandbox jobId="REMIND_SIGNON_JOBS" jobName="remind sign on everyDay" runTime="2016-07-01 09:00:00.000" serviceName="remindSignOn" poolId="pool" runAsUser="system" tempExprId="REMIND_SIGNON" maxRecurrenceCount="-1"/>
这里是时间代码:Second = 13, Minute = 12, Hour = 11, Day = 5, Month = 2, Year = 1 ,
integer1="5" integer2="1" 表示每天执行一次