Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Workflow ending in slow server environment

Reply
 
Old 01-26-2009   #1 (permalink)


Windows XP
 
 

Workflow ending in slow server environment

Hi,
I have a problem in my workflow where the workflow ends when its running in a slow environment.
Its a state machine workflow using xoml files.
My problem is the following:
The client has been facing problems were the workflow ends prematurely. This occurs at random times.
After looking into this I found that everytime I debug the application and step through the code the overriden method Cancel of Activity class is entered, hence the workflow ends.
When I run the application normally it works fine. So my thinking is when the workflow is ran under a slow environment it somehow enters the Cancel method.
Further, I added some Thread.Sleep snippets in the code and ran the app. Again the workflow ends when it shouldn't.
So my thinking is when the workflow is ran under a slow environment it somehow enters the Cancel method. Why this happens I do not know.
The code was taken from the following sample http://www.microsoft.com/downloads/details.aspx?FamilyId=A438A9B9-9F15-42EC-866F-2EA58E10DB36&displaylang=en
Does anyone know why it ends? or how I can find out why the Cancel method is entered?

My System SpecsSystem Spec
Old 01-26-2009   #2 (permalink)
Norman Yuan


 
 

Re: Workflow ending in slow server environment

Not knowing what the workflow does, I cannot say why the slow execution
would "end" (terminate, I'd say, read on).

One default workflow feature is that if the the wrokflow runs into an
unhandled exception, it terminates. So, it looks like your workflow comes
accross an exception in certain condition (slow execution. Does the workflow
start an async thread and is supposed to wait for a result before
continue?). Try to add reasonable workflow exception handling and tracking
it when happens at relevent activities.


"jitesh83" <guest@xxxxxx-email.com> wrote in message
news:2b1c24d3c177dd6ac82964241ace3440@xxxxxx-gateway.com...
Quote:

>
> Hi,
> I have a problem in my workflow where the workflow ends when its
> running in a slow environment.
> Its a state machine workflow using xoml files.
> My problem is the following:
> The client has been facing problems were the workflow ends prematurely.
> This occurs at random times.
> After looking into this I found that everytime I debug the application
> and step through the code the overriden method Cancel of Activity class
> is entered, hence the workflow ends.
> When I run the application normally it works fine. So my thinking is
> when the workflow is ran under a slow environment it somehow enters the
> Cancel method.
> Further, I added some Thread.Sleep snippets in the code and ran the
> app. Again the workflow ends when it shouldn't.
> So my thinking is when the workflow is ran under a slow environment it
> somehow enters the Cancel method. Why this happens I do not know.
> The code was taken from the following sample
> '_http://www.microsoft.com/downloads/details.aspx?FamilyId=A438A9B9-9F15-42EC-866F-2EA58E10DB36&displaylang=en_'
> (http://www.microsoft.com/downloads/d...displaylang=en)
>
> Does anyone know why it ends? or how I can find out why the Cancel
> method is entered?
>
>
> --
> jitesh83
My System SpecsSystem Spec
Old 01-26-2009   #3 (permalink)


Windows XP
 
 

Re: Workflow ending in slow server environment

Thanks for the help.
I had been previously trying to add exception handling but I couldn't successfully do this.

The problem is the workflow successfully passes through the Execute method and then straight away enters the Cancel method.

protected override ActivityExecutionStatus Execute(ActivityExecutionContext context)
{

try{

//my code here

}
catch
{

}

return ActivityExecutionStatus.Executing;

}


How can I catch the exception? I've tried 'try-catch' block but this doesn't work.

The workflow is not started in an async thread. I'm using the ManualWorkflowSchedulerService class to start the workflow.

Is there a way to catch all exceptions thrown by the workflow?
My System SpecsSystem Spec
Old 01-27-2009   #4 (permalink)
Norman Yuan


 
 

Re: Workflow ending in slow server environment

The first thing you can do is to create a WorkflowTerminated event handler
at workflow level. The handler has a WorkflowTerminatedEventArgs argument.
In this event handler, you examine WorkflowTerminateEventArgs.Exception
property to see what the exception type is and what is the exception's
message.

Then look into FaultHandlerActivity. FaultHandlerActivity can be used at
workflow level, or container type activity (such as SequenceActivity) level.


"jitesh83" <guest@xxxxxx-email.com> wrote in message
news:e78ce1f30247d8ea526b61ec645624b4@xxxxxx-gateway.com...
Quote:

>
> Thanks for the help.
> I had been previously trying to add exception handling but I couldn't
> successfully do this.
>
> The problem is the workflow successfully passes through the Execute
> method and then straight away enters the Cancel method.
>
> protected override ActivityExecutionStatus
> Execute(ActivityExecutionContext context)
> {
>
> try{
>
> //my code here
>
> }
> catch
> {
>
> }
>
> return ActivityExecutionStatus.Executing;
>
> }
>
>
> How can I catch the exception? I've tried 'try-catch' block but this
> doesn't work.
>
> The workflow is not started in an async thread. I'm using the
> ManualWorkflowSchedulerService class to start the workflow.
>
> Is there a way to catch all exceptions thrown by the workflow?
>
>
> --
> jitesh83
My System SpecsSystem Spec
Old 01-27-2009   #5 (permalink)


Windows XP
 
 

Re: Workflow ending in slow server environment

Thanks for your help. Its much appreciated!!
My System SpecsSystem Spec
Old 01-27-2009   #6 (permalink)
Norman Yuan


 
 

Re: Workflow ending in slow server environment

This article might be of help:

http://msdn.microsoft.com/en-ca/magazine/dd419656.aspx


"jitesh83" <guest@xxxxxx-email.com> wrote in message
news:ae5cc0449c34c32178e62b347718996b@xxxxxx-gateway.com...
Quote:

>
> Thanks for your help. Its much appreciated!!
>
>
> --
> jitesh83
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Running App in design environment is very slow .NET General
CAL for Windows Server 2008 in a Terminal Server environment .NET General
PC slow in development environment .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46