2012-03-09 115 views
0

我需要能夠「喚醒」順序工作流服務 - 而這個概念用狀態機工作之前,所以我不明白爲什麼它不會在序列工作。以下是工作流程的圖片。喚醒順序工作流服務

Orchestrator Sequence

此工作流用於其他工作流服務編排。它實際上需要永遠運行 - 但我們需要能夠輕柔地關閉它。以前,我在狀態機中實現了相同類型的事情,延遲是一次轉換的觸發器,接收是另一次轉換的觸發器。只要第一次提到的轉換沒有運行,我就可以讓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 

回答

2

你應該得到一些跟蹤數據 - 這將幫助您瞭解正在發生的事情。見Troubleshooting Workflow Services with diagnostic logging

+0

感謝@RonJacobs - 我將讓你知道我的發現。老實說,我發現跟蹤參與者爲WF創造了一個最有用的工具。但由於某種原因,我沒有使用它 - 我的歉意! – 2012-03-11 20:13:41

+0

我更新的問題,以顯示診斷輸出 - 如果我沒有記錯的選擇,其中安排兩個觸發器,當然都被設置書籤,以便工作流程,然後會空閒 - 但唯一的觸發器,將喚醒工作流程即使發送消息到SoftExit也是延遲。 – 2012-03-12 12:16:34

+0

謝謝 - 追蹤的擴展對我的工作也非常有用。我希望將這些納入未來的核心框架。 – 2012-03-20 15:21:05

0

我已經解決了這個問題。這個問題與相關性有關,我應該知道的更好。每個接收/發送 - 應答序列都有其自己的本地__handle1變量,用於Send-Reply相關句柄。但是,我試圖使用它來關聯消息以使用SoftExit喚醒序列。我創建了一個新的關聯句柄__liveHandle,它在離開開始序列時初始化,然後在軟退出序列中關聯到該句柄上 - 已解決。

感謝@RonJacobs!

0

此WorkFlow與Visual Studio Framework 3.5一起存在.. 可以使用Framework 4.0中的Active Library或使用Workflow Console Application來完成類似的活動。

我只是想補充這一點,因爲很多人說,他們是無法看到的順序工作流在Visual Studio .. 雖然我們可以用它來創建工作流只是使用Visual Studio(在SharePoint/WSS/MOSS/SP2010或設計師)..但它不是一個好的IDEA,因爲它需要開發工作的項目是OOB .. 最好的方法應該使用SPD ..或使用MOSS的工作流功能。

還創建審批工作流是痛苦的只使用VS .. 我創建一個快貼WIL ..