locked
wf 4.5 get current states in persist statemachine RRS feed

  • Question

  • hi

    i use from vs.net 2012 and wf 4.5

    i create a simple state machine .it is  persist And Track with below code

     WorkflowApplication Host = new WorkflowApplication(new Workflow1())
                {
                    SynchronizationContext = SynchronizationContext.Current,
                    //Idle = OnIdle,
                    //Aborted = this.view.OnAbort,
                    //Completed = this.view.OnComplete,
                    InstanceStore = new SqlWorkflowInstanceStore("Data Source=safari-pc;Initial Catalog=MyWFPersist;Integrated Security=True"),
                    OnUnhandledException = OnUnhandledException,
                    PersistableIdle = PersistableIdle,
                    Unloaded = OnUnload
                };

                // Setup tracking in UI
                //this.Host.Extensions.Add(new MainWindow.TextTracker());

                StateMachineStateTracker StateTracker = new StateMachineStateTracker(new Workflow1());

                Host.Extensions.Add(StateTracker);

                // Setup the persistence participant
                Host.Extensions.Add(new StateTrackerPersistenceProvider(StateTracker));

                Host.Run();

    this work Correctly

    now i want get current state of state machine

    i try with StateMachineStateTracker

    but i found a sample that very complicated

    every one can send to me a simple sample with console wf application

    with StateMachineStateTracker

    thanks

    Ali


    • Edited by IfaUser Wednesday, September 11, 2013 11:43 AM
    Wednesday, September 11, 2013 7:22 AM

Answers

  • HI IfaUser

     I think you could consider submitting this issue to Microsoft Connect feedback portal(https://connect.microsoft.com/ ),

    Best regards

    Angie xu


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Angie Xu Tuesday, September 24, 2013 3:27 AM
    Monday, September 16, 2013 1:52 AM

All replies

  • Hi,

    Here is an article about use State Tracking with WorkflowApplication, I think it will be good reference for you,

    1.Create an instance of the root activity

    2.Create an instance of StateMachineStateTracker passing in the root activity

    3.Create an instance of StateTrackerPersistenceProvider passing in the StateMachineStateTracker instance

    4.Add the StateMachineStateTracker and StateTrackerPersistenceProvider to the WorkflowApplication.Extensions

    # To use State Tracking with WorkflowApplication

    Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Angie Xu Thursday, September 12, 2013 1:35 AM
    Thursday, September 12, 2013 1:34 AM
  • hi

    thanks for your Reply

    But

    please see

    Bug in Microsoft.Activities.Extensions

    Thanks

    Saturday, September 14, 2013 1:12 PM
  • HI IfaUser

     I think you could consider submitting this issue to Microsoft Connect feedback portal(https://connect.microsoft.com/ ),

    Best regards

    Angie xu


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Angie Xu Tuesday, September 24, 2013 3:27 AM
    Monday, September 16, 2013 1:52 AM