process level escalation: howto?

  • 16 September 2009
  • 2 replies
  • 3 views

Badge +1
Hi,

On the project I'm developing I ran into a problem I couldn't solve. This leads to some questions about _process level_ escalations.

There is a business process in which there is an "SLA due time". When the process reaches this time, a notification occurs. This time is computed when the process starts and is stored in an xs:dateTime type node 'SLATime' in an XML document stored in an XML field called 'ProcessXml'. So I configured a process level escalation with 'Escalate On' rule, setting this XML field and its node (ProcessXml/SLATime) as the dynamic datetime of the escalation. And, when I start the process, I fill this XML field containing this time before calling StartProcessInstance.
But, escalation doesn't fire. It only fires when I set it manually in the K2 studio as a fix date/time.

Could you please answer me that:
- Can I use an XML field node as a dynamic escalation date? If not, what are the possibilities for storing a date/time? I wouldn't use SmartObjects if possible..
- What is the format of this XML date? Please give a sample (as a string) and any type (e.g. UTC).
- When is this evaluated? At CreateProcessInstance, or when calling StartProcessInstance?
- How can I update this date? While the process is active, SLA time can be dynamically set and I need to recalculate and refresh the escalation date in the process! So, when user changes SLA time, the process escalation should change! How to do this? Just update the XML field?
- Is there some kind of external API (like SourceCode.Workflow.Management) with which I can manipulate a specific process' process level escalations? Please provide some code samples for this.

Thanks in advance,
Peter



2 replies

Badge +13

Is Process level escalation something new in BP?

The other way is that you could create a parallel activity that is purely used to escalate.

Badge +8

I have just tested this and it does work using an XML field. I declared my field in the InfoPath as a DateTime field (Date should also work, but the time defaults to 00:00), populated it using a valid date time and I got the Escalataion email as expected.

 

The format i used: 9/23/2009 5:14:00 PM

The Process Escalation rule will only be run when the StartProcessInstances method has been called. It can't evaulaute during CreateProcessInstance, the datafields have not been instantiated at that point.

Once an Escalation has been set, it is fixed. If you have a "running" escalation, it might be a better idea to set the escalations at every Activity. At least this way you can update the date should it need to change. A bit more work, but still feasible.

Same as above. Once an Escalation has been set, the escalation date cannot be updated. You can prevent it from actually executing (adding a manual check in the code), but my feeling is that Activity escalations might be better suited. You can also for instances do a GoTo back to the same activity if the date needs to be adjusted. Just ensure that relevant logs and audits does not get updated when its not needed.

Reply