Tuesday, December 23, 2008
"Table of Contents" webpart is missing
I tried different things to get the webpart in a trial and error manner. At last i was able to get this webpart after activating the "Publishing features".
In my previous project i activated the "Publishing features" for some other purpose, which also added the TOC webpart. So, when i tried to add the TOC webpart it was available right there. I didn't realise it is part of "Publishing features".
Wednesday, December 17, 2008
Persistence in SharePoint workflow
- to release the memory taken by workflow for execution
- to restore its state during the hardware failure
- to maintain the scalability of system
So, it is best practice to implement SqlWorkflowPersistenceService and using that we can persist the data in SQL database. This is the out of the box class provided by Microsoft for using SQL db as data store. But if we are going to use different data store we need to create our own persistence service class by inheriting the WorkflowPersistenceService class. Here is a good example given in this blog(http://www.devx.com/dotnet/Article/32247/0) to implement persistence using SqlWorkflowPersistenceService
Well , but what is happening in SharePoint workflows is entirely different process. We will not be having access to the workflow host application like windows workflows. Here SharePoint is hosting the workflow and the persistence service is implemented in it using SqlWorkflowPersistenceService. So, when a SharePoint workflow's controls goes in to some event based activities like "OnTaskChanged" or "OnTaskDeleted" activity, the workflow's state is dehydrated or persisted automatically in to the ContentDB of the particular SharePoint web application.
We can't implement our own persistence logic here because it should be written in the workflow host application rather than the workflow application. While developing SharePoint workflows we will not be having our own separate workflow host application because SharePoint is actually the host and controls the workflow execution. It is still using the workflow runtime to execute the workflows. But it is customized lot to support MOSS with lot of additional features. Persistence is one among those features.
Persistence in MOSS is implemented by SPWinOePersistenceService which is actually inherited from SqlWorkflowPersistenceService. It stores the workflow state in the Workflow table of the ContentDB.
The following picture shows that the workflow's instance state are actually stored in the "Instancedatasize" column of the table.
Once the workflow is completed the instance data is actually released from the database.