Skip to main content

Hi,


I just want to make a test application to test escalation process in K2.Net.


My app consists of just one activity. The start property is set to "start immediately", succeeding rule is set to "K2.ProcessInstance.DataField["test"].Value=true" & an escalation rule is set to set an email after 1 minute.


The default default value for "test" variable is set to "false". So, succeeding rule for the activity is always false. So, activity should never get completed & must execute escalation task. But, for some reason escalation task is not running at all.


Basically what I want is to have an application with just one process & the escalation rule for the process must be executed when a process level variable(i.e. "test") is "true". Please let me know how can I do this.


 

HI Ankita,


What you are trying to do should be working. Could you please tell me what events reside in the Activity that you have the escalation specified on?


Could you also verify for me that infact the K2 Service is in fact not attempting to send the email after 1 minute by opening "Services" on the machine and stop the K2 Server service.  Then start the K2 Server in console mode, 1 minute after starting your workflow and you recieving any errors and do you see the server attempting to send the email?


Thanks,


-mike


Hi Mike,


In the process, I have just one activity & this activity has just one server mail event. This event is working fine. Once I run the process, I get the mail send by this server event. I have the same code to send mail with a different subject in escalation action. So, ideally if it works in server mail action, it should work in escalation action also, but its actually not working.


If I set start time to "1 minute after planning", then I see the process instace in service manager. It is active for one minute, then it executes, send mail mentioned in server mail event & ends. The problem is that it should not end because I have set its succeeding rule to a condition that will always be false. Ideally, the instance should remain active for one more minute & then escalate.


Log Entry:


"ExecEscalationRule","ProcessInstance::ExecEscRule","5070 Executing Escalation Rule Escalation1(16), Act:Submit Registration Request(12), Proc:DemoProcess(162)","14345975b43d4fc79c2f2567892b7123","E1A3C86A"
"258","2007-07-18 12:41:31","Debug","WorkActivity","5010","ExecCodeItem","ProcessInstance::ExecuteCode","5010 Executing Code Item EscalationRule - Escalation1","f195d34b38974f4c9eb9539590df3716","A87E989B"
"259","2007-07-18 12:41:31","Debug","WorkActivity","5170","ExecutedItem","ProcessInstance::ExecEscRule","5170 Executed Proc:DemoProcess(162), Item:Escalation1.EscRule, Status:Completed","f910c672a0a2428588a12055fe71ebaf","40FCF758"
"260","2007-07-18 12:41:31","Debug","WorkActivity","5020","ExecServerEvent","ProcessInstance::ExecServerEvent","5020 Executing Server Event Server Mail(17), Act:Submit Registration Request(12), Proc:DemoProcess(162)","43e3dc267fe0488699978fab8ba2af82","1EF82850"
"261","2007-07-18 12:41:31","Debug","WorkActivity","5010","ExecCodeItem","ProcessInstance::ExecuteCode","5010 Executing Code Item ServerEvent - Server Mail","283f4cfd2f924209a3d737141e6cca18","8A42CC3B"
"262","2007-07-18 12:41:31","Debug","WorkActivity","5170","ExecutedItem","ProcessInstance::ExecServerEvent","5170 Executed Proc:DemoProcess(162), Item:Server Mail.ServerEvent, Status:Completed","ea37025374bf481abbc848ba7891ade3","9B705BE9"
"263","2007-07-18 12:41:31","Debug","WorkActivity","5080","ExecSucRule","ProcessInstance::ExecSucRule","5080 Executing Succeeding Rule for Act:Submit Registration Request(12), Proc:DemoProcess(162)","74df3610d0e44c8eb1304841c5d14160","0A9C7CFB"
"264","2007-07-18 12:41:31","Debug","WorkActivity","5010","ExecCodeItem","ProcessInstance::ExecuteCode","5010 Executing Code Item SucceedingRule - Submit Registration Request","2d8bf25f1e5d4412bf3b79dd9d857a50","5A22C4AB"
"265","2007-07-18 12:41:31","Debug","WorkActivity","5170","ExecutedItem","ProcessInstance::ExecSucRule","5170 Executed Proc:DemoProcess(162), Item:Submit Registration Request.SucRule, Status:False","1e1d38e7e3f64ebb95b095820d113dc8","EEFCFDB3"   "266","2007-07-18 12:41:31","Error","WorkActivity","5222","ProcInstNotFoundExec","K2Worker::ExecEscalation","5222 Process Instance 162 not found while executing Escalation    at SourceCode.Logging.Logger.ThrowLogMessage(MessageObject LogMessageObj)


As it is clear from these log entries, the server event is completed, the SucRule is evaluated to false. But escalation is not running because of the error "Process Instance 162 not found while executing Escalation". Now the problem is if succeeding rule is false then why is the process ending after executing server event.


Thanks,


Ankita.


Hi Ankita,


Unfortunatley your succeding rules will not work like this.  You need to have a client or (human interaction) within an actiivty for your succeding rules to process.  Try doing this, and by the way this is a nice practice to use when trying to debug or see what's going on under the hood when your design your processes.


Start >> Programs >> Administrative Tools >> Services and stop the "K2.net 2003 Server" service. Next open the K2.net Server in "Console Mode" - Start >> Programs >> K2.net 2003 >> K2.net 2003 Server.   (please note: when running the K2 Server in console mode you must logon to the server with a AD user, not a local user, that has sufficient rights to your SQL DB, exchange/SMTP server etc).


Now try to start the process again and watch and examine the output to the console.  You will see that your succeding rule did in fact fail. However since there were no client events or slots contained in the activity it automatically continued on processing.


I suggest you take an alternate approach in your process design.  Is there a particular reason why you would like to use an escalation to send a second email?  Could you instead have an activity directly after the first that contains start rule acting as your delay?


If I can assist further please let me know.


PS: Remember when your done viewing the console go back in and start the "K2.net 2003 Server" service.


Hi,


I think what you are saying could be a reson for faliure of escalation.


Actually what I want to do is just to give a demo on K2.Net. I have considered a very small workflow which consists of just 2 activities. The process is:


1) A user will submit registeration request on my site, this will trigger a K2 process's activity "Submit Registration". This activity has a server mail event that send a mail indicating that a registration request has been logged in.


2) Then the approver logs into the site, approves the request, DB is updated accordingly & another activity "Update Registration Request" is fired. This has an SQL event which checks DB status of the registration request & send approval/Rejection mail to user.


So, there are just two activities, from start there are two flow lines, line rules being "K2.ProcessInstance.DataFieldl"Task"].Value="R"" for executing "Submit Registration" activity & " "Task"].Value="U"" to execute "Update Registration Request" activity.


Now, the process flow might be clear to you. Till here everythings fine. Next, I want to escalate a mail to Approver 2, if Approver 1 (used in SQL event of 2nd activity) does not approve/reject the request within one minute (for test). The SQL event of "Update Registration Request" activity sets a process level datafield "UpdateComplete" to true if in DB, reg. request status is approved/rejected.


For escalation I was using the check "UpdateComplete=false" condition as succeeding rule in "Submit Registration" activity. I am linking my C# code to K2 process, I create an instance of the process, execute resgistration activity (i.e activity 1), store the process instanceID in session, then using this ID I again access the same process instance on registration request approval page to execute activity 2, so that "UpdateComplete" value for the same process instance is updated.


Please let me know what changes should I make to get this flow running.


Reply