<workflowIdle>
A service behavior that controls when idle workflow instances are unloaded and persisted.
<configuration>
<system.ServiceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<workflowIdle>
Syntax
<behaviors>
<serviceBehaviors>
<behavior name="String">
<workflowIdle timeToPersist="TimeSpan"
timeToUnload="TimeSpan" />
</behavior>
</serviceBehaviors>
</behaviors>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute | Description |
---|---|
timeToPersist | A Timespan value that specifies the duration between the time the workflow becomes idle and is persisted. The default value is TimeSpan.MaxValue. The duration begins to elapse when the workflow instance becomes idle. This attribute is useful if you want to persist a workflow instance more aggressively while still keeping the instance in memory for as long as possible. This attribute is only valid if its value is less than the timeToUnload attribute. If it is greater, it is ignored. If this attribute elapses before the value specified by the timeToUnload attribute, persistence must complete before the workflow is unloaded. This implies that the unload operation may be delayed until the workflow is persisted. The persistence layer is responsible for handling any retries for transient errors and only throws exceptions on non-recoverable errors. Therefore, any exceptions thrown during persistence are treated as fatal and the workflow instance is aborted. |
timeToUnload | A Timespan value that specifies the duration between the time the workflow becomes idle and is unloaded. The default value is 1 minute. Unloading a workflow implies that it is also persisted. If this attribute is set to zero the workflow instance is persisted and unloaded immediately after the workflow becomes idle. Setting this attribute to TimeSpan.MaxValue effectively disables the unload operation. Idle workflow instances are never unloaded. |
Child Elements
None.
Parent Elements
Element | Description |
---|---|
<behavior> of <serviceBehaviors> | Specifies a behavior element. |
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.