WorkflowInstanceEvent details not created from ASP.net when workflow contains DELAY  
Author Message
sam-pan





PostPosted: Windows Workflow Foundation, WorkflowInstanceEvent details not created from ASP.net when workflow contains DELAY Top

When I run the same workflow without any Delay in ASP.net records are logged to WorkflowInstanceEvent and ActivityInstance table.

But, when delay activity is in the workflow records are not created in WorkflowInstanceEvent and ActivityInstance table. Record is created in WorkflowInstance table though.

Please Help me...

I am trying to have both persistance and tracking.

My Web.config file contains:

<WorkflowRuntime Name="WorkflowRuntime">

<CommonParameters>

<add name="ConnectionString" value="Initial Catalog=tracking;Data Source=localhost;Integrated Security=SSPI;" />

</CommonParameters>

<Services>

<add type="System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" maxQueuedWorkItems="20"/>

<add type="System.Workflow.Runtime.Hosting.SharedConnectionWorkflowTransactionService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

<add type="System.Workflow.Runtime.Tracking.SqlTrackingService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

</Services>

</WorkflowRuntime>

ASPx.cs is prety besic same as Example:

// Get a reference to the Workflow Runtime through the WorkflowWebHostingModule

// Http Module.

//

// NOTE: This requires the configuration section to be named "WorkflowRuntime".

WorkflowRuntime workflowRuntime = WorkflowWebRequestContext.Current.WorkflowRuntime;

// Now get a refernece to the ManualWorkflowSchedulerService

ManualWorkflowSchedulerService scheduler =

workflowRuntime.GetService<ManualWorkflowSchedulerService>();

// Attach to the WorkflowCompleted event

workflowRuntime.WorkflowCompleted +=

new EventHandler<WorkflowCompletedEventArgs>(WorkflowRuntime_WorkflowCompleted);

// Start the Workflow1

WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(

typeof(WorkflowLibrary1.differentWorkflow));

workflowInstance.Start();

// Now run the workflow. This is necessary when

// ...using the ManualWorkflowSchedulerService

scheduler.RunWorkflow(workflowInstance.InstanceId);



Software Development for Windows Vista7  
 
 
sam-pan





PostPosted: Windows Workflow Foundation, WorkflowInstanceEvent details not created from ASP.net when workflow contains DELAY Top

It did work when I changed the system.config from

<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

to

<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UnloadOnIdle="true" />

But Don't you think it is a bug

Sorry for asking more Questions Here:

I observed when the sql persistance is on the next time workflowRuntime starts it runs all not completed workflows, Which works well if it is console application.

But when workflowRuntime starts from ASP.net it does not pick up the uncompleted workflows from InstanceState table.

Folks have u an answer for this


 
 
Angel Azcarraga - MSFT





PostPosted: Windows Workflow Foundation, WorkflowInstanceEvent details not created from ASP.net when workflow contains DELAY Top

Please ensure that you are using the ManualWorkflowScheduler or threading can get a little messy in ASP.NET. Also, have you tried it on later bits (i.e. RTM)

Thanks!
Angel