|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DelayTrigger
This delay trigger pauses, or sleeps, for a while after an execution flow reaches this trigger. The difference between this trigger and timer trigger is that timer trigger fires on a set schedule. For example, it attempts to fire every 15 seconds, regardless of whether an execution flow has returned to the timer trigger. On the other hand, this trigger begins sleeping at the moment an execution flow reaches this trigger, not on a pre-determined schedule.
The delay trigger is appropriate for delays, pauses, and sleeps, whereas timer trigger is appropriate for schedules. Delay triggers are especially useful in default flow chart error handlers. When an error occurs in an action and a default error handler is invoked, the error handler typically pauses for a while before the retrying the action. The delay trigger is perfect for this scenario, whereas a timer trigger fires on a schedule, and a proper delay cannot be achieved. When used as a default error handler, this delay trigger can also be configured to retry a certain number of times or until an expiration date. By default, this delay trigger pauses for 3 seconds. This delay can be configured with the setDelayTimeExpression() method. Also by default, the count is set to infinity and there is no expiration time expression. When this trigger finishes, a flux.DelayTrigger.DelayResult object is returned into the execution flow context. The Delay Trigger returns its result in the flow context variable "RESULT". The following table contains more information on accessing and using the result.Flow Context Variable | Field | Java Type | Description |
---|---|---|---|
RESULT | result | boolean | A boolean value indicating whether the delay trigger has expired. If true, the delay trigger fired normally; if false, the delay trigger has expired. |
Nested Class Summary | |
---|---|
static class |
DelayTrigger.Delay_Result
Deprecated. Use DelayTriggerResult instead. Deprecated in Flux 7.2. Will be removed in Flux 8.0. |
static class |
DelayTrigger.DelayTriggerResult
The result when a delay trigger fires. |
Field Summary | |
---|---|
static int |
INFINITY
Use this constant in the setCount() method to allow this trigger to run forever or until the expiration. |
Method Summary | |
---|---|
void |
expire()
Resets the state of this delay trigger as though it had expired and control had flowed down the expiration path. |
long |
getCount()
Returns the total number of times this trigger is configured to repeat until it expires. |
java.lang.String |
getDelayTimeExpression()
Returns a time expression that describes how long to wait. |
java.util.Date |
getExpirationDate()
Returns the date when this trigger expires. |
java.lang.String |
getExpirationTimeExpression()
Returns the time expression that governs when this trigger expires. |
long |
getRemainingCount()
Returns the remaining number of times this trigger has yet to repeat before it expires. |
java.util.Date |
getScheduledTriggerDate()
Returns the date when this delay trigger is scheduled to fire. |
void |
setCount(long count)
Sets the total number of times this trigger is configured to repeat until it expires. |
void |
setDelayTimeExpression(java.lang.String delayTimeExpression)
Sets a time expression that describes how long to wait. |
void |
setExpirationFlow(Action action)
The flow that is followed when this delay trigger expires. |
void |
setExpirationTimeExpression(java.lang.String expirationTimeExpression)
Sets the time expression that governs when this trigger expires. |
Methods inherited from interface flux.runtimedatamap.RuntimeDataMap |
---|
getRuntimeDataMap, setRuntimeDataMap |
Field Detail |
---|
static final int INFINITY
getCount()
,
setCount(long)
,
Constant Field ValuesMethod Detail |
---|
void expire()
long getCount()
INFINITY
java.lang.String getDelayTimeExpression()
java.util.Date getExpirationDate()
java.lang.String getExpirationTimeExpression()
long getRemainingCount()
INFINITY
java.util.Date getScheduledTriggerDate()
void setCount(long count)
count
- The total number of times this trigger is configured to repeat
until it expires.INFINITY
void setDelayTimeExpression(java.lang.String delayTimeExpression) throws EngineException
delayTimeExpression
- A time expression that describes how long to
wait.
EngineException
- If a system error occurs.void setExpirationFlow(Action action)
action
- The flow that is followed when this delay trigger expires.void setExpirationTimeExpression(java.lang.String expirationTimeExpression) throws EngineException
expirationTimeExpression
- The time expression that governs when this
trigger expires.
EngineException
- If a system error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |