How to Configure the Delay Shape

Image that represents the Delay shape.
Delay shape

There are two ways to specify the timeout for a Delay:

  • You can use System.DateTime, which causes your orchestration to pause until the specified date and time is reached.

    System.DateTime.UtcNow.AddSeconds(60)

    Note

    Delays must be expressed in Coordinated Universal Time (UTC) when using DateTime.

  • You can use System.TimeSpan, which causes your orchestration to pause for the specified length of time.

    System.TimeSpan(0, 1, 0)

    If your Delay shape is inside a Listen shape, you do not need to add a semicolon at the end of the expression.

    For more information about System.DateTime and System.TimeSpan, see "DateTime Structure" and "TimeSpan Structure" in the Visual Studio Combined Collection.

Note

In a multiple machines installation environment where BizTalk Server and SQL Server are installed on separated machines, the Delay shape may end earlier than expected because of the times on BizTalk Server and SQL Server machines are unsynchronized.

Note

Under the stress condition, the timeout specified in the Delay shape may occur later than what you have specified. This is because of the thread starvation under the stress condition.

To configure a Delay shape

  1. If BizTalk Expression Editor is not visible, right-click the Delay shape and click Edit Delay, or in the Properties window, click the Ellipsis (...) button for the Expression property.

  2. In BizTalk Expression Editor, create an expression that returns a System.DateTime object or a System.TimeSpan object. For more information, see Requirements and Limitations for Expressions.