How to trap the event for a suspended WorkItem

Posted by Marius Fiere on 31-Jan-2018 08:35

Dear all,

I have the following rule file in operation:

application InvoiceApproval_V5
group ifarules{
rule suspendifarule
activated by EVT_1 of BizLogic::W_SUSPENDED{PROCESSTEMPLATENAME : "InvoiceApproval_V5"}
then{
println("SUSPEND context.Exception::"+EVT_1.context.EXCEPTION);
// Code to get the desired set of user to send email to.
// Gather all information required to be sent in a mail.
val exceptionTrace=EVT_1.context.EXCEPTION; // this variable carries the exception trace that would clarify the reason for the same, to the recipient.
val PIID=EVT_1.context.PROCESSINSTANCEID;
val wname=EVT_1.context.WORKSTEPNAME;
val WIID=EVT_1.context.WORKSTEPID;
val processTemplateName = EVT_1.context.PROCESSTEMPLATENAME;
}
rule activateifarule
activated by EVT_1 of BizLogic::W_ACTIVATED{PROCESSTEMPLATENAME : "InvoiceApproval_V5"}
then{
println("ACTIVATE context.Exception::"+EVT_1.context.EXCEPTION);
// Code to get the desired set of user to send email to.
// Gather all information required to be sent in a mail.
val exceptionTrace=EVT_1.context.EXCEPTION; // this variable carries the exception trace that would clarify the reason for the same, to the recipient.
val PIID=EVT_1.context.PROCESSINSTANCEID;
val wname=EVT_1.context.WORKSTEPNAME;
val WIID=EVT_1.context.WORKSTEPID;
val processTemplateName = EVT_1.context.PROCESSTEMPLATENAME;
}

}

whilst I do see each and every activation of a workstep resulting in a log line, I don't see one for when a task becomes suspended (and yes I have made sure some workstep always become suspended to track this).

Any idea's on how to get this to work would be highly appreciated...

Posted by Marius Fiere on 14-Mar-2018 05:20

It turned out to be a template name issue

All Replies

Posted by Karthikeyan Bhaskaran on 01-Feb-2018 01:58

I am assuming this rule was created at the Process (dragging the rule on the Diagram) and not at a Workstep level.

Just a thought - if you replace EVT_1.context.PROCESSTEMPLATENAME etc with just

EVT_1.PROCESSTEMPLATENAME for the W_SUSPENDED rule, do you see any difference?

Posted by Marius Fiere on 01-Feb-2018 02:08

Karthikeyan,

thanks for the response... I created the rule using a texteditor (Notepad++) and used the RuleCompiler to compile the file to a bso. I fail to understand what you mean by replacing EVT_1.context.PROCESSTEMPLATENAME , for the first thing to happen is to write something to the bpmevents.out using the println("SUSPEND context.Exception::"+EVT_1.context.EXCEPTION); and I don't see this at all...

Kiind regards,

Marius Fiere

Posted by Marius Fiere on 14-Mar-2018 05:20

It turned out to be a template name issue

This thread is closed