Custom SQL work flow service

Topics: Developer Forum
Feb 27, 2007 at 1:24 AM

I have a need to serialize work flow activates as XML ‘not’ binary format. so I have gone down the path of a custom sql work flow service which will give me the capability to override methods that serialize and de-serialize. However, I have questions that need answering prior to doing this:

Do I change the underling 'state' table schema within the work flow db schema from binary column to ntext or create a new table and write to it instead.
The second choice seems the most likely but then I need to override more methods across types.

Do I create new db tables or just modify the existing state table.

Direction would be much appreciated.
Sonny M
Feb 27, 2007 at 10:45 PM

I've done some further digging around and come to the following conclusion:

To code a custom persistence service the base class(WorkflowPersistenceService, IPendingWork) needs to be inherited. They have a dependency on the 'Activity' class which also has a dependency on PendingWorkItem class.
the 'pending workItem' class can be described as a container for the serialized work flow object. The property within the class 'public byte[] SerializedActivity;
' that contains the data is byte[] which means we can only use binary formatter :(.

So regardless of the custom state service we write, we are locked into using binary formatter unless we re-code some of the work flow engine and change the db schemes for state table, which makes it a custom solution for the one workflow which is not good.

I'm hoping i my view has a short fall and that someone can explain another option, help much appreciated.

Sonny M

  • I’m surprised there is no config attribute to explicitly defined the serialization method just like majority of other .Net providers.
Feb 28, 2007 at 9:48 AM
Can you please describe from what requirement you want to be able to use a different persistence format then binary?

I can't think of a reason why you woul want this. If it is to be able to query status of a workflow from persistence that you need to use the tracking services in stead. It is a common misunderstanding that people want to query the persistence store for status information, but the persistence store is only used for providing workflow robustness.

Also be aware of the fact that persistence data contains more then the activity tree, because it needs also to keep track of work already done so a compensation can be initiated after persistence has occured.

Can you give me an idea of the usecase for what you are trying to chage persistence format?

Feb 28, 2007 at 11:51 AM

I have a situation where a web workflow has activates associated with quotes, I need away for customer support to query the database to find out what state a person putting in a quote is at. Produce reports using MS reporting service ( no need to create an instance of the work flow.

1) The ‘User Data; property in the work flow contains strongly typed object also serializable, lets say customer data contract (first name last name) used to identify the work flow instance the client is using.

2) Page flow is also used with the work flow in a web environment.
3) I want to have the ability to query the database with out creating an instance of the work flow, Admin pages that just query the work flow database.

• My understanding of tracking is that it contains meta-data about activities and events, no actual data such as user data within the work flow. But, will go back and look into the tracking. The instance is still in binary format.

If I have the ability to query the database, then I can allow customer support to find a specific instance within the work flow and override the instance, take over it and finish the work flow for a customer.

• Hope that makes sense

Sonny M
Mar 12, 2007 at 6:38 AM
Sonny, You definitly need to look at tracking. Use tracking Extracts to get the data you want and define some tables you feel comfortable with for querying.

Persistency is absolutely not the place for querying running instances.
May 3, 2007 at 5:43 AM

Yes your right, querying instance is not the place, and i'm now glade that binary formating is used for serialisation.
Tracking extracts are designed for querying state.

Sonny M