locked
The easiest way to check aworkflowistance variable RRS feed

  • Question

  • I have a private variable for my workflow like this

    public sealed partial class SampleWorkflow : StateMachineWorkflow
        {
            private string statusWf;
        .....
        ....
    Wich is the easiest way to check the value of this variable and insert it in a label of a web form.

    At this moment I have added an event 'CheckStatus' in my service interface, and each state of my workflow has an eventdrinven activity that contains the eventdriven related at the checkstatus... than an invoke method(binding the variable) calls the method of the service that upgrades the webform.

    I think that this work-around isn't necessary and and I don't like to add the same event driven to all the state of my workflow. I think that there is a more stright way to do that. How could I do this?

    Thank you
    Thursday, January 5, 2006 5:38 PM

Answers

  • redarko,

    You don't need to add the event driven to every state.  Instead, you can drop the event driven you created on the parent workflow and this will make it global to all states.  When an incoming event arrives for the state machine, it first checks the current state for an appropriate handler to the event.  If none is found, it will then check its parent super-states for a handler, if a super state exists.  Finally, it will examine the workflow for any global-level event driven activities.

    Arjun

    Thursday, January 5, 2006 7:10 PM

All replies

  • redarko,

    You don't need to add the event driven to every state.  Instead, you can drop the event driven you created on the parent workflow and this will make it global to all states.  When an incoming event arrives for the state machine, it first checks the current state for an appropriate handler to the event.  If none is found, it will then check its parent super-states for a handler, if a super state exists.  Finally, it will examine the workflow for any global-level event driven activities.

    Arjun

    Thursday, January 5, 2006 7:10 PM
  • This is great, Thank you
    Thursday, January 5, 2006 7:15 PM