Wednesday, June 19, 2013

Content Approval Tasks Followup

Content Approval Workflows, or the automation of pushed paper, remain the full meat of my daily life. This is because everyone wants signatures on everything in a bureaucracy, and yet they drown in the wash of paper involved in telling their coworker that it is okay to leave the office. The jealousy involved in a coworker being permitted to leave the building may involve a grievance.

There are, no lie, people in bureaucracies who take their vacations in half-hour chunks on Friday afternoon, and we are here to make that process, of shredding edges off their lives through meaningless, grotesque task-management, we are here to make that process smooth like hot butter and twice as scalding.

The underlying theory here is pretty straightforward. The content approval task, as written, has two elements: Content approval and task approval. This is used to control Sharepoint's extensive performance management metrics systems, which can be shattered like glass with a breath of air.

It is barely possible that these might be reusable, however: this builds on the Content Approval post a ways back.

Here is what we're doing: normally, the content approval workflow is decoupled from the task assigned by the process. We are hooking the two together, so that when your manager Opens the Task in their e-mail and hits Approved, they're approving the actual vacation request they just reviewed.

This is necessary because Sharepoint, by default, hides its content approval buttons in the task ribbon amid a broad swath of other clutter. It also likes to hide the "Open Tasks" button, which: I don't even care any more, you know? I've been learning Ruby. And Node. And they're much more fun than this business, as well as being better paid and generally not having a lot to do with Sharepoint, which is a career glass ceiling for practically everyone. There are better things to care about, so here is the step-by-step.


  1. Sharepoint Designer
  2. List you want to add the workflow to
  3. Add new workflow, on creation or change of list item Start Approval Workflow
  4. Rename Approval(22) something useful.
  5. Open Approval(22). 
  6. Edit individual Task Behavior, because we're linking the Task to the Approval, as versus keeping the two separate.
  7. Under Task Completion If Approved, add an item, Set Content Approval Status... and then...
  8. Under Task Completion If Rejected, set _that_ status to Rejected.
Now, let's clean up that list.
  1. Second workflow, dead vacation clearing
  2. On item created or changed and manual start
  3. If this CURRENT ITEM APPROVAL STATUS 
    • Approval status is a uniform column unaffected by the addition of other workflows, and it is what controls whether things go live or not.
  4. CONTAINS Rejected
    • Contains is important here, as is the capitalisation, because all of these methods act on slightly dodgy returns, and you can't tell if the thing is reading the ;#0Rejected or the actual string Rejected.
  5. Delete list item CURRENT ITEM
    • I'm presently favouring this because it works nicely on individual items, but I have been known to use un-limited scripts that wipe all rejected requests on the arrival of any new request.
    • Tryin' a catch me ridin' dirty...
This is more or less how you automate vacation requests.

Now you can watch people ask for half an hour off to go pick up their kids, and privately decide that, douchey as San Francisco may seem, at least they're not measuring your pee breaks.

No comments:

Post a Comment