Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Persistence in WF

Persistence in WF

Scheduled Pinned Locked Moved WCF and WF
questiondatabasesecurityhelpworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Johan Martensson
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups