locked
Get active (running) workflow service instances in IIS / WAS without using SQL Persistance RRS feed

  • Question

  • Hi,

    I'm hosting a workflow service (XAMLX) in IIS / WAS.

    The workflow is a state machine that has multiple send / receive activities, so I can make several WCF calls against an instance of this workflow using correlation Id's. This is working wihtout any problems.

    I'm able to create more than one instance of the workflow, have it running in IIS, query or update the state on any of the instances created without problems also.

    For the moment I'm not using any SQL Persistance (and I'd like to avoid it for now), but I'd like to know if is there a way that I could retrieve all the active (running) instances in IIS of this XAMLX. I presume that if I was using SQL Persistance this could be done, but my question is, can this be done without using SQL Persistence?

    Thanks,

    Nelson Morais


    Nelson Morais nelsonmorais@yahoo.com
    Thursday, January 27, 2011 6:21 PM

Answers

  • Hi, Nelson

    ->"I'm not looking to track or monitor the lifecycle of the workflow. I'm looking for something that could give me the current running instances on IIS of a workflow type (e.g. MyWorkflow.XAMLX)."

    If you are trying to access to the workflow instance, you may need to create your own workflow service factory. run you workflow service in code style, here is a sample:
    http://xhinker.com/post/WF4Create-Your-Own-ServiceHostFactory.aspx

    ->"If I understood your suggestion, I could create a custom tracking to manualy persist the running instances and then provide a service (e.g. WFRunningInstances.svc) which could be called to retrieve these instances. Is this your suggestion?"

    You won't retrive the workflow instance by querying tracking store. however, you can get almost all info about the running workflow instance(you can also store some additional data into tracking store).

    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 Wednesday, February 2, 2011 12:35 PM
    Wednesday, February 2, 2011 12:35 PM

All replies

  • Yes, you can use tracking.  If you create a custom tracking provider you can record the lifecycle events of the state machine.

    You would have to add your tracking provider via a custom WorkflowServiceHostFactory or a service behavior.


    Sr. Program Manager, AppFabric Development Platform (WF/WCF) http://blogs.msdn.com/rjacobs http://www.twitter.com/ronljacobs
    Thursday, January 27, 2011 11:13 PM
  • Hi Ron,

    I'm not looking to track or monitor the lifecycle of the workflow. I'm looking for something that could give me the current running instances on IIS of a workflow type (e.g. MyWorkflow.XAMLX).

    If I understood your suggestion, I could create a custom tracking to manualy persist the running instances and then provide a service (e.g. WFRunningInstances.svc) which could be called to retrieve these instances. Is this your suggestion?

    Thanks,


    Nelson Morais nelsonmorais@yahoo.com
    Friday, January 28, 2011 5:27 PM
  • Hi, Nelson

    ->"I'm not looking to track or monitor the lifecycle of the workflow. I'm looking for something that could give me the current running instances on IIS of a workflow type (e.g. MyWorkflow.XAMLX)."

    If you are trying to access to the workflow instance, you may need to create your own workflow service factory. run you workflow service in code style, here is a sample:
    http://xhinker.com/post/WF4Create-Your-Own-ServiceHostFactory.aspx

    ->"If I understood your suggestion, I could create a custom tracking to manualy persist the running instances and then provide a service (e.g. WFRunningInstances.svc) which could be called to retrieve these instances. Is this your suggestion?"

    You won't retrive the workflow instance by querying tracking store. however, you can get almost all info about the running workflow instance(you can also store some additional data into tracking store).

    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 Wednesday, February 2, 2011 12:35 PM
    Wednesday, February 2, 2011 12:35 PM