Search code examples
workflow-foundationworkflow-foundation-4

Wake Up Sequential Workflow Service


I need to be able to "wake up" a sequential workflow service - and this concept worked in a State Machine previously so I'm not understanding why it doesn't work in the Sequence. Below is a picture of the workflow.

Orchestrator Sequence

This workflow is used for orchestration of other workflow services. It literally needs to run forever - but we need the ability to shut it down softly. Previously I had this same type of thing implemented in a State Machine, the Delay was the trigger for one transition and the Receive was the trigger for another. As long as the first mentioned transition wasn't running I was able to get the Receive to take the message and transition to the final state. Here what I want to do, as you can see, is just set the boolean value to False indicating that the While loop should exit and thus the workflow would terminate.

Please help me understand why this isn't working.

Thanks all!

Edited for Diagnostic Output

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

Solution

  • You should get some tracking data - this will help you to understand what is going on. See Troubleshooting Workflow Services with diagnostic logging