Creating a Scheduler
Procedure
Result
You use the function Cluster.scheduleEvent() to schedule an event to be sent at a certain time, using a scheduler you created earlier. You can do this in a rule or rule function as needed:
void scheduleEvent(String schedulerName, String workKey, SimpleEvent evt, long scheduledTime)
Where:
- schedulerName is the unique ID for the scheduler you created at an earlier time.
- workKey is a unique key that identifies the work item (that is, the scheduled task). This key can be used to identify the work item later, for example to cancel it.
- evt is the simple event to be scheduled.
- scheduledTime is used to specify the time the event is sent to its default destination. The value is interpreted as an absolute time. To schedule a time relative to the present, use the System.currentTimeMillis() function, as shown below.
For example:
Cluster.scheduleEvent("MyScheduler", myworkKey, Event.createEvent("xslt:// details omitted "), System.currentTimeMillis() + 5000)
Copyright © TIBCO Software Inc. All Rights Reserved.