Creating a service flow

A service flow is a sequence of services, gateways, and events. The Service Flow editor palette provides you with the tools to develop a simple or complex service flow that you can then use in your processes.

About this task

Services in earlier releases were created with the desktop Process Designer. These heritage services can be converted into service flows, which you can edit in the Process Designer and run in the same way you ran heritage services. For more information about the conversion of heritage services, see Converting heritage services.

Procedure

  1. From the library, click Services > Service Flow and complete the wizard:
    1. Specify a suitable name for your service flow.
    2. If you want the service flow to be used as a team service for team retrieval or team filtering, select Use as a team service and specify the service type. A template that corresponds to the selected service type is specified by default. If you want to replace the default template, you can point to a service that has additional input parameters and the same output variable, without any additional output variables.
    3. Click Finish.
    For more information, see Using services to define dynamic teams.
  2. In the Diagram view, create your service flow by dragging artifacts in the palette like services, gateways, and events to the canvas and wiring them. See Service Flow editor palette.
  3. Optional: To assign a pre-execution and post-execution script to an activity in the service flow, select the activity node in the service flow diagram, click Pre & Post in the properties view, and then enter or paste the appropriate JavaScript code in the Pre-Execution Script section or the Post-Execution Script section.
    The JavaScript code that you add runs immediately before or after the activity runs. For more information, see Assigning pre- and post-execution scripts.
  4. Optional: To invoke a REST service, a Java application, or an external implementation, add a service task to the diagram and wire it. In the Implementation tab, select the corresponding external service, and select the operation that you want to invoke. Map the inputs and outputs in the Data Mapping tab. See Calling an external service.
  5. Optional: To integrate with an Enterprise Content Management (ECM) server, add a Content Integration Task to the diagram and wire it. Enter the properties for the ECM server that you want to connect to. See Building a service that integrates with an ECM system or a BPM store.
  6. To protect the REST services, coach views, or external implementations that call this service flow, specify the access level that is required for the call:
    • Select Do not allow Ajax calls if the service flow has access to private or confidential information that cannot be exposed through any Ajax calls.
    • Select Allow calls from trusted callers to allow only trusted callers, such as known coach views or external implementations, to call the service flow. The users who trigger the call must be authorized for the calling context. For example, if the service flow is called in the context of a specified task, the user must be authorized for that task. This is the default selection for service flows.
    • Select Allow calls from all users to allow any user that is authenticated with Business Automation Workflow to call the service flow.
  7. Optional: To call another service flow or heritage service from your service call, add a linked service flow node to your diagram, and specify the service that you want the linked service flow to call. See Calling another service from a service flow.
  8. Optional: If you need to branch the path that your service flow takes at run time, add an exclusive gateway to the service flow diagram, and define JavaScript conditions in the implementation properties of the gateway to determine the path that the flow follows. For more information, see Implementing exclusive gateways.
  9. Optional: If you want to send a message to an undercover agent (UCA) while the service flow is running, use the Message (sending) tool (This icon indicates the Message (sending) tool on the palette.) to add an outgoing intermediate message event to the diagram. In the Implementation tab of the selected message event, under Event Properties, select the UCA that you want to attach to the message event, and then use Target current snapshot to set the target for the message event. For more information, see Sending messages to undercover agents.
  10. Optional: To capture runtime data about the status and progress of a service flow execution, add a monitoring event to the service flow model. Use the Tracking tool (This icon indicates the Tracking tool on the palette.) to add a tracking event node to the service flow diagram. Insert the tracking event in the diagram at the point where you want Business Automation Workflow to capture the runtime data. For more information, see Enabling runtime data tracking .
  11. Optional: To improve performance, under Additional Properties, select Enable caching of service flow results to display the cache configuration fields, and enable caching of service flow results for each combination of input parameter values. By default, caching is disabled and the duration options are not displayed.
    When caching is enabled, for every combination of input parameter values, a distinct service flow result is automatically added to the cache. When the service flow is started, the cache is checked:
    • If a matching result is found, the cached result is used directly without invoking the service flow.
    • If a matching result is not found in the cache or the cached result has expired, the service flow is invoked and the cache is refreshed.
    By default, the service flow results are stored in the cache for 12 hours. To change the caching period, use the Days, Hours, Minutes, and Seconds fields to select the appropriate duration. You can change the cache size by including a value for <service-result-cache-size> in the 100Custom.xml file, inside the <server merge="mergeChildren"> section. If the service flow is called and the number of cached results exceeds the defined cache size, the least recently used result is removed so that there is space for the new result.
    Restriction: Service result caching is available for top-level service flows, but does not work for linked service flows.
  12. Optional: Also under Additional Properties, specify whether you want to enable the automatic synchronization of shared business objects:
    • If you selected Do not allow Ajax calls earlier (step 6), you can select Automatically sync shared business objects to enable the synchronization of shared business objects. To disable the synchronization, keep Automatically sync shared business objects clear (default option). For example, when you have a service flow that runs custom logic and then explicitly saves the shared business objects, clear the automatic synchronization option.
    • If you selected Allow calls from trusted callers or Allow calls from all users, you can select Automatically sync shared business objects to enable the automatic synchronization of shared business objects. However, enabling synchronization when the service flow is invoked through Ajax will not take effect. In this case, a warning message indicates that no automatic synchronization of shared business objects occurs.
    For more information, see Shared business objects.
  13. Click Save or Finish Editing.