Welcome to Office Zealot Sign in | Join | Help

Julie's Office Dev Blog

Sorta like yoga... just less flexible.
Office Launched

There should have been a big party but I think we were all too tired to look at each other again.  I went up to L.A. for the Office Launch to watch my good friend, Charles Maxson, deliver the keynote to 2000+ Office geeks (well, I think there were a lot of executive levels there ... they aren't geeks, they just want good geeks on their team).  Charles was fantastic as expected.  I didn't get to stay for the rest of the show as I had a client meeting that took 4 hours instead of 2 (those workflow walkthrough training sessions, always take longer than expected) and by the time I was done, I just wanted to climb in my car and somehow make it through 3 hours of L.A. rush hour traffic.

Sharepoint is huge.  Sharepoint is going to be huge.  I always said I wouldn't bank my career on Sharepoint.. and then I entered the beta for 2007 and I changed my mind.  I've banked my whole career on this product and I think this product rocks.  So while I do mostly Sharepoint work at the moment, my heart still bleeds for traditional Office development... the nitty gritty where I made a start in this crazy world we call Information Worker.  So I am elated that I have just gotten an SOW signed for a traditional VSTO Office development project.... and it's for one of the largest law firms in the world.  I was worried when I first left legal that I was really leaving legal but what I'm finding is that legal never really had any good consultants with legal experience and I could fill my days just catering to legal clients.  It's a real possibility I could entertain... and not a bad one.

So the funny thing is, this SOW involves Office 2003... I haven't looked at Office 2003 in at least two years and I'm finding it hard to get back into the COM world mindset.  I know it will be like slipping into an old pair of jeans I used to love.

You want code?  So you want to change the values of the default status column for Sharepoint workflows, do you?  Everyone does!  To create custom "status column" values for Sharepoint workflows, you can add custom values to your workflow.xml file.  To clarify, when you associate a workflow with a Sharepoint list, a column is automatically created for you which contains the status of the workflow.  Out of the box this column value generally reflects "In Progress" or "Completed."  It is especially useful when creating state machine workflows to have customized status column values.  When creating sequential workflows, you'll have a harder time deciding when and where to set a customized status but still a valuable piece of metadata.  With no further ado, to create a custom set of status elements, simply add the following into your workflow.xml file:

<MetaData>

  <ExtendedStatusColumnValues>
    <StatusColumnValue>I'm In Stage 1</StatusColumnValue>
    <StatusColumnValue>Now Stage 2</StatusColumnValue>
    <StatusColumnValue>I've Been Rejected - Shucks</StatusColumnValue>
  </ExtendedStatusColumnValues> 
</MetaData>

In order to get the workflow to use the new custom status value, you must use the Set_State activity in the Sharepoint.WorkflowActivities library (this is not the same as setting state in a state machine workflow).  Drag the activity onto your designer surface wherever you would like to change the status column and then set the value of the state to (Int32)SPWorkflowStatus.Max + 1 (where 1 is the index value of your custom StatusColumnValue).  Please see this link for information from the SDK.

 Happy Workflowing.

Posted: Saturday, January 27, 2007 7:14 PM by jkremer
Filed under:

Comments

omar said:

Awesome! That's one task i can scratch off my list.

# January 29, 2007 3:28 AM

rpietra said:

Hi Julie,

I've got a question. I did what you wrote in your post.

But I still have some problem. When I insert the SharePoint SetState activity in my state machine workflow i can't set the State property to (Int32)SPWorkflowStatus.Max at design time. Evenif i bind the State property to either a property (created with design) or member varible and then  set that member varible or the property to (Int32)SPWorkflowStatus.Max I always have a runtime error. Also I'm not able to debug this error.

Have you some ideas?

# March 1, 2007 7:16 AM
Anonymous comments are disabled