none
WCF Workflow service application and state machine in WF 4.0

    Question

  • Hi

    I am working a project where i need to create a state machine work flow in 4.0. I have installed .net framework 4 platform updates and i am able to get state machine and states in toolbox to work with.
    I have created a WCF workflow service application. I have currently 3 states in this.

    State1 which executes a extenal process.
    State2 which updates a database.
    State3 populates some entity class.

    Each state will be having a receiveandsend activity. I need to trigger each states individually from client. Cancreateinstance of each receive activity is made true.

    I have to call this from a silverlight application. So i have added the service referance to this workflow in silverlight application.

    when i execute the first state, its works fine and external process is executed.

    But when i try to execute the next state by calling the next receive activity from client, its showing error as below.
    "Operation 'ExecuteExternal|{http://tempuri.org/}IService' on service instance with identifier '4732d197-32c0-4591-87bc-fa0adb7ec43a' cannot be performed at this time. Please ensure that the operations are performed in the correct order and that the binding in use provides ordered delivery guarantees."

    I think the WF is not waiting after first state is finished. Can anyone help me to solve this?

    Friday, June 03, 2011 12:49 PM

Answers

All replies

  • 66 views and not one reply. :(

    Is the method what i was using is completely wrong? :(

    Monday, June 06, 2011 4:20 AM
  • Hi,

    Have you configured correlation for your workflow? here is a sample could be helpful to you:
    http://xhinker.com/post/WF4Correlate-Multiple-Receive-Activities.aspx

    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 harikrk Thursday, June 09, 2011 12:34 PM
    Wednesday, June 08, 2011 3:32 AM
  • Thanks Andrew

    That was a good article on how to set the correlation. But still i am getting the same error.

    "Operation 'ExecuteExternal|{http://tempuri.org/}IService' on service instance with identifier '4732d197-32c0-4591-87bc-fa0adb7ec43a' cannot be performed at this time. Please ensure that the operations are performed in the correct order and that the binding in use provides ordered delivery guarantees."

     

    Thursday, June 09, 2011 5:35 AM
  • Sorry, it was my mistake. I was putting PersistbeforeSend as True for all send activities. When i removed this. Workflow works fine.

    Thanks a lot for the help.

    Thursday, June 09, 2011 12:35 PM
  • Hi harikrk,

    I am trying to accomplish the same thing you listed at the start of this thread - a WorkflowService that is a StateMachine that can create instances from any of my 4 states.  I was getting the "Please ensure that the operations are performed in the correct order and that the binding in use provides ordered delivery guarantees".  Based on info in this thread I set the AllowBufferedReceive to True and now I get this exception:

    The operation with name 'Create' must be enabled to use the ReceiveContext ManualAcknowledgement mode when the BufferedReceiveServiceBehavior is used.

    Now I am stuck - I don't see anywhere to set the ReceiveContext ManualAcknowledgement mode.  I am currently using BasicHttpBinding, if that matters at all.  Were you able to get past your issues with this stuff?  PersistBeforeSend is set to false in my workflow for my Send activities.  I noticed that you marked Andrew's response as the answer, but I'm not seeing how that helps with this issue.

    Thanks in advance for any insight you can provide.

    Tuesday, June 14, 2011 8:03 PM