Options for Creating Custom Runtime Services in Windows Workflow (WF)

When you create a custom runtime service, you can implement it in several ways. Your reasons for developing a custom service can also affect the option that you choose. The following table details the implementation methods that are available, and the design considerations, to help you select the most appropriate method

Implementation Method 1: Create a new service implementation

You can choose to implement entirely new service functionality for your runtime service. In this scenario, you should extend the base WorkflowRuntimeService class and override the necessary methods to implement the new functionality

You want to define an entirely new service that offers functionality that none of the existing service classes provide. For example, you may want to define a service that logs workflow events to a log file.

Implementation Method 2: Extend the functionality of a predefined service

You can extend the predefined classes if you want to refine the existing process or add minor new functionality to an existing service. In this case, determine the most appropriate predefined service and extend its functionality accordingly.

You want to customize the behavior of an existing service. For example, you may want to define your own tracking service or persistence service. In this scenario, define a class that inherits from the appropriate predefined service class, such as TrackingService or WorkflowPersistenceService.

Tags: