CA Service Management

  • 1.  Can use wait function on "api"?

    Posted Sep 21, 2017 08:39 AM

    Hi,

     

    We use "api" on spel files.for example send_wait(0, top_object(), "call_attr""api""update_object", who, "site:1000104", NULL, NULL, 0"name""test123"); . 

    The call is being locked while updating the group while the call is being updated.What suggestion do you have to prevent it from locking?Can we use wait function or time_out?


  • 2.  Re: Can use wait function on "api"?

    Broadcom Employee
    Posted Sep 21, 2017 10:16 AM

    you used send_wait(0, ...)...why not use send_wait(time_out, ...) if you don't want it locked(as the object is being updated)? for example

    int mywaittime;

    mywaittime=send_wait(50,...);

    if(mywaittime){

    printf("wait for 50 seconds but the object is still locked...no operation is done from this spel statement\n");

    }else{

    ...}



  • 3.  Re: Can use wait function on "api"?

    Posted Sep 21, 2017 10:29 PM

    And as a final alternative (for me it's usually the first alternative to examine) it's often possible to configure an Activity Notification event to perform an update following some other event, such as creating a ticket (initial), updating the status, or updating a specific field.  What are the business rules that specify when you need to update the group?



  • 4.  Re: Can use wait function on "api"?

    Posted Sep 21, 2017 11:29 AM

    hi,

    best way to avoid locks is to use Attached event with Action macro to perform an update.

    You can combine method recommended by Chi_Chen with attaching event in this way:

    int send_wait_failed;
    send_wait_failed = send_wait(50, ...);
    if (send_wait_failed) {
    // attach an event to perform update when it's possible
    }else{
    // update done
    }

    Regards,

    cdtj



  • 5.  Re: Can use wait function on "api"?

    Posted Sep 21, 2017 11:49 AM

    You can also use POST_CI trigger to avoid locks.