Navigation options for after service completion

To help the user go to a specific page after the client-side human service completes, you can configure the end event of the service to provide an alternative destination.

The implementation options for the end event indicate the intended behavior upon completion of the service and determine what the user sees at run time after the client-side human service completes successfully. For example, the user can see the case details user interface for a case instance or an Workplace page if a URL is specified as a JavaScript expression.

In the Implementation properties of the end event, under Event Navigation, the following navigation options are available.
Table 1. Navigation options available for end events
Option Description
Default (behavior provided by the hosting UI) Complete the client-side human service and go to the default page that is provided by the hosting user interface, such as Workplace.
Go to the instance details UI Complete the client-side human service and go to the instance details user interface for the case or process instance that the client-side human service runs in. This option applies only to client-side human services that run in a case or process instance.
Go to a specified URL Specify a relative URL to go to when the service completes. The URL is relative to the hosting user interface, such as Workplace. Because the URL is specified as a JavaScript expression, you must surround literal values with quotation marks. To return to the page that called the service, enter "BACK" (with quotation marks) as the URL value.

Workplace performs a navigation action when it finds any of the following keywords in the URL: /dashboards, /executecf, /exposedURL, /launchInstanceUI, /launchStartableService, /processes, /launchTaskCompletion, /tasks, /launchProcessDiagram, /launchAuditHistory.
The following examples describe the most common navigation use cases:

  • Go to a task: "/launchTaskCompletion?taskId=3"
  • Go to a dashboard: "/dashboards/TWP/Team+Performance" or "/teamworks/executecf?processApp=TWP&serviceName=Team+Performance"
  • Go to a service exposed as a URL: "/teamworks/executecf?processApp=SSP&serviceName=exposedURL"
  • Go to instance details UI: "/launchInstanceUI?instanceId=1214"
  • Go to a startable service: "/launchStartableService?modelID=1.a5ae06a9-681d-4701-9991-fbbbf6da0781&branchID=2063.d367c75b-45ea-4dcf-a483-547ad03d6dcb"
    Note that /executecf? does not work for a startable service.
Important: Navigation occurs only if the client-side human service is hosted in a user interface that supports navigation, such as Workplace. The client-side human service notifies the hosting user interface of the URL to go to, but if the hosting user interface does not provide navigation support, navigation does not occur.

Communicating with hosting user interfaces through event data

Client-side human services are integrated into hosting user interfaces such as Workplace. To ensure an enhanced user experience through the hosting user interfaces, client-side human services send message events to communicate their execution status to the hosting user interfaces. One such event is the onCompleted event, which is sent when the end of a client-side human service is reached.

You can specify event data in the Implementation properties of the end event in the client-side human service diagram. The value you specify must be compatible with the JSON format. If the hosting user interface supports the specified value, it can act on it when it receives the onCompleted event. The JSON string specified in the data property is the payload of the message event. After parsing the string, the properties of the resulting object will include a name that identifies the type of client-side human service event. When the name is "onCompleted", it will have an eventData property with the value set on the end event.

For example, create a NameValuePair variable with the following default value:
var autoObject = {};
autoObject.name = "testName";
autoObject.value = "testValue";
autoObject
Then, select the variable as the event data on the end event. When the end event is reached during the execution of the client-side human service, the data on the message event received by the hosting user interface will be similar to this:
{ 
  name: "onCompleted",
  eventData: {name: 'testName', value: 'testValue'},
  ...
}