Class: Process

.ui.Process(step, contextopt)

new Process(step, contextopt)

A Process is a list of steps that are called in sequence. The step can be a number, a jQuery promise, or a function:

  • number: the process will wait for the specified number of milliseconds before proceeding.
  • promise: the process will continue to the next step when the promise is successfully resolved or stop if the promise is rejected.
  • function: the process will execute the function. The process will stop if the function returns either a boolean false or a promise that is rejected; if the function returns a number, the process will wait for that number of milliseconds before proceeding.

If the process fails, an error is generated. Depending on how the error is configured, users can dismiss the error and try the process again, or not. If a process is stopped, its remaining steps will not be performed.

Parameters:
Name Type Attributes Default Description
step number | jQuery.Promise | function

Number of miliseconds to wait before proceeding, promise that must be resolved before proceeding, or a function to execute. See #createStep for more information. see #createStep for more information

context Object <optional>
null

Execution context of the function. The context is ignored if the step is a number or promise.

Source:

Methods

execute() → {jQuery.Promise}

Start the process.

Source:
Returns:

Promise that is resolved when all steps have successfully completed. If any of the steps return a promise that is rejected or a boolean false, this promise is rejected and any remaining steps are not performed.

Type
jQuery.Promise

first() → {OO.ui.Process}

Add step to the beginning of the process.

Source:
Returns:

this

Type
OO.ui.Process

next() → {OO.ui.Process}

Add step to the end of the process.

Source:
Returns:

this

Type
OO.ui.Process