locked
workflow service question RRS feed

  • Question

  • Hi,

    here is part of my code:

    private void SendToAGent_Click(object sender, RoutedEventArgs e)
        {
          var selectedItem = grdPolicies.SelectedItem;
          if (selectedItem != null)
          {
             workflowInstanceInfo item = selectedItem as workflowInstanceInfo;
             long policyID = long.Parse(item.PolicyID);
    
             try
             {
              
               long PolicyIDReturned = this._carrierClient.SendToAgent2(new svc.SendToAgent2 { PolicyID = policyID }).Value;
             }
             catch (Exception ex)
             {
               throw ex;
             }
    		
    }
    }
    

    this will bring my workflow to next step, I am wonder, when this happened, what if I do it again on the same instance of workflow, which is not expecting this request, what kind reponse or error the client will return from server? I am trying to get it from my app and I got timed out error. there is no try catch block in my workflow.

    thanks

     


    ahorse
    Thursday, August 4, 2011 6:39 PM

Answers

  • Hi, ahorse

    One idea comes to my mind:
    You can place a Persist activity before the Try-Catch activity. so that even the workflow is terminated, you can still resume the workflow from the previous persistence point.

    Regards


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Tuesday, August 16, 2011 12:44 AM
    Thursday, August 11, 2011 8:28 AM

All replies

  • Hi, ahorse

    Could you share a sample project with us, what is the error message you got?

    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Wednesday, August 10, 2011 2:19 AM
  • Hi, Andrew:

    I was not able to get the exception back, instead, It looks like that it choked somewhere. I use statemachine in workflow service, would you please give an example of how try catch activity should be incorporated into it so that the workflow would not get terminated and I can resume it on the same step that was errored out.

    Thanks

     

     


    ahorse
    Wednesday, August 10, 2011 5:10 PM
  • Hi, ahorse

    One idea comes to my mind:
    You can place a Persist activity before the Try-Catch activity. so that even the workflow is terminated, you can still resume the workflow from the previous persistence point.

    Regards


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Tuesday, August 16, 2011 12:44 AM
    Thursday, August 11, 2011 8:28 AM