Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. State Machine Workflow - list available events

State Machine Workflow - list available events

Scheduled Pinned Locked Moved WCF and WF
questioncsharpdatabasedesigndiscussion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    David Skelly
    wrote on last edited by
    #1

    This seems like an obvious question to me, but I'm having trouble tracking down an answer. I am trying to put together an application that is driven by a state machine workflow behind the scenes. The UI has a menu, the contents of which change depending on the current state of the workflow. Basically, I would like the menu to reflect the list of actions available for the current state. I can query a state machine workflow to find the list of available state transitions, but that doesn't really tell me what I need to know. I guess I'm looking for a way to get hold of a list the events which the workflow will respond to in its current state. I can't be the first person to want to do this. I want the workflow to dynamically supply the options available to the user through the UI depending on its current state. What is the recommended best practice for achieving this? Is it even possible, and will I end up having to set up my own cross-reference somewhere? I am relatively new to .NET WF, but familiar with the concept of state machines and it's possible I'm expecting too much of WF.

    K C 2 Replies Last reply
    0
    • D David Skelly

      This seems like an obvious question to me, but I'm having trouble tracking down an answer. I am trying to put together an application that is driven by a state machine workflow behind the scenes. The UI has a menu, the contents of which change depending on the current state of the workflow. Basically, I would like the menu to reflect the list of actions available for the current state. I can query a state machine workflow to find the list of available state transitions, but that doesn't really tell me what I need to know. I guess I'm looking for a way to get hold of a list the events which the workflow will respond to in its current state. I can't be the first person to want to do this. I want the workflow to dynamically supply the options available to the user through the UI depending on its current state. What is the recommended best practice for achieving this? Is it even possible, and will I end up having to set up my own cross-reference somewhere? I am relatively new to .NET WF, but familiar with the concept of state machines and it's possible I'm expecting too much of WF.

      K Offline
      K Offline
      Kevin McFarlane
      wrote on last edited by
      #2

      If you don't get an answer here try the MSDN WF forum.

      Kevin

      1 Reply Last reply
      0
      • D David Skelly

        This seems like an obvious question to me, but I'm having trouble tracking down an answer. I am trying to put together an application that is driven by a state machine workflow behind the scenes. The UI has a menu, the contents of which change depending on the current state of the workflow. Basically, I would like the menu to reflect the list of actions available for the current state. I can query a state machine workflow to find the list of available state transitions, but that doesn't really tell me what I need to know. I guess I'm looking for a way to get hold of a list the events which the workflow will respond to in its current state. I can't be the first person to want to do this. I want the workflow to dynamically supply the options available to the user through the UI depending on its current state. What is the recommended best practice for achieving this? Is it even possible, and will I end up having to set up my own cross-reference somewhere? I am relatively new to .NET WF, but familiar with the concept of state machines and it's possible I'm expecting too much of WF.

        C Offline
        C Offline
        chriskwok live cn
        wrote on last edited by
        #3

        ReadOnlyCollection<WorkflowQueueInfo> subActivities = stateMachineInstance.WorkflowInstance.GetWorkflowQueueData();
        Collection<string> MessagesAllowed = new Collection<string>();
        foreach (WorkflowQueueInfo queueInfo in subActivities)
        {
        // Cast the Queue Name to the class Event Queue Name to get the event name string
        EventQueueName queuename = queueInfo.QueueName as EventQueueName;

        if (queuename != null)
        {
            MessagesAllowed.Add(queuename.MethodName);
        }
        

        }

        When WorkflowState Changed, do above to retrieve the event names of current state (MessagesAllowed has them), then update UI, it is ok. hope it can help you!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups