AnsweredAssumed Answered

Error checking in deleted atev: Attempt to checkin with nothing checked out.

Question asked by veiba02 on Mar 15, 2018
Latest reply on Mar 19, 2018 by veiba02

Hi Team,
my requirement is to set the service type of an incident depending on the CIof the incident.
I defined a local attribute zServiceType for the nr object. When an incident is create and a CI was selected
a spel method is triggered, to attach the service type of the CI and the events to the new incident.
The Spel Method works fine, but a method in sla.spl fails with the following error message:

03/15 17:06:50.21 WIN-3HUAE9PVA1 spelsrvr             5296 ERROR        sla.spl               3734 Error checking in deleted atev: Attempt to checkin with nothing checked out.


I have no idea what's the reason for this behavior and how to solve the problem.

Do you perhaps know a solution?

Regards   Baerbel



The Spel Method looks like this:

cr::z_set_sla (...)
object group_leader, obj, nr_obj;
string method, affected_ci_id, nr_service_type, affected_ci_pid, incident_pid;
int  i, x, y, servicetype_id; 
method = "z_set_sla";

for(i=0;i<argc;i++)  logf(ERROR,"** %s argv[%d]=%s", method, i, (string)argv[i]);

affected_ci_id    = argv[6];
incident_pid = argv[2];

 if ( (string)argv[5] != (string)argv[6] && !is_null ((string)argv[6]) ) {
      //  logf(ERROR,"* ok *");
 x = sindex(affected_ci_id, "[^ ]");
 affected_ci_id = substr(affected_ci_id, x, strlen(affected_ci_id));
 x = sindex(affected_ci_id, "[ ]*$");
 affected_ci_id = substr(affected_ci_id, 0, x);
 affected_ci_pid = format ("nr:%s", affected_ci_id);
 nr_service_type = (string) expand(format("&{'%s' = nr.persistent_id-> zServiceType}", affected_ci_pid));
 //logf(ERROR,"nr Service Type , %s", nr_service_type);
 y = sindex (nr_service_type, ":");
 //logf(ERROR,"y , %d", y);
 servicetype_id = (int)substr(nr_service_type, y+1);
 //logf(ERROR,"Service Type ID , %s", servicetype_id);

 send_wait(0, top_object(), "get_co_group");
 if (msg_error()) {
  logf(ERROR, "Error getting group_leader: '%s'", msg[0]);
 } else{
  group_leader = msg[0];
  send_wait(0, top_object(), "call_attr", "attached_sla", "add_ast", incident_pid, servicetype_id, group_leader, "SLA", 2, 0); 
  if (msg_error()) { 
   logf(ERROR, "Error calling function add_ast: %s",msg[0]); 
   send_wait(0, group_leader, "uncheck");
   if (msg_error()) {
    logf(ERROR, "Error in uncheck: '%s'", msg[0]);
  send_wait(0, group_leader, "checkin");
  if (msg_error()) {
   logf(ERROR, "Error Attaching SLA on checkin: '%s'", msg[0]);
   send_wait(0, group_leader, "uncheck");
   if (msg_error()) {
    logf(ERROR, "Error in uncheck: '%s'", msg[0]);