State Machine Workflow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oritne
    New Member
    • Nov 2008
    • 3

    State Machine Workflow

    Hi all,

    I have an application that hosts a state machine workflow runtime.

    Once the workflow starts running, I want it to send a message to the hosting application each time it finishes a task (but still doesn't complete running).
    The application will catch that message, just as it catches the events defined on the workflow runtime (as "WorkflowComple ted" or "WorkflowTermin ated"), and will let the WF continue running.

    Is there a way to do that?

    Thanks.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    You could create a custom event and fire it when you finish a task.
    Then the application can attach a handler to it and listen for that event

    Comment

    • oritne
      New Member
      • Nov 2008
      • 3

      #3
      Thank you for the answer

      I thought about this solution too, but I had some problems with it:

      In order to add a new event to the WorkflowRuntime class I had to inherit it. Then I added a new event handler in the application. The problem occured when I wanted to raise the event on the workflow itself. I didn't know how to get the current WorkflowRuntime instance. I tried to send it as a parameter from the application, but had some problems with it, so I preferred to ask if anyone knows about an easier way to do that.

      If there isn't any built-in solution, I'll continue to try this one.

      Thanks!

      Orit.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        I am unfamiliar with these object? What is the full name of the object(s) you are using?
        i.e. if your are using a socket, System.Net.Sock ets.Socket

        Comment

        • oritne
          New Member
          • Nov 2008
          • 3

          #5
          System.Workflow .Runtime.Workfl owRuntime.

          Comment

          Working...