Note that there are some explanatory texts on larger screens.

plurals
  1. POPersistable Workflow with MVC - Run throwing exception on completed
    primarykey
    data
    text
    <p>I'm running a persistable Workflow in an MVC 3 Application, which is working out well, but when the workflow is completed, a WorkflowApplicationCompletedException is thrown. The Workflow is completed sucessfully, the last actions done and the instance deleted from the database.</p> <p>I've had no luck searching for an answer so far, so any ideas what is causing the exception would be appreciated. My current workaround is catching the exception and doing my stuff there for the OnCompleted-Event.</p> <p>I'm simply creating a WorkflowApplication, loading it and resuming the bookmark.</p> <p>Any hints or suggestions appreciated. Thanks</p> <pre><code>application.Load(new Guid(basket.StandardFields.Settings)); application.ResumeBookmark(application.GetBookmarks().First().BookmarkName, WorkflowInputs); application.PersistableIdle = delegate(WorkflowApplicationIdleEventArgs e) { if (e.Bookmarks != null &amp;&amp; e.Bookmarks.Count &gt; 0) { _viewName = e.Bookmarks[0].BookmarkName; } syncContext.OperationCompleted(); return PersistableIdleAction.Unload; }; application.Completed = delegate (WorkflowApplicationCompletedEventArgs e) { CompleteWorkflow(syncContext); }; application.SynchronizationContext.OperationStarted(); try { application.Run(); } catch(WorkflowApplicationCompletedException) { CompleteWorkflow(syncContext); } </code></pre> <p><strong>Edit</strong></p> <p>It seems that the application.ResumeBookmark(bookmark, WorkflowInputs) starts the Workflow and Completes the activities, then when I call run, it complains the it's already completed. But if I don't call run when resume workflow is called, the browser never gets any information and I think it stays waiting endlessly cause not even a refresh can knock it out of the waiting state.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload