I have a question about the SqlWorkflowPersistenceService... I have set up a simple workflow to submit an article and someone will accept/reject it. In my client I have a form to submit the text and it gets stored in a DB. My problem is that I don't understand the blocked-column in the DB. The first time I run the client and submits an article, the workflow gets persisted and blocked is 0, the second time I run it and submits a second article, the first one gets blocked but the second is not. How can I unblock the workflow when they are submitted and keep them that way, they wont load in my manager client if they are blocked.
public partial class FormSubmit : Form
{
WorkflowRuntime workflowRuntime;
WorkflowLibrary.Services services = new WorkflowLibrary.Services();
public FormSubmit()
{
InitializeComponent();
// Main component!
workflowRuntime = new WorkflowRuntime();
// ExternalDataExchangeService is needed to register local services
ExternalDataExchangeService exchangeService = new ExternalDataExchangeService();
workflowRuntime.AddService(exchangeService);
exchangeService.AddService(services);
// SqlWorkflowPersistenceService is needed for persistence
string connString = string.Format("Initial Catalog={0}; Data Source={1}; Integrated Security={2};", "WorkflowPersistenceStore", @"localhost\\SQLEXPRESS", "SSPI");
workflowRuntime.AddService(new SqlWorkflowPersistenceService(connString, true, new TimeSpan(0, 2, 0), new TimeSpan(0, 0, 20)));
}
private void btnSubmit\_Click(object sender, EventArgs e)
{
Dictionary<string, object> wfArgs = new Dictionary<string, object>();
wfArgs.Add("ArticleId", 0);
wfArgs.Add("ArticleText", txtArticleText.Text);
WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(
typeof(WorkflowLibrary.ArticleWorkflow), wfArgs);
workflowInstance.Start();
workflowInstance.Unload();
}
private void btnManager\_Click(object sender, EventArgs e)
{
new FormApproval().Show();
}
}
http://johanmartensson.se - Home of MPEG4Watcher