Welcome3
Ununokt
Dołączył: 16 Paź 2010
Posty: 655
Przeczytał: 0 tematów
Ostrzeżeń: 0/5 Skąd: England
|
Wysłany: Nie 16:18, 31 Paź 2010 Temat postu: ghd australia repairs Exposing the State of a Shar |
|
|
Blog Downloads
About
,[link widoczny dla zalogowanych]
Scenario
I hope this potency be of strength to someone.
I have a fairly straight-forward sequential approval workflow that has an EnableModificationActivity that is in scope for just about the entirety of the workflow. My modification form is an ASPX page that renders the user the ability to enable/disable approval steps that have not occurred yet in the workflow. Since the workflow is able to be modified multiple times,[link widoczny dla zalogowanych], I would like the form to reflect the current state of the workflow, meaning it should reveal which activities are currently enabled or disabled.
Trent Foley’s Spectacular Technical Blog
Solution
So here is the approach I ended up taking…
I created a Plain Old CLR Object (POCO) class specific for holding state information my sectionicular workflow that is capable of being XML Serialized. I’ll call this the “State Object” going forward.
I created a reusable class called “WorkflowStateManager” that is capable of loading and saving single State Objects for a offern SPWorkflow. This class is accessible by both the workflow and the modification form. Save State Implementation: XML serializes the object to a string
Sets the serialized string on the SPWorkflow list item’s belongings bag and calls the property bag’s Update() method Load State Implementation (Essentially the reverse of the Save State implementation) Gets the serialized string from the SPWorkflow list item’s property bag
XML Deserialize the string into the State Object When the workflow is actionivated, I construct a new State Object, initialize various properties on it, and save it using the toilflowStateManager.
As the workflow advancees, I load and update the State Object as needed in the folloearng manner: Use the WorkflowStateManager to load the current State Object
Make workflow decisions based on the State Object’s values
Make desired deviates to the State Object
Use the WorkflowStateManager to save the State Object Now, my modification form is also able to load, manipulate, and save the State Object using the WorkflowStateManager, and in turn expose the current state of the workflow to the user.
Post został pochwalony 0 razy
|
|