September 2010
Intermediate to advanced
272 pages
5h 16m
English
When a workflow is running and we want to send a message to the workflow during run time, how can we achieve this? We can use Bookmark to achieve this. In this task, we will create an activity using Bookmark, which will function as a message input activity.
Add a new code file to the ActivityLibrary project named InputMessage.cs. Then, replace all the default code with the following code:
using System.Activities; public class InputMessage<T>:NativeActivity { public InArgument<string> bookmarkName { get; set; } public OutArgument<T> result { get; set; } protected override void Execute(NativeActivityContext context){ context.CreateBookmark(bookmarkName.Get(context), ...