Escalations store to Custom Tables

  • 27 September 2015
  • 3 replies
  • 1 view

Badge

Hi,

 

I am newbie here. I am using K2 Black pearl 4.6.9

 

I have a requirement to insert a entry to a custom table in sqlserver whenever a escalation happens.

 

I noticed that Escalation has an option to view code.

 

As per my scenario above, should i include my custom code in Rule Code or Action Code.

 

Is it the only option to track the Escalations. I have few workflows so thinking of doing it globally and not sure how to achieve it.

 

Is there any sample code or helper classes available to achieve this scenario

 

Thanks

 

 


3 replies

Userlevel 5
Badge +16

Hi,

 

Im not a friend with code, but I used to do a simple trick to achieve this, not the best way but could be helpful:

 

Create smartobject of your custom SQL table.

Create new activity and add Smartobject event (Create method)

Add line from the activity that has escalation to the Smartobject activity and another line back from the Smartobject activity to the activity that has escalation (loop)

 

change your escalation to (Go To Activity) and select the smartobject acivity.

 

when the escalation fires the instance will be directed to the smartobject activity and execute the create method then it will return to the main activity.

 

wish this helps

Badge +4

Hi,

Use the Action Code section. This is the section that, for example would do the built in "Go-To Activity"

But I am with Mustafa on this one, his approach is much simpler and also takes K2's best practice approach of "No-Code"

Regards
Pieter

Badge +13

Other considerations:

 

1. If process has 10 activities that have escalation, this would mean creating 10 activities, or a process data field to record which activity the escalation comes from, and route back to the correct activity. 

 

2. The use of GotoActivity would prohibit the use of parallel activities.   I don't think 4.6.10 has the option to not affect other parallel activities in the GotoActivity GUI setting.

 

3. When returning to the main activity you are executing the events again, and it's resetting escalation tracking such as Repeat x times.

 

Reply