locked
how to programatically check on the initiation form whether workflow is running or completed? RRS feed

  • Question

  • hi guys,

    i have a workflow with an inittiation form. as all know, the initiation form comes up whenever we start a workflow.

    i want to check on this form the statu of the workflow and if it is running then i wwant to inform the user accordingly. how do i check the status of workflow on this form?

    Saturday, September 10, 2011 9:15 AM

Answers

  • Use SPWorkflowActivationProperties.Workflow to get the current instance of the workflow running on that item.

    Then, use SPWorkflow.ISCompleted or SPWorkflow.InternalState property to find out status of the running workflow and you can inform the user accordingly.


    Sundar Narasiman
    • Proposed as answer by Shimin Huang Monday, September 12, 2011 2:16 AM
    • Marked as answer by Shimin Huang Friday, September 23, 2011 6:33 AM
    Sunday, September 11, 2011 2:22 AM

All replies

  • Use SPWorkflowActivationProperties.Workflow to get the current instance of the workflow running on that item.

    Then, use SPWorkflow.ISCompleted or SPWorkflow.InternalState property to find out status of the running workflow and you can inform the user accordingly.


    Sundar Narasiman
    • Proposed as answer by Shimin Huang Monday, September 12, 2011 2:16 AM
    • Marked as answer by Shimin Huang Friday, September 23, 2011 6:33 AM
    Sunday, September 11, 2011 2:22 AM
  • I am a beginer of SharePoint and I want to do a similar situation using workflows. Can you post an example on achieving this scenerio?

    Thanks

    Friday, February 17, 2012 4:45 AM