CA Service Management

Expand all | Collapse all

Want Delay in .SPL

  • 1.  Want Delay in .SPL

    Posted 04-13-2017 08:03 AM

    Hi ,

     

    We have created 2 Post_validate triggers.

     

    1. POST_VALIDATE z_Attach_Update_Status_Remedy_Ticket_Event() 5030  FILTER( EVENT("UPDATE")&& status{->}); on cr object

    2. POST_VALIDATE z_Attach_Create_Remedy_Log_Activity() 5044 FILTER( EVENT("INSERT") && type != "LOGUPD" ); on alg object

     

    The first one to trigger event created in Events of Service Desk.

    The second one to get alg objects from the tickets and trigger to execute external file.

     

    Our requirement is to first trigger (1st ) update_status  then Log_activity.

     

    I have given 5030 which is lesser than activity log i.e. 5044. But first post_validate triggering event (attaching event) in the mean time log_activity event triggering.

    And We are getting activity logs before update_status. 

     

    Can we do something so that update status event trigger & executes first then log_activity be trigger.



  • 2.  Re: Want Delay in .SPL

    Posted 04-13-2017 08:14 AM

    Hi,

    I'm not sure that you can build correct sequenced order for 2 different objects, so my suggestion is to:

    - exclude status change activity from second trigger;

    - execute Log_Activity() manually in the end of the first macro;

     

    Regards,

    cdtj



  • 3.  Re: Want Delay in .SPL

    Posted 04-13-2017 08:29 AM

    Hi,

    Thanks for updating.

    Actually we need to send updates to other helpdesk on any updates happened in CA Service Desk and that will happen using attaching of events and in the action, we have used execute remote reference which will extract the CA Service Desk change (like status change )and it will be passed to other helpdesk.

     

    and in second , log is automatically creating which is from activity notifications of update status. We can nto use manually log activity as this requirement is limited to some tickets not for all tickets logged in Service desk.



  • 4.  Re: Want Delay in .SPL

    Posted 05-15-2017 02:48 AM

    Hello,

     

    Try a "sleep" command, or the suggestion to call another Event with a 10 second run time as per James here.

     

    I think that is the way to go. But you could also consider creating an Event with a duration as here: SPEL EVENT methods 

     

    Thanks, Kyle_R.



  • 5.  Re: Want Delay in .SPL

    Posted 05-15-2017 03:23 AM

    Kyle_R, using sleep in this context is not a good way, because sleep causes script hang and object being locked for all the time. Also, regarding to my bad experience, sleeping major objects like cr can cause permanent locks due to conflicts with other scripts...

    Regards,

    cdtj



  • 6.  Re: Want Delay in .SPL

    Posted 05-16-2017 10:05 PM

    Thanks for the warning. I'm not a hands-on coder so it is appreciated.

     

    Thanks, Kyle_R.