0
votes

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
3

3 Answers

3
votes

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

0
votes

I have solved the problem. The issue was related to correlation and I should have known better. Each Receive/Send-Reply sequence had its own local __handle1 variable for the Send-Reply correlation handle. However, I was trying to use that to correlate the message to wake up the sequence in with SoftExit. I created a new correlation handle __liveHandle that I initialized when leaving the Start Sequence and then correlated on that handle in the Soft Exit Sequence - solved.

Thanks @RonJacobs!

0
votes

This WorkFlow is Present with Visual Studio Framework 3.5.. The similar activities can be done using Active Library in Framework 4.0 or use Workflow Console Application.

I just wanted to add this because many person says that they are not ABle to see the Sequential Workflow in Visual Studio.. Although we can use this to create Workflows just using Visual Studio(No SharePoint/WSS/MOSS/SP2010 or Designer)..But it is not a Good IDEA as it requires look of Development work for the Items which is OOB .. The Best way should be using SPD.. Or Workflow features using MOSS.

Also Creating Approval Workflows is Painful using just VS.. I am creating one wil paste soon..