BLACKTOP: Writings From the Road



Here's something I've seen several times that can lead to bugs.  C# has two logical-and operators: & and &&.  If you come from a C++ background, it's entirely natural to use the && operator.  But there is a difference between the two operators: the && operator is a short-circuit operator.

  • The & operator always evaluates both the left and right side expressions
  • The && operator always evaluates the left side expression, but only evaluates the right side if the left side was true

This means with the && operator, both expressions might not be evaluated.  To get the most efficient use of the && operator, you should put the key expression that is most likely to be false on the left hand side.

 
 


Here’s a simple way to set a default outcome for an escalation so the workflow will take to your chosen activity when the escalation fires.  I’ve seen many approaches to accomplish this, but I think this one is the easiest.

Let’s say you have a client event (this technique can work with a server or IPC event with some adjustment) where the user has two choices:  Approve or Reject.  If the user takes no action after a certain amount of time, you want to automatically take the reject choice. 

Steps:

·         Open the K2 Object Browser and go to the “Process/Activity” tab

·         Expand Data Fields | Activities | then expand the activity that contains your client event

·         Right click and edit the “Outcome” field

·         In the Initial Value field, put the outcome you want to use when the activity expires (“Reject” in this example)

Default Outcome

·         Set the activity escalation for the appropriate time, then on the “Action Template” screen, choose “Expire Activity”

 

That’s it.  When the activity expires, it will take the outcome specified in the initial value.  Using this technique, you could also take a path that is not one of the choices given to the user.  For example, you could set the initial value of the outcome to “Expire” and then set up a line rule that will branch to activities you want to perform when the user took no action.

 
 


One thing you'll hear me repeat many times when I'm working with a new customer is about testing your process.  When testing your process, you must test every possible path through the workflow.  Testing just the most likely path isn't good enough.  Exercise every rule, every event, and every possible outcome.
 
 


When upgrading to a new release of [blackpearl], like 0803, make sure you have your users clear their browser cache.  This will insure any cached client-side java scripts are pulled fresh from the web server.  If you don't do this, you might get the endlessly spinning wheel in Workspace.

 
 


Ever notice after a hard day working away at the old data mine in a Virtual PC that SQL Server takes up a pretty good chunk of your available memory?  If you're like me, you could use this memory for something else.  Here's how you can limit how much memory SQL Server users:

  • Open SQL Server Management Studio
  • Connect to your server
  • Right-click on your database server name and choose Properties
  • Click Memory, set the maximum amount of memory, then click OK
  • Restart your SQL Server service

If you watch SQL Server in task manager, you'll find that it sometimes exceeds your maximum limit, but during idle times it will drop back down.

 
 


Greetings to everyone out there in K2 land.  My name is David Loomis and I am a consultant/architect for K2.  I travel North America helping our customers design & implement projects with [blackpearl].   I spend a lot of time on the road, thus the title “blacktop”.   Actually, I spend a more time on the airport tarmac than on the road, but that just doesn’t work with our “black” theme.

For a long time I didn’t want to write a blog because I was afraid I wouldn’t have anything interesting to say.  However, after searching the web and reading several blogs, I can safely conclude that having something interesting to say is not necessarily a prerequisite.  Also, my boss pretty much made it a requirement to write one.

So here’s my plan.  As I go from customer to customer, I see some common questions people have when first starting out with [blackpearl].   We’ll cover those.  I also run into some typical business process requirements that others might also want to see how to implement.  Along the way I run across other interesting tips and observations I’ll share with you.  If you have something that interests you, please send me a note through this site.  I’m going to evaluate requests based on whether they are applicable to a large audience.  Don’t be offended if I don’t publish your question as not everyone may have an interest in automating the breeding selection for Tasmanian Yaks.

In short, it’s my blog, and I’ll end up writing about whatever I feel like.  I don’t have every answer, and you won’t always agree with the ones I do have.  There are many different ways to accomplish tasks in [blackpearl], and that’s one of the things I love about it.  And make no mistake, I love working with [blackpearl].