More in this section

Forums / Bugs & Issues / Workflow exception

Workflow exception

2 posts, 1 answered
  1. Andy
    Andy avatar
    7 posts
    03 Oct 2012
    23 Mar 2015
    Link to this post

    I am getting the following error when a custom app hits an event workflow:

    Error in the application.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: Error in the application.

    Source Error: 

    Line 62: var bag = new Dictionary<string, string>();
    Line 63: bag.Add("ContentType", typeof(Event).FullName);
    Line 64: WorkflowManager.MessageWorkflow(eventItem.Id, typeof(Event), null, "Draft", false, bag);


    [FaultException`1: Error in the application.]
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14799942
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622
    Telerik.Sitefinity.ContentWorkflows.IService.SendMessage(String operationName, Boolean isCheckedOut, Guid workflowDefinitionId, Guid contentId, String providerName, Dictionary`2 contextBag) +0
    Telerik.Sitefinity.ContentWorkflows.ServiceClient.SendMessage(String operationName, Boolean isCheckedOut, Guid workflowDefinitionId, Guid contentId, String providerName, Dictionary`2 contextBag) +135
    Telerik.Sitefinity.Workflow.WorkflowManager.MessageWorkflow(String wokflowUrl, String operationName, WorkflowDefinition workflowDefinition, Guid contentId, String providerName, Boolean isCheckedOut, Dictionary`2 contextBag) +2788
    Telerik.Sitefinity.Workflow.WorkflowManager.MessageWorkflow(Guid itemId, Type itemType, String providerName, String operationName, Boolean isCheckedOut, Dictionary`2 contextBag) +297
    SitefinityWebApp.Widgets.CreateEvent.CreateEvent.CreateEventDraft() in c:\inetpub\test\Widgets\SubmitEvents\CreateEvent.ascx.cs:64
    SitefinityWebApp.Widgets.CreateEvent.CreateEvent.btnSubmit_Click(Object sender, EventArgs e) in c:\inetpub\test\Widgets\SubmitEvents\CreateEvent.ascx.cs:86
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804

    Any help is appreciated.

  2. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    04 Jan 2016
    26 Mar 2015
    Link to this post

    As mentioned in the ticket, you need to take a slightly different approach to send the items through the workflow for approval:

    var temp = eventsManager.Lifecycle.CheckOut(eventItem);
               var bag = new Dictionary<string, string>();
               bag.Add("ContentType", typeof(Event).FullName);
               WorkflowManager.MessageWorkflow(temp.Id, typeof(Event), eventsManager.Provider.ToString(), "SendForApproval", false, bag);

    First, create a temp item by checking out the master and then use it to message the workflow. And for the workflow call itself the operation should be "SendForApproval".

    Atanas Valchev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 1 answered