Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fujitsu.iflow.model.workflow
Interface TimerStatus

public interface TimerStatus

The `TimerStatus` interface defines operations for reporting the status of process timers or activity timers in a running process. The timers that are referenced are `TimerInstance` objects in the process, which are created from `TimerDef` objects in the process definition. `TimerInstance`s are not part of the Model API.

`TimerDef` objects are part of a static process definition, and all enumerations of `TimerDef` objects within an unchanged process definition should produce the same list.

`TimerInstance` objects, however, belong to dynamic processes, and the timers referenced by this interface are therefore transitory. Certain of these timers on this dynamic list may have already expired before a call is made to this interface. Furthermore, a `TimerStatus` object will contain a different `TimerInstanceID` and a different expiration time every time a periodic timer recycles. (A process will never contain, however, more than one active timer instance that corresponds to a single `TimerDef` object in the process definition.)

The transitory nature of `TimerInstance` objects is the reason why you should call methods such as `getTimerDescription`, `getTimerDefId`, and `getTimerName` when viewing, reporting, or calling the status of timers in a process. Implementing such methods when designing your application can prevent considerable confusion at run time.

The `TimerStatus` objects are generated automatically with process execution. You can receive the actual states of timers of a process instance by calling the method `ProcessInstance.getStatusOfTimers`.

See Also:
  `TimerDef`, `ProcessInstance`

Method Summary
`long` | `getTimerDefId()` Returns the unique identifier of the `TimerDef` object that was used to create the timer from.
`java.lang.String` | `getTimerDescription()` Returns the description of the represented timer.
`long` | `getTimerExpirationTime()` Returns the absolute time (in milliseconds from January 1, 1970) when this timer will expire.
`long` | `getTimerInstanceID()` Returns the ID of the represented timer (the `TimerInstance` object) in a running process.
`java.lang.String` | `getTimerName()` Returns the name of the timer.

Method Detail

### getTimerInstanceID

    public long getTimerInstanceID()
                            throws ModelException

  Returns the ID of the represented timer (the `TimerInstance` object) in a running process.

  The ID is allocated automatically by the server. The sequencing of ID numbers does not correlate with the order the timers are started and fired; nor is the Timer Instance ID the same as the `TimerDefID`.

  Note that a Periodic timer will have a different ID every time it restarts.

  Returns:
    The ID of the represented timer.
  Throws:
    `ModelException`

### getTimerName

    public java.lang.String getTimerName()
                                  throws ModelException

  Returns the name of the timer. Since the list of timers reported by `TimerStatus` is changeable, the timer's name should clearly identify the timer to prevent it from being confused with any other timer that runs in the same process. If no timer name was defined in the timer definition (`TimerDef` object), this method returns an empty `String`.

  Returns:
    The name of the timer.
  Throws:
    `ModelException`

### getTimerDescription

    public java.lang.String getTimerDescription()
                                         throws ModelException

  Returns the description of the represented timer. Since the list of timers reported by `TimerStatus` is changeable, the timer's description should contain enough information that the timer cannot be confused with any other timer that runs in the same process.

  Returns an empty `String` if no description is defined.

  Returns:
    The timer's description.
  Throws:
    `ModelException`

### getTimerDefId

    public long getTimerDefId()
                       throws ModelException

  Returns the unique identifier of the `TimerDef` object that was used to create the timer from. The ID is allocated automatically by the server. The sequencing of ID numbers does not correlate with the order the timers are started and fired; nor is this ID the same as the `TimerInstanceID`.

  Since the list of timers reported by this interface is changeable, use the ID of the `TimerDef` object to programmatically reference `TimerInstance` objects that were used to create them.

  Returns:
    The unique identifier of the `TimerDef` object that was used to create the `TimerInstance` object in the running process.
  Throws:
    `ModelException`

### getTimerExpirationTime

    public long getTimerExpirationTime()
                                throws ModelException

  Returns the absolute time (in milliseconds from January 1, 1970) when this timer will expire. You can convert this long data element into a recognizable representation of the date using methods in `java.util.Date`.

  Returns the present time if no expiration time was defined before.

  Note that a Periodic timer will have a different expiration time every time it restarts.

  Returns:
    The expiration time of timer.
  Throws:
    `ModelException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD