Skip to main content

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
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🗃ī¸ 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​

IEpilogue


🏷ī¸ 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​

IObservableNode


🏷ī¸ 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​

IPrologue


🏷ī¸ 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 a node;
  • prologue: The item is a prologue;
  • epilogue: The item is a epilogue;
  • 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​

NameTypeOptionalDescription
useTransitionbooleanYesSpecifies 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