RPAEngine.StopTask

The RPAEngine.StopTask method immediately stops the running task.

Syntax

RPAEngine.StopTask( _

Optional ByVal lngMessageType As Long = 0, _

Optional ByVal strMessage As String = "", _

Optional ByVal strTitle As String = "", _

Optional ByVal Style As VbMsgBoxStyle = vbExclamation)

Parameters

lngMessageType

[in, optional] The type of message to display when the script stops. This parameter must contain one of the following values:

Value

Meaning

0

(Default) The default Nintex RPA message will display.  See Remarks below.

1

A custom message will be displayed.

2

No message will be displayed.

strMessage

[in, optional] The message to display in the message box.  This parameter is used only when the lngMessageType parameter is set to 1.

strTitle

[in, optional] The message box title.  This parameter is used only when the lngMessageType parameter is set to 1.

Style

[in, optional] The message box style.  This parameter is used only when the lngMessageType parameter is set to 1.

Value

Meaning

vbExclamation

(Default) Exclamation.

vbCritical

Critical.

vbInformation

Information.

Return Value

None.

Remarks

The default message reads:  "The script has been stopped."  

The default title reads: "Nintex RPA"

Examples: The code below stops the script and displays the default stop message.

Call RPAEngine.StopTask(0)

The code below stops the script and displays a custom message.

Call RPAEngine.StopTask(1, "My message here.", "My Title", vbExclamation)

The code below stops the script without displaying a message.

Call RPAEngine.StopTask(2)