CA Service Management

  • 1.  Object checked out by someone else

    Posted 05-13-2016 05:06 PM

    Hi I created the following spel just to add a log comment when a field is populated in a change. But I received the following error Object chg:429619 checked out by someone else

     

    what do I need to change on my spell

     

    mod file

    MODIFY chg POST_VALIDATE z_cico_log() 62175 FILTER(z_checkin_comments{});

     

    Spel

     

    chg::z_cico_log(...)

    {

    uuid who; 

    logf(ERROR,"1"); 

    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");

    logf(ERROR,"2"); 

    who=msg[0]; 

    logf(ERROR,"3");

    send_wait(0, top_object(), "call_attr", "api", "generic_activity_log", who, persistent_id, "test description", "LOG", 0, 0);

    logf(ERROR,"4"); 

    }



  • 2.  Re: Object checked out by someone else

    Posted 05-14-2016 02:27 AM

    Hi,

     

    I think that error caused by kind of conflict when you tried to update single object in same time within different sessions (1st session caused by z_checkin_comments attribute update via web, other session caused by "api" call).

    firstly, you can try to get actual error message:

    send_wait(0, top_object(), "call_attr", "api", "generic_activity_log", who, persistent_id, "test description", "LOG", 0, 0);
    int msg_i;
    for (msg_i=0;msg_i<msg_length();msg_i++) {
    logf(ERROR, "msg[%d]: %s", msg_i, msg[msg_i]);
    }
    

    then to resolve your problem you can try to "split" your session, you can use ON_POST_VAL or POST_CI triggers:

     

    using ON_POST_VAL mod file will not work with custom created attribute, so you need to add trigger to attribute via WSP or maj file:

    OBJECT chg {
      ATTRIBUTES Change_Request {
      z_checkin_comments STRING{
      ON_POST_VAL z_cico_log() 62175 ;
      };
      };
    };
    

     

    spl will be same instead of macro name:

    chg.z_checkin_comments::z_cico_log(...) {
         <code>
    }
    

     

    Regards,

    cdtj



  • 3.  Re: Object checked out by someone else

    Posted 05-24-2016 12:53 PM

    so you need to remove the mod file if you add the post_val?