Wednesday, July 11, 2012

IPA Design Best Practice with an Actions Process

An Actions Process is created to act as a library for your main process so the main process does not necessarily always have to be republished in order to make changes. Here's a quick overview:


  1. For each process you implement, create a second process with the same name ending in Actions.
  2. Call the Actions Process at the start and end of major steps in your Tasks in the main process with a text tag to indicate what you've just done or are about to do.
  3. In the Actions Process, have a Select statement evaluate the variable passed as the tag. If it's found, do some work. If it's not, drop through and do nothing.
  4. As you find the need for minor tweaks, notifications, etc., consider if you can add those to the Actions Process instead of having to enhance and republish your main process.

Once you start doing some implementations during IPA, as with all custom software, you may notice the need for some tweaks after the initial go live. We discovered that with the Timecard Process, and had to make a few adjustments for the unforseen during the first week in production. The rest, including several enhancements, will be done in Phase 2.

Generally speaking, the larger and more complex your IPA process is, and the more active processes you have running, the less the frequency you want to republish that process. If you implement your process with Restart/Reroute design logic, which is a topic I'll cover in a later post, it gets easier to publish changes to a process in production. The Actions Process is something to build into your main process up front to reduce the need for the main process to be republished.

Some changes related to providing a notification once the Timecard was Submitted by the Team Member. Initially at go-live, largely due to the "need it yesterday" time constraint, we simply sent a basic email that said "you've successfully submitted your timecard," and left it at that.

In phase 2 we're going to enhance that message to include the data entered in the Timecard. With 70+ fields on it, that email will take some time to format with variables we'll pull from our Database Driven Design (of course).

Enter the Actions process into the Best Practices for IPA. When the Timecard Approval process was created, I immediately also created a process called Timecard Actions. Actions is called all over in the Tasks for Timecard Approval. As you may or may not know, a Task is the only place you can call another process in IPA. All that is needed to call Timecard Actions is a TimecardID, which is how we track individual timecards in the database, and some kind of a tag to indicate what just happened in Timecard Approval process.

In the example with the email notification, right after the Team Member clicks Submit on the Work Item for their timecard, the next step in the Task after we're done with the Work Item is to call the process Timecard Actions with the TimecardID and a tag for "Team Member Submit."

Over in the Timecard Actions process, we only need one State. That State calls a Task that has a Select step in it. All the Select step does is see if the label passed to Timecard Actions is found. If it is, we have some work to do. If it isn't, the call to Timecard Actions is currently a "no-op" and we just fall through the Timecard Actions process without doing anything.

Currently there are at least a dozen or so calls in Timecard Approval to the Timecard Actions, but as I've said we're only using one right now for the notification. The beauty of an Actions Process is I can enhance the format and data in the email notification and republish Timecard Actions without having to touch my main process, Timecard Approval.

Another benefit is in the future, if we have needs to implement other notifications, we can simply enhance Timecard Actions to add the label sent over from Timecard Approval, which means we can do some work in a Task whenever that call in Timecard Approval is made to Timecard Actions.

Lastly, an Actions Process is useful for debugging purposes while you're developing your process. Since there are many calls to Actions throughout your main process, they act as "I made it here" points in the main process. Instead of adding extra debugging code in your main process, you can simply add and remove tags from the Actions Process as needed.

Generally speaking I'm calling an Actions Process with the Wait To Complete radio button set to No. If you would need to wait to do processing, that logic probably needs to stay in your main process as a rule of thumb. Save the Actions Process for simple stuff like sending a notification, which might start as an email but later turn be enhanced to also call a handler to make a phone call.

Once you become familiar with IPA you'll realize it's helpful to minimize publishing your main process. With the Timecard Actions process, I can enhance the email, just republish Actions and the next Timecard benefits from this new feature without having to re-publish the main process. This IPA Best Practice, by the way, of course came from the Punk Rockers. Brilliant!

I covered the Actions Process when I co-presented at Interactions 2012 last month and my apologies for not getting this post out sooner as promised.

Have any thoughts on the Actions Process? Feel free to share them in the comments.

Happy Processing!