<workflowRuntime>

Specifies settings for an instance of WorkflowRuntime for hosting workflow-based Windows Communication Foundation (WCF) services.

Schema Hierarchy

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior> of <serviceBehaviors>
        <workflowRuntime>

Syntax

<workflowRuntime cachedInstanceExpiration="TimeSpan"
                                  enablePerformanceCounters="Boolean"
                                  name="String"
                                  validateOnCreate="Boolean">
                 <commonParameters>
                    <add name="String" value="String" />
                 </commonParameters>
                 <services>
                    <add type="String"/>
                 </services>
</workflowRuntime>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

cachedInstanceExpiration

An optional Timespan value that specifies the maximum duration a workflow instance can stay in-memory in idle state before it is forcefully unloaded or aborted. If the workflowruntime has PersistenceService which performs unloadOnIdle, this attribute is ignored.

enablePerformanceCounters

An optional Boolean value that specifies whether performance counters are enabled. Performance counters provide information on various workflow-related statistics, but they cause a performance penalty when the workflow runtime engine starts, and when workflow instances are running. The default value is true.

name

A string containing the name of the workflow runtime engine. The name is used in output to distinguish this runtime from other runtimes that may be running on the system, for example, in performance counters.

The default is an empty string.

validateOnCreate

An optional Boolean value that specifies whether validation of workflow definition will occur when the WorkflowServiceHost is opened. When this attribute is set to true, the workflow validation is executed every time WorkflowServiceHost.Open is called. If validation errors are found, a WorkflowValidationFailedException error is thrown.

When this property is set to false, no Workflow definition validation will happen.

The default value for this property is true.

Child Elements

Element Description

commonParameters

A collection of common parameters used by services. This collection will typically include the database connection string that might be shared by durable services.

services

A collection of services that will be added to the WorkflowRuntime engine. The elements are of type WorkflowRuntimeServiceElement. The services specified in the collection will be initialized by the workflow runtime engine and added to its services when the appropriate WorkflowRuntime constructor is called. Therefore, the services specified in the collection must follow certain rules about the signatures of their constructors. See WorkflowRuntimeServiceElement for more information.

Parent Elements

Element Description

<behavior> of <endpointBehaviors>

Specifies a behavior element.

Remarks

For more information on using a configuration file to control the behavior of a WorkflowRuntime object of a Windows Workflow Foundation host application, see Workflow Configuration Files.

Example

<serviceBehaviors>
   <behavior name="ServiceBehavior">
      <workflowRuntime name="WorkflowServiceHostRuntime"
                       validateOnCreate="true"
                       enablePerformanceCounters="true">
         <commonParameters>
            <add name="ConnectionString" value="Initial Catalog=WorkflowStore;Data Source=localhost;Integrated Security=SSPI;" />
            <add name="EnableRetries" value="True" />
         </commonParameters>
         <services>
             <add type="NetFx.Checkin.Scenario.WorkflowServices.WorkflowBasedServices.Common.TestPersistenceService.FilePersistenceService, NetFx.Checkin.Scenario.WorkflowServices.WorkflowBasedServices.Common"/>
         </services>
      </workflowRuntime>
   </behavior>
</serviceBehaviors>

See Also

Reference

WorkflowRuntimeElement
WorkflowRuntimeServiceElement
WorkflowRuntime

Other Resources

Workflow Configuration Files