locked
Accessing workflow.xml ExtendedStatusColumnValues at runtime? RRS feed

  • Question

  • I have used the ExtendedStatusColumnValues in workflow.xml to create some custom StatusColumnValues for my workflows.

    i.e.

    <ExtendedStatusColumnValues>
            <StatusColumnValue>Custom Status 1</StatusColumnValue> <!-- id 15 -->
            <StatusColumnValue>Custom Status 2</StatusColumnValue> <!-- id 16 -->
    </ExtendedStatusColumnValues>

    Can these be accessed programatically at runtime? If I access the WorkflowStatus Enum I can only get to the built in status, I cannot get to my custom ones.

    Thanks
    Wednesday, February 10, 2010 9:27 AM

Answers

  • Hi, Evans

         

         Would you please let me know how you implemented the custom status values?

         I’m afraid you could not extend OOB SPWorkflowStatus enum type, but you should create your own public enum definition.

         You can create a custom enum status and set the first element value to SPWorkflowStatus.Max.

         Please refer this article ExtendedStatusColumnValues (http://msdn.microsoft.com/en-us/library/aa543169.aspx)

         See the Implementing Custom Workflow Status Values samples below the property notes.

     

         Hope this can help.

     

    Best Regards,

    -Aaron

    • Marked as answer by Chengyi Wu Friday, February 19, 2010 4:21 AM
    Monday, February 15, 2010 3:19 AM

All replies

  • It is just an Int32

    to set it to your SetStateActivity`s state use:
    ((Int32)SPWorkflowStatus.Max) + 1; // is your first custom status, +2 is second, +3 third and so on
    Wednesday, February 10, 2010 11:27 AM
  • Hi,

    Thanks - I am aware that they are just Ints from 15 onwards. 

    What I need to do is take the integer, and show the text value.  i.e. take 5 and turn it into 'Completed'

    I can do this for the built in types, but it will not work for the extra types I have added.  So the below would work fine for the standard WorkflowStatus enums, but not for the ones i've added. So I need a way to get hold of the extended status columns

    (note: the code will run outside of the workflow, in the code that powers the graph webpart)

    int WorkflowStatusValue = myItem["MyWorkflow"];
    string WorkflowStatusString = System.Enum.GetName
    	(typeof(SPWorkflowStatus), WorkflowStatusValue);
    • Proposed as answer by Leonardo Rente Tuesday, November 8, 2011 6:45 PM
    Wednesday, February 10, 2010 2:24 PM
  • Hi, Evans

         

         Would you please let me know how you implemented the custom status values?

         I’m afraid you could not extend OOB SPWorkflowStatus enum type, but you should create your own public enum definition.

         You can create a custom enum status and set the first element value to SPWorkflowStatus.Max.

         Please refer this article ExtendedStatusColumnValues (http://msdn.microsoft.com/en-us/library/aa543169.aspx)

         See the Implementing Custom Workflow Status Values samples below the property notes.

     

         Hope this can help.

     

    Best Regards,

    -Aaron

    • Marked as answer by Chengyi Wu Friday, February 19, 2010 4:21 AM
    Monday, February 15, 2010 3:19 AM