IRunnerSequenceItem interface
đ Descriptionâ
Interface that describes a sequence item for useRunner
hooks that run in sequence
mode. The items are returned by the storyline
property of the IRunner
object.
đ Type declarationâ
interface IRunnerSequenceItem { type: "node" | "prologue" | "epilogue" | "finishing" | "pausing" | "paused" | "error";Readonly id: string;Readonly key: string;Readonly index: number;Readonly timeStamp?: number;ReadonlyOptional node?: IObservableNode;ReadonlyOptional prologue?: IPrologue;ReadonlyOptional epilogue?: IEpilogue;ReadonlyOptional error?: "unknown" | "outdated" | "rejected" | "paused";ReadonlyOptional state: "history" | "past" | "pre-active" | "before-active" | "active" | "after-active" | "post-active" | "upcoming";Readonly isHealthy: boolean;Readonly isHistory: boolean;Readonly isPast: boolean;Readonly isPreActive: boolean;Readonly isBeforeActive: boolean;Readonly isActive: boolean;Readonly isAfterActive: boolean;Readonly isPostActive: boolean;Readonly isUpcoming: boolean;Readonly isFirst: boolean;Readonly isLast: boolean;Readonly isPaused: boolean;Readonly allowActivate: boolean;Readonly allowNext: boolean;Readonly allowUndo: boolean;Readonly allowSkip: boolean;Readonly activate: (useTransition?: boolean) => boolean;Function deactivate: () => boolean;Function next: () => boolean;Function undo: () => boolean;Function skip: () => boolean;Function wait: () => void;Function continue: () => void;Function repeat?: () => void;FunctionOptional kickOff?: () => void;FunctionOptional retry?: () => void;FunctionOptional cancel?: () => void;FunctionOptional }
đī¸ Propertiesâ
đˇī¸ allowActivate
â
Specifies if the runner is allowed to activate the item.
Typeâ
boolean
đˇī¸ allowNext
â
Specifies if the runner is allowed to continue to the next item.
Typeâ
boolean
đˇī¸ allowSkip
â
Specifies if the runner is allowed to skip the item.
Typeâ
boolean
đˇī¸ allowUndo
â
Specifies if the runner is allowed to undo (go to the previous item).
Typeâ
boolean
đˇī¸ epilogue
â
Retrieves the epilogue when the item type
is epilogue
. This epilogue can be used by runners (that support it) to show a closing message when the form is completed.
Typeâ
đˇī¸ error
â
Retrieves the error code when the item type
is error
. It can be one of the following values:
unknown
: An unknown error occurred when finishing the form;outdated
: The form definition is outdated;rejected
: The server rejected the response data;paused
: An error occurred when pausing the form.
Typeâ
"unknown" | "outdated" | "rejected" | "paused"
đˇī¸ id
â
Specifies the unique identifier of the item.
Typeâ
string
đˇī¸ index
â
Retrieves the zero-based index of the item in the storyline
sequence array.
Typeâ
string
đˇī¸ isActive
â
Specifies if the item is active.
Typeâ
boolean
đˇī¸ isAfterActive
â
Specifies if the item is becoming inactive.
Typeâ
boolean
đˇī¸ isBeforeActive
â
Specifies if the item is becoming active.
Typeâ
boolean
đˇī¸ isFirst
â
Specifies if the item is the first item in the storyline
sequence array.
Typeâ
boolean
đˇī¸ isHealthy
â
Retrieves if the item is still in the storyline
sequence array.
Typeâ
boolean
đˇī¸ isHistory
â
Specifies if the item is history and cannot be changed anymore (write-protected).
Typeâ
boolean
đˇī¸ isLast
â
Specifies if the item is the last item in the storyline
sequence array.
Typeâ
boolean
đˇī¸ isPast
â
Specifies if the item is in the past.
Typeâ
boolean
đˇī¸ isPaused
â
Specifies if the runner is paused.
Typeâ
boolean
đˇī¸ isPostActive
â
Specifies if the item is about to become inactive.
Typeâ
boolean
đˇī¸ isPreActive
â
Specifies if the item is about to become active.
Typeâ
boolean
đˇī¸ isUpcoming
â
Specifies if the item is upcoming (is in the future).
Typeâ
boolean
đˇī¸ key
â
Retrieves a unique key for the item within its context (the key is prefixed with an underscore).
Typeâ
string
đˇī¸ node
â
Retrieves the node when the item type
is node
.
Typeâ
đˇī¸ prologue
â
Retrieves the prologue when the item type
is prologue
. This prologue can be used by runners (that support it) to show a welcome message before starting the actual form.
Typeâ
đˇī¸ state
â
Retrieves the item state. It can be one of the following values:
history
: Specifies the item is history and cannot be changed anymore (write-protected);past
: Specifies the item is in the past;pre-active
: Specifies the item is about to become active (stage 1 out of 5);before-active
: Specifies the item is becoming active (stage 2 out of 5);active
: Specifies the item is active (stage 3 out of 5);after-active
: Specifies the item is becoming inactive (stage 4 out of 5);post-active
: Specifies the item is about to become inactive (stage 5 out of 5);upcoming
: Specifies the item is upcoming (is in the future).
Typeâ
"history" | "past" | "pre-active" | "before-active" | "active" | "after-active" | "post-active" | "upcoming"
đˇī¸ timeStamp
â
Retrieves a last update timestamp for the item.
Typeâ
string
đˇī¸ type
â
Specifies the item type. It can be one of the following values:
node
: The item is anode
;prologue
: The item is aprologue
;epilogue
: The item is aepilogue
;finishing
: The item is a finishing message that indicates the runner is submitting a form;pausing
: The item is a pausing message that indicates the runner is pausing a form;paused
: The item is a paused message that indicates the runner has paused;error
: The item is an error message (error
indicates the error type).
Typeâ
"node" | "prologue" | "epilogue" | "finishing" | "pausing" | "paused" | "error"
âļī¸ Functionsâ
đ§ activate
â
Activates the item.
Signatureâ
(useTransition?: boolean) => boolean
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
useTransition | boolean | Yes | Specifies if a transition should be applied. |
Return valueâ
Returns true
if the item is activated.
đ§ cancel
â
Retries an operation after it failed.
Signatureâ
() => void
đ§ continue
â
Continues an item that was in a waiting state.
Signatureâ
() => void
đ§ deactivate
â
Deactivates the item.
Signatureâ
() => boolean
Return valueâ
Returns true
if the item is deactivated.
đ§ kickOff
â
Kick off a form.
Signatureâ
() => void
đ§ next
â
Activates to the next item.
Signatureâ
() => boolean
Return valueâ
Returns true
if the next item is activated.
đ§ repeat
â
Repeats the form after it is completed.
Signatureâ
() => void
đ§ retry
â
Retries an operation after it failed.
Signatureâ
() => void
đ§ skip
â
Skips the item.
Signatureâ
() => boolean
Return valueâ
Returns true
if the item is skipped.
đ§ undo
â
Undos the item (and activates the previous item).
Signatureâ
() => boolean
Return valueâ
Returns true
if the undo operation was successful.
đ§ wait
â
Puts the item in a waiting state that ends when continue
is invoked.
Signatureâ
() => void