Reusing client-side human services
About this task
You can reuse the nested services in other client-side human services, which can be either top-level, root client-side human services or other nested client-side human services. Root services can contain one or more single- or multi-layered nested services.
When you build the service logic for your tasks or instance user interfaces in the designer, you might want to reuse common steps that are defined in other client-side human services. For example, creating an insurance claim might include a common set of steps. If you define the steps in a nested client-side human service, you can reuse them in other client-side human services. At run time, the nested client-side human service or services run as part of the parent root service.
When you create a client-side human service, you can specify whether it can be used as a nested service or as a root service. You can revisit the selection that you made in the Overview properties.
- Usage settings
- The usage settings of a root client-side human service depend on its intended purpose, and you can specify them in the Overview properties. The Use as setting is disabled for nested services because the configuration of a nested service is tailored for reuse. To ensure that the behavior of the root service is consistent at run time, in the nested service use elements that are compatible with the specified usage type of the root service.
- Variable scope
- In a hierarchy of nested client-side human services, variables are defined in isolation and are not automatically shared between the parent client-side human services and their nested services. To pass variables between a parent client-side human service and its nested services, you must set the data mapping. For more information, see Data mapping for nested client-side human services.
- Stay-on-page behavior
- When you use a stay-on-page event in a nested client-side human service, based on the logic that you defined, the stay-on-page behavior can loop the service diagram back to the last displayed page, which can be either in the same service as the stay-on-page event or in an ancestor client-side human service.
- Error handling
- Error event handlers that are defined in a hierarchy of nested client-side human services are not visible to all the services in the hierarchy. An error event handler that is defined in a nested client-side human service catches errors from the service in which it is defined and from all the nested services below it.
- Data change handling
- When client-side human services contain one or more nested client-side human services, only the root-level data change event handler is used. If the data change event handler in a nested service is bound to any views, you can redirect those bindings to the root data change event handler by selecting Trigger the root data change event handler in the Implementation properties of the nested service activity.
The following procedure describes how to nest a reusable client-side human service in another client-side human service. A step-by-step example is also provided.
Procedure
To nest a reusable client-side human service in another client-side human service: