Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:42:55+00:00 2026-06-07T23:42:55+00:00

I have a workflow that runs (hosted by WorkflowApplication), sends an email, then persists

  • 0

I have a workflow that runs (hosted by WorkflowApplication), sends an email, then persists using a bookmark. The email has a link that allows the workflow to resume at that bookmark, which it does properly. However, after the workflow finishes, the webpage never loads.

It’s like the page is waiting for the workflow to finish but it never does. I am very new to workflow and even newer to multithreading, so my question is:

Is there anything special I need to do to exit the workflow completely so control is given back to the main thread? Like a delegate method I’m missing?

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:42:57+00:00Added an answer on June 7, 2026 at 11:42 pm

    So I figured it out right after I posted, so I’m sorry. Here it is though:

    Because the Workflow was on a seperate thread, it was not syncing with the main thread once it was done. So I needed to add a method in the Completed delegate to make sure it synced up with the main thread after it was done. I just forgot that. Hope this helps someone.

    First, you need to set and auto reset event and a WorkflowApplication object

     private static AutoResetEvent _syncEvent = new AutoResetEvent(false);
     private static WorkflowApplcation _wfApp = new WorkflowApplication(new MyActivity());
    

    Then in the delegate methods of the wfApp, make sure to call:

     _syncEvent.Set();
    

    So:

    wfApp.Completed = (e) =>
                  {
                    Debug.WriteLine("Workflow completed: {0}", e.Outputs["Message"]);
                    _syncEvent.Set();
                  };
    

    This last part is what I was missing

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a skelta workflow that has finished with errors according to the WorkflowExecutionReport.
I have a very simple workflow that is just trying to send an email
We have a .Net 3.5 Workflow hosted as a service that sometimes stops unexpectedly.
I have a routine that creates n instances of a particular workflow and runs
Currently we have a sequential workflow in sharepoint 2010 that has a delay activity.
AI have a WF 4 application which contains a sequence workflow that has a
I have a SharePoint (WSS 3.0, VS 2005) workflow that has a workflow modification
I have a workflow process that runs in weird combination of html and excel,
I have a job that runs which sends out emails to our users to
I have a workflow that has a public State property that returns a custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.