工作流开发:创建队列活动与事件驱动活动指南
创建队列活动
在工作流开发中,创建队列活动是一项重要的技能,它能帮助我们实现工作流中的数据传递和处理。以下是创建和运行队列活动的详细步骤:
1. 添加自定义运行时服务 :
workflowRuntime.AddService(new CustomerQueuedFromService(workflowRuntime));
- 移除主机中的部分代码 :由于数据现在通过服务传递到队列,而不是通过主机,所以要从主机中移除以下代码:
//send some data to the event activity
Console.WriteLine("Enter the customer number: ");
string custNumber = Console.ReadLine();
instance.EnqueueItem("basicQueued1", custNumber, null, null);
- 运行工作流 :
- 打开 Workflow1 设计模式,移除 BasicQueued 活动,并用 CustomerQueuedFromServiceActivity 替换。在 CustomerNumber 属性中输入
超级会员免费看
订阅专栏 解锁全文
1365

被折叠的 条评论
为什么被折叠?



