Top
Top
LibraryEASYProcess Reference ManualProcessesServicesHtmlWorkshopSetTerminateActions

SetTerminateActions Overview

Because of the nature of the service, SetTerminateActions is often the last service on the process canvas. It can be helpful to developers because it can act as a Forward service while displaying a message to the user. It can forward to a specified url or refresh the current window. When the service is called from within a modal window (a window that disables the main window, but keeps it visible with the modal window as a child window in front of it), you also have the option to close the modal window and refresh the parent url.


SetTerminateActions Use Examples
Workshop:HtmlWorkshop
Service:SetTerminateActions
Inputs
Close

Only to be used in Modal Window. Takes values: "Yes" or "No". Passing "Yes" closes the window when this service is run in a modal window. Passing "No" or blank keeps the window open.


CloseWindow

ShowPopUpMessage

Takes values: "Yes" or "No". Passing "Yes" displays the message that we pass in "PopUpMessage" input. Passing

"No" or blank doesn't display the pop up message.


PopUpMessage

This is the pop up message we would like to display to the user.


RefreshWindow

Takes values "Yes" or "No". Passing "Yes" refreshes the window when this service is run in a modal window. Passing "No" or blank doesn't refresh the window.


RefreshParentWindow

Only to be used in Modal Window. Takes values "Yes" or "No". Passing "Yes" refreshes the parent window when this service is run in a modal window. Passing "No" or blank doesn't refresh the parent window. When this service is not ran in a window, passing "Yes" refreshes the same page. This might lead to unexpected results (infinite refreshes).


RedirectParentUrl

The current page is redirected to the URL specified in this input. This could be used in a modal window or not, both will be redirected.


Callback

ReturnParameters

ReturnParameter

Name

Value

SetTerminateActions Use Examples

Closing a Modal Window

This process is used to Turn on Edit mode in one of the applications. When user clicks turn on edit mode, a modal window (a window that disables the main window, but keeps it visible with the modal window as a child window in front of it) appears asking for login credentials. Once user enters the credentials and clicks the “Turn On Edit Mode” button, this process runs. We then confirm whether the user has entered valid credentials, if yes we turn the edit mode on and then use “SetTerminateActions” to close the Modal window and refresh the parent page.

Here’s a closer look at SetTerminateActions in this process. Notice that we are only using “CloseWindow” and “RefreshParentWindow” parameters in the inputs. If the inputs are left blank their default value is False.

If the SetTerminateActions is not used in a popup window like this, CloseWindow has no affect. Also, if it is not in a popup window, RefreshParentWindow can have undesired results and should not be used.

Displaying a Popup Message

Basic Popup Message

In this process we are updating user details and based on the success of update, we are displaying an error message or success message and reloading the page.

Success Message

These are the inputs for “SetTerminateActions” which are used to display the success message in this process. Notice the popup message input; we are adding field value and concatenating our own text to it.

In this example the SetTerminateActions was in a modal (popup) window, so in order to refresh the page following the message to the user, we put “Yes” for “RefreshParentWindow”. If the SetTerminateActions is not in a modal window, do not use this feature as it will have undesired results.

Error Message

These are the inputs for “SetTerminateActions” which are used to display the error message in this process.

Notice, there is no setting to refresh the page. In this instance, we simply want to display a message to the user and leave the user on the page. This allows them to keep their existing in put in the textboxes or fields and attempt to fix the issue.

Here is an example of what a SetTerminateActions message can look like:

Formatting your Popup Message

In the example below these two messages are separated by a new line character “\n”

Here is an example of a message in an Evaluate service which will be used in a SetWindowAttributes message. Notice the \n to create new lines between each message.

Using Redirect Parent Url

SetWindowAttributes and GetRequestAttributes

These two services are often used together when the page you want to reload contains query strings. One example of this is the Order Details page. This is a page that pertains to a particular order, so it has a specific OrderNumber, OrderType, and OrderCompany. When the user clicks the Reorder button, we want the button to perform some actions and then return us to the same page.

Here is the process canvas. When the “Reorder” button is clicked, we call a process which does all the reorder logic. Then we run GetRequestAttributes which tells us the exact url we were on with all the query strings.

We can pass that variable into SetWindowAttributes so it forwards the user here when the service runs.

Hard coded page

In this example, the process is adding items to the cart. So when it is successful, it forwards the user to the shopping cart page


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).