views:

47

answers:

1

I'm new to Workflow Foundation. I've worked my way through one book (K. Scott Allen's Programming Windows Workflow Foundation) which was okay but I'm left with several questions. The biggest one is 'where do I put the data'?

Throughout the book he uses the idea of a Bug Tracking system; the scenario isn't too far from what I want to do. His examples use a simple Bug class with three properties and nothing else and he just makes it a field on his activities and passes it around where necessary. But in the real world a bug report would probably have lines of text that you'd want to be searchable; my scenario certainly does. If all of this text is squirrelled away by the persistence service, how do I get at it for text searches?

In the real world, what do you do with your data?

+2  A: 

For simple keys or assciated foreign keys you can use the tracking service to store such key/value pairs in the database too and query them later by using the tracking information in the tracking tables.

For full text search you can store the data in additonal tables you are creating side-by-side to the original tables of the sql-persistence-service. You have to manually add and delete them in case of workflow ending or error.

Mischa
I guess I would key these tables on the workflowID? Although GUIDs as keys are frowned on in SQL, aren't they?
ssg31415926
Yes you have to reference the WorkflowId as GUID in these tables.Personally I think that GUID are a good choice for keys in databases. Sure there are scenarios with partitioned tables etc. that have benefits with e.g. integers but in general objects are normally created with any programming language at runtime in memory and persistet "later" in databases. So GUIDs are good because you can define the identity of an object instance at runtime in memory without changing it by persisting to the database.
Mischa
Fair enough. I'm no DBA: I just do as I'm told. :-) Going back to your original answer, I'm thinking that we're unlikely to want to delete the text-search-data when the workflow ends and probably rarely in the event of on error (unless it happens very early on) so that will simplify things. Thanks very much for your help.
ssg31415926