Girish Pawar

I am using sqlPersistenceservice...

In one of the states i have implemented 2 eventdrivenactivities...

1.Waiting for a event.if event happen change to state A.

2.Waiting for timeout of 1 minute... if timeout happens i change the state to state B.

But it doesn't seem to work.

Even after 1 minute the workflow stays in the same state...

What must i do



Re: Windows Workflow Foundation Mo Help to implement timeout in statemachines.

Girish Pawar

This is Girish.

I have a similar problem...

I have a situation where ..

                       Listen

          -----------------------------------------

         |                                                  |

eventA                                           Delay = 1min

change to stateA                          change to stateB

So did the following thing...in stateMachine

1.EventDrivenActivity1

         HandleExternalEvent1

         change state to stateA

2.EventDrivenActivity2

       DelayActivity = 1min

       change state to stateB

I am using SqlPersistenceService

But even after timeout the workflow remains in the same state waiting for HandleExternalActivity1....

What should i do

 Girish Pawar wrote:

I am using sqlPersistenceservice...

In one of the states i have implemented 2 eventdrivenactivities...

1.Waiting for a event.if event happen change to state A.

2.Waiting for timeout of 1 minute... if timeout happens i change the state to state B.

But it doesn't seem to work.

Even after 1 minute the workflow stays in the same state...

The problem is that workflow goes to idle state when it encounters two events, so timeout is having no effect(even after i removed SqlPersistenceService).

What must i do





Re: Windows Workflow Foundation Mo Help to implement timeout in statemachines.

Tom Lake - MSFT

Try the following:

<StateMachineWorkflowActivity x:Class="WorkflowConsoleApplication100.Workflow1" InitialStateName="InitialState" x:Name="Workflow1" CompletedStateName="{x:Null}" DynamicUpdateCondition="{x:Null}" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow">

<StateActivity x:Name="StateA" />

<StateActivity x:Name="StateB" />

<StateActivity x:Name="InitialState">

<EventDrivenActivity x:Name="eventDrivenActivity1">

<HandleExternalEventActivity x:Name="handleExternalEventActivity1" />

<SetStateActivity x:Name="setStateActivity1" TargetStateName="StateA" />

</EventDrivenActivity>

<EventDrivenActivity x:Name="eventDrivenActivity2">

<DelayActivity TimeoutDuration="00:01:00" x:Name="delayActivity1" />

<SetStateActivity x:Name="setStateActivity2" TargetStateName="StateB" />

</EventDrivenActivity>

</StateActivity>

</StateMachineWorkflowActivity>






Re: Windows Workflow Foundation Mo Help to implement timeout in statemachines.

Girish Pawar

i haven't tried what u have suggested...

but i think the problem is with ManualWorkflowSchedulerService.....

right now if i use ManualWorkflowSchedulerService it donot work ...

if i use a DefaultWorkflowSchedulerService, it works perfect...

But the problem is that i am working on ASP.Net, so it is better to use ManualWorkflowSchedulerService.

Is there any way that i can use ManualWorkflowSchedulerService...

Please Help.





Re: Windows Workflow Foundation Mo Help to implement timeout in statemachines.

Tom Lake - MSFT

Make sure you have UseActiveTimers set to true on the manual scheduler so that the delay expiration will be handled correctly. Are you calling manualScheduler.RunWorkflow(instanceId) after raising the event Take a look at the sample here.




Re: Windows Workflow Foundation Mo Help to implement timeout in statemachines.

Girish Pawar

Thanks Tom it works...!

Thank you very much.