我需要能夠「喚醒」順序工作流服務 - 而這個概念用狀態機工作之前,所以我不明白爲什麼它不會在序列工作。以下是工作流程的圖片。喚醒順序工作流服務
此工作流用於其他工作流服務編排。它實際上需要永遠運行 - 但我們需要能夠輕柔地關閉它。以前,我在狀態機中實現了相同類型的事情,延遲是一次轉換的觸發器,接收是另一次轉換的觸發器。只要第一次提到的轉換沒有運行,我就可以讓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
感謝@RonJacobs - 我將讓你知道我的發現。老實說,我發現跟蹤參與者爲WF創造了一個最有用的工具。但由於某種原因,我沒有使用它 - 我的歉意! – 2012-03-11 20:13:41
我更新的問題,以顯示診斷輸出 - 如果我沒有記錯的選擇,其中安排兩個觸發器,當然都被設置書籤,以便工作流程,然後會空閒 - 但唯一的觸發器,將喚醒工作流程即使發送消息到SoftExit也是延遲。 – 2012-03-12 12:16:34
謝謝 - 追蹤的擴展對我的工作也非常有用。我希望將這些納入未來的核心框架。 – 2012-03-20 15:21:05