Build an Ajax service when you want a coach view to send
data to or retrieve data from the server asynchronously, such as for
auto-completion in text fields, for default selection values in selection
lists, and so forth.
Before you begin
To perform this task, you must
be in the IBM® Process
Designer desktop
editor.
To create
services, you must have access to a process application or toolkit
in the Process Center repository.
Access to process applications and toolkits is controlled by users
who have administrative rights to the repository. For more information,
see Managing access to the Process Center repository.
About this task
To ensure that the Ajax service that
you are building can be accessed securely only by authorized callers,
you can use a security option in the
Overview tab
of the service. By selecting
Secure service against unauthorized
access, you prevent unauthorized coach views, external
implementations, and users to call the Ajax service, and also protect
all the REST APIs that can be used to call the service. When
Secure
service against unauthorized access is selected, only
trusted callers can call this service. Users who trigger a call to
this service must be authorized for the calling context. For example,
if the service is called from within a specified task, the user must
be authorized for that task. See step
5
Procedure
- Open the Process Designer desktop editor.
- Open a process application in the Designer view.
- Click the plus sign (+) next to User Interface,
and then click Ajax Service.
- In New Service,
enter a name for the service and click Finish. IBM Process
Designer displays
the diagram of the service with the default Start Event and End Event
components.
- To protect your Ajax service against unauthorized callers, in the
Overview tab, under Settings, select Secure
service against unauthorized access. At run time, the caller's authorization is checked. If
the caller is not authorized to access the service, the call is rejected.
- Add variables that the service will use as input or output.
You can also add private variables. See Declaring variables for a process or service for information.
- Add components to the service diagram and then set up the
sequence flow. For more information about components, see Service components in Process Designer.
- Configure the components in the sequence flow. For
example, if you are using a Server Script component,
add a script in the implementation properties.
- Save changes. The Ajax service is available
for use in coach views.
Attention: You cannot
automatically synchronize shared business objects for Ajax services.
The Automatically Sync Shared Business Objects setting
is always disabled
Example
To view an example of an Ajax service, the Coaches toolkit
contains the following Ajax services: Coaches Localized Messages Loader,
Default Autocompletion Service, and Default Selection Service.