index > Windows Workflow Foundation > Any Utils Available To Sync Activities With SqlTrackingService?

Any Utils Available To Sync Activities With SqlTrackingService?

Hi,

Specifically synch'ing between the workflow and the Tracking DB - Activity table?

I've been playing around with a simple doc approval workflow and today wanted to add some approval timeouts. So, I added a couple of EventDrivenActivity items with appropriate DelayActivities, etc. and ADDED a couple of trackData() calls to log some info. This broke the SqlTrackingService stuff when retrieving the ActivityTrackingRecord data with sql null value errors.

I managed to chase it down to the new activities not being defined in the Activity table. I manually added them with the right type identifier and voila! - the SqlPersistenceService objects (eg, ActivityTrackingRecord) started to function again.

I was just wondering if there's a utility available which scans the workflow definition and adds missing activities to the workflow's activity definitions in the default persistence store.

I've read the versioning recommendations in other threads and while they're valid for major overhauls to the workflow interface, when I'm simply adding an activity to a workflow and NOT REMOVING any of the existing interface, it would be nice to be able to do this and preserve existing tracking items without creating new versions of everything. I mean, it all kinda looks to be a matter of "reflection"

Just a thought....


Shawn






Shawn
shware

Hi Shawn,

Thanks for the feedback. Can you give more details on how you got the sql null value errors? Can you give more details on the workflow you used? Are you using the default sql traking profile? Any other detail that could help me reproduce it will be useful.

Thanks

Ranjesh J
Hi,

Thanks for the response and interest.

I can reproduce this every time now.

Persistence / Tracking are out of the box SQL providers.

Workflow is a state machine with 3 states - WaitingForCreate, PendingApproval, and Processed.

PendingApproval state initially had 3 event driven activities with each first child being handleExternalEvent.

Then I added 2 more event driven activities to PendingApproval state with each first child being delay activities that when expired send an email and generate a user tracking item (this.trackData()). I was wanting to put some time controls on responses from approvers.

Simply adding the 2 event drivens with delays and rebuilding the workflow library caused the problem when retrieving the ActivityTrackingRecords via the SqlTrackingWorkflowInstance.ActivityEvents
shware
Hi,

I just ran another quick test and added another eventdriven activity whose first child is handleExternalEvent and trigger it. The same issue occurs.

I was kinda thinking that the problem may be the delayactivity not being fired from an external event.

Thanks!


Shawn



Shawn
shware

Hi Shawn,

I am able to repro this issue. This is a versioning issue and cleaning out the database should fix it or providing a new version should fix it. But I agree with you that this is painful to do. There are no tools that we have currently that do what you are asking for. In either case, we should not be getting the SqlNullValueException. I have logged a bug for these issues. Thanks for your feedback.

Ranjesh J

Ranjesh J

Hi Shawn,

Here is an easy way out. You could force VS to create a new version of the assembly everytime you rebuild it by setting th AssemblyVersion to "1.0.*" in the AssemblyInfo.cs file. This should make sure that the versioning is correct during development time. Later when you want to deploy you can switch it back to what you need it to be. Hope this helps.

Ranjesh J

Ranjesh J

Okay, so for the record I was getting this same exception when accessing the SqlTrackingWorkflowInstance.ActivityEvents property and when I cleared the contents of the tacking database it went away :-).

So thanks to Shawn and Ranjesh for sharing this discussion.

Does this mean, though, that if I change the definition of my workflow in any way and I don't re-version the assembly that it contains then I will need to clear the tracking database? Or have I misunderstood something?

thanx -- /chris

csrking

Hi shawn,

I have made a state machine workflow with 4 events like defectcreated, defectreviewed, defectfixed, defectapproved

I am using the SQLTrackingServices to persist the values into the database However the state is not maintained in the database, but the instances are inserted in the workflowinstance table.

can you please tell me what I am doing wrong ?

thanks in advance

Bala

bala_excel

Hi shawn,

the values are persisted when the workflow is completed or terminated

when i hang up application in the middle states i am not getting the activity events persisted in the DB

pls tell me what I am doing wrong

thanks in advance

Bala

bala_excel
Hi Bala, in order to track some workflow properties of your workflow with the SqlTrackingService, you should use a tracking profile and set the IsTransactional property of the tracking Service to false:

SqlTrackingService trackingService = new SqlTrackingService(trackingConnectionString);
trackingService.IsTransactional = false;

check https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=221518&SiteID=1

Cheers!
Ariel Schapiro
aschapiro
reply 10

You can use google to search for other answers

 

More Articles

• How to use the cancel handler?
• Xoml customization and compilation
• Monitoring with workflow
• SqlWorkflowPersistenceService not loading all instances
• Making a GUI subservient to the WF
• Asp.Net Hosted Workflows - Best Practices for Delay Handling
• How do I Pass Values from an Event Sink
• Asp.Net, state machine workflow, delay activity for notification
• Visual representation of my workflow
• Does WF support transactions?
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Exception in .NET 3.0 SDK WorkflowMonito
• how to implement human workflow using St
• Exception thrown when adding children ac
• How to handle event in called workflow
• ASP.NET Smart Page Navigation thorugh WWF
• Repeat processing for multiple users in
• Problems printing Workflows from Workflo
• Is it possible to exchange a running wor
• How to handle errors in EventSinkActivity?
• invoke sub StateMachine workflow
• Does design any workflow need a new proj
• How do you host WWF 3.0 as a webservice
• How to pass a GUID to a WebServiceInput
• Workflow instances within a single Workf
• State Machine and EventSinks in VB

Hot Articles

• Windows Service and Worflow versioning
• Basic questions: Save state, users contr
• Output path property settings
• Can Beta2 be insatlled and used without
• ToolboxBitmap
• Parameters
• multiple instances
• wf.Parameters
• event cannot be delivered
• StateMachine receiving events too fast?
• State Machine Workflow with multiple Com
• DependencyProperty collection editor in
• Publish WorkFlow as WebService doesn't w
• Workflow templates
• workflow versionning

Recommend Articles

• SqlStatePersistenceService troubles
• "Tracking workflows which are alrea
• Creating ActivityExecutionContext
• In sequential work flow , code condition
• Throwing SoapException between WS_Receiv
• Heavy action and thread blocking
• Page Flow - Details
• HandleExternalEventActivity hangs withou
• Run a Xoml from console application.
• Custom activity with dynamic properties
• Methods of base workflow not visible in
• ASP.Net & ManulScheduler Nightmares...
• WorkflowInstance.EnqueueItem Method
• can wwf use oracle but not SQL Server?
• SqlTrackingQuery