What is the purpose of the "Set Issue Task SLA Violation" macro ?

Document ID : KB000095196
Last Modified Date : 09/05/2018
Show Technical Document Details
Introduction:
By default, the "Set Issue Task SLA Violation" macro is bundled with Service Desk Manager. Here we explain the purpose of this macro
Question:
What is the purpose of the "Set Issue Task SLA Violation" macro ? The macro is bundled with Service Desk Manager 14.1 and later and the definition is the following:

// Increment the 'sla_viol_status' of the task's attached_sla

if (!is_null(attached_event)) {
send_wait(0, attached_event, "set_ticket_violation", 1, this);
} else {
send_wait(0, top_object(), "call_attr", "wftpl", "set_workflow_task_violation", 1, this, group_leader);
}


 
Answer:
The macro can be executed in different contexts.

1. The first part gets involved, when the macro gets executed as an action macro based on an attached event. It will set the set_ticket_violation to 1 which means the SLA has been violated.

First part:

if (!is_null(attached_event)) {
send_wait(0, attached_event, "set_ticket_violation", 1, this);
}


2.
The second part gets involved, when the macro is executed based on a behavior and the "local" variable attached_event is null. It will set the set_workflow_task_violation to 1 which means the SLA has been violated.

Second part:

else {
send_wait(0, top_object(), "call_attr", "wftpl", "set_workflow_task_violation", 1, this, group_leader);
}



In both cases the data from sla_viol_status column / attached_sla table will be updated.
 
Additional Information: