我需要能够“唤醒”顺序工作流服务 - 这个概念之前在状态机中工作,所以我不明白为什么它在序列中不起作用。下面是工作流程的图片。
此工作流用于编排其他工作流服务。它确实需要永远运行 - 但我们需要能够轻柔地关闭它。以前我在状态机中实现了相同类型的事情,延迟是一次转换的触发器,接收是另一个转换的触发器。只要第一次提到的转换没有运行,我就能够让Receive接收消息并转换到最终状态。正如您所看到的,我想要做的就是将布尔值设置为False,表示While循环应该退出,因此工作流将终止。
请帮助我理解为什么这不起作用。
全部谢谢!
编辑了诊断输出
32: Activity [1] "Main Sequence" scheduled child activity [4] "While"
33: Activity [4] "While" is Executing
{
Variables
continueRunning: True
}
34: Activity [4] "While" scheduled child activity [6] "VisualBasicValue<Boolean>"
35: Activity [6] "VisualBasicValue<Boolean>" is Executing
36: Activity [6] "VisualBasicValue<Boolean>" is Closed
{
Arguments
Result: True
}
37: Activity [4] "While" scheduled child activity [8] "Pick"
38: Activity [8] "Pick" is Executing
39: Activity [8] "Pick" scheduled child activity [9] "Soft Exit Branch"
40: Activity [8] "Pick" scheduled child activity [26] "Process Branch"
41: Activity [26] "Process Branch" is Executing
42: Activity [26] "Process Branch" scheduled child activity [42] "Delay"
43: Activity [42] "Delay" is Executing
{
Arguments
Duration: 00:01:00
}
44: Activity [9] "Soft Exit Branch" is Executing
45: Activity [9] "Soft Exit Branch" scheduled child activity [14] "Soft Exit Sequence"
46: Activity [14] "Soft Exit Sequence" is Executing
{
Variables
__handle1: System.ServiceModel.Activities.CorrelationHandle
}
47: Activity [14] "Soft Exit Sequence" scheduled child activity [21] "Soft Exit"
48: Activity [21] "Soft Exit" is Executing
{
Arguments
CorrelatesWith: System.ServiceModel.Activities.CorrelationHandle
Parameter0: System.ServiceModel.Activities.CorrelationHandle
}
49: Activity [21] "Soft Exit" scheduled child activity [21.1] "Sequence"
50: Activity [21.1] "Sequence" is Executing
{
Variables
RequestMessage:
ReceiveNoPersistHandle: System.Activities.NoPersistHandle
}
51: Activity [21.1] "Sequence" scheduled child activity [21.6] "InternalReceiveMessage"
52: Activity [21.6] "InternalReceiveMessage" is Executing
{
Arguments
CorrelatesWith: System.ServiceModel.Activities.CorrelationHandle
noPersistHandle: System.Activities.NoPersistHandle
Parameter0: System.ServiceModel.Activities.CorrelationHandle
}
53: WorkflowInstance "Main Sequence" is Idle
54: WorkflowInstance "Main Sequence" is Persisted
The thread '.0' (0x1fa4) has exited with code 0 (0x0).
The thread 'DebuggerThread:Soft Exit Branch.1' (0x13b4) has exited with code 0 (0x0).
55: WorkflowInstance "Main Sequence" is Unloaded
答案 0 :(得分:3)
您应该获得一些跟踪数据 - 这将有助于您了解正在发生的事情。见Troubleshooting Workflow Services with diagnostic logging
答案 1 :(得分:0)
我已经解决了这个问题。这个问题与相关性有关,我应该知道的更好。每个Receive / Send-Reply序列都有自己的发送 - 应答相关句柄的本地__handle1变量。但是,我试图使用它来关联消息以使用SoftExit唤醒序列。我创建了一个新的关联句柄__liveHandle,我在离开开始序列时初始化,然后在软退出序列中的该句柄上进行关联 - 已解决。
谢谢@RonJacobs!
答案 2 :(得分:0)
此WorkFlow与Visual Studio Framework 3.5一起出现。 可以使用Framework 4.0中的Active Library或使用Workflow Console Application来完成类似的活动。
我只是想添加这个,因为很多人说他们不能看到Visual Studio中的顺序工作流程。 虽然我们可以使用它来创建仅使用Visual Studio(没有SharePoint / WSS / MOSS / SP2010或Designer)的工作流程。但它不是一个好的IDEA,因为它需要看看OOB项目的开发工作。 最好的方法应该是使用SPD ..或使用MOSS的工作流功能。
使用VS来创建审批工作流程也很痛苦。 我很快就会创建一个wil paste ..