How to enter data into the delay activity
Hi--
I need to know how to use the delay activity. According the microsoft documentation, delay uses a timeInterval and one format it is supposed to use is "d.hh:mm:ss.ff" so if i wanted a delay of 1 second, i should enter "0.00:00:01.00" when i run this in the workflow designer simulator, the simulator enters an idle state and does not break out a 1 second. what is the proper way to use the delay activity and the proper way to enter the time interval.
Jeff
-
I'd be interested to know this as well, especially as there's very little information in the help for this activity. Setting it to 00:00:01 doesn't seem to set it to minutes or seconds from the little testing I've done.
0 -
Hi Mark and Jeff,
The argument type is a TimeSpan (http://msdn.microsoft.com/en-us/library/System.TimeSpan.aspx) . To assign a one second TimeSpan to the argument you can use the TimeSpan constructor:
new TimeSpan(0, 0, 1)
or, use this static method:
TimeSpan.FromSeconds(1)
A word of warning: The Delay activity is only appropriate in a few scenarios. If you use a Delay and your workflow does not have any other activities running at the same time as the Delay activity (typically on other branches of a Parallel activity) the whole workflow will become idle. This is a scenario that we do not support (or plan to).
Can you describe your scenario and the purpose for the Delay?
You might want to consider whether the External Delay activity is the right fit for your application. This activity causes the workflow to unload, return to the client application, wait for the configured delay interval, and then return to the server to resume the workflow.
--Ryan
0 -
Ryan,
Thank you for this explanation. It was important for us to know that the Delay activity required a parallel activity in order to not become idle. The External Delay activity was the correct activity to meet our need to delay execution, for a few seconds, of SwitchToLegendView on map initiation, even though the name "External Delay" did not intuitively indicate this.
Thanks again for the thorough response to Jeff and Mark.
0 -
Ryan -
Even 7 years later, I still appreciate your clarification of the Delay activity.
Thanks!0
Please sign in to leave a comment.
Comments
4 comments