Heritage human service to client-side human service conversion

To gain the improved performance of a client-side human service and use the new features provided by the client-side human service, you must convert the heritage human service into a client-side human service, which requires you to re-create some of the service flow.

When you re-create the service flow in the web editor, you re-create some of the components and artifacts in the same way that they were created for the heritage human service. For some components, extra configuration might be required, depending on how the components are used in the service flow. Consider the following points when you plan to convert a heritage human service into a client-side human service.
Coaches
Re-create the coaches for the client-side human service in the web editor.
Input/output variables
Re-create your input and output local and private variables by using the same variable types.
Localization resources
In the web editor, click the plus sign next to Localization Resources and select a localization resource bundle to add to the client-side human service.
Server script
Based on what the server script for the heritage human service includes, choose a suitable replacement according to the following guidance:
  • If the server script only requires simple access to or simple manipulation of local variables, create a client-side script in the client-side human service and enter the same logic into it. You can copy and paste the server script content into the client-side script. If your script includes instantiation logic, it might require adjustments, as specified in the following Important note.
  • If the server script includes complex server-side operations, create a general system or integration service with a server script that contains your script logic. In your client-side human service, use a service to call the general system or integration service that you created.
Important: The server script syntax in the heritage human service is different from the client-side script syntax in a client-side human service. For client-side human services, ensure that you use the standard JavaScript syntax to instantiate objects in the client-side script, instead of the server script syntax that is used in a heritage human service, for example
// To instantiate and populate a complex variable
tw.local.customer= {};
tw.local.customer.firstName = "Jane";
tw.local.customer.lastName = "Doe";

// To instantiate and populate an array
tw.local.addresses = [];
tw.local.addresses[0] = {};
tw.local.addresses[0].city = "Boston";

// To instantiate a String variable
tw.local.customerID = "12345";

// To create a Date variable
tw.local.dueDate = new Date();
Server-side validation
If you used a validation service to validate your coach output, continue using it. However, modify it to include an error end event that passes the validation errors back to the client-side human service. See Example: validating a coach in a heritage human service.
If you instead used a server script to validate your coach logic, you have two choices:
  • If the server script logic includes complex operations or requires access to private or confidential data, create a general system service with a server script that holds your logic and use it as described earlier.
  • If your server script logic requires simple access to local variables and does not require access to private or confidential data, create a client-side script in your client-side human service, and place your validation logic there. See Example: validating data in a coach that is used in a human service.
Tip: For optimal performance, combine multiple service calls where possible. For example, instead of calling a validation service followed by a service that performs some work, combine these into a single service that internally performs the validation and, if the validation succeeds, performs the work.
Heritage coaches
Support for heritage coaches is not provided in client-side human services. For heritage coaches, continue using the heritage human services that provide the required support.
Server integration
To migrate integration elements such as Invoke UCA or Intermediate Tracking Event from an existing heritage human service to a new client-side human service, create an integration service that contains these constructs, and then call this integration service in the new client-side human service.