CA Service Management

 View Only
  • 1.  How to cancel the event if the condition test is false

    Posted May 09, 2018 01:46 PM

    I'm trying to cancel an event the condition set to it is false. is there any Action Macro defined for it?



  • 2.  Re: How to cancel the event if the condition test is false

    Broadcom Employee
    Posted May 09, 2018 02:45 PM

    Hello,


    Can you provide details on how the event is meant to work?  What you are attempting to achieve?

    Usually, with events, they will assess as:

     

    If <condition macro>

    then <action on true>

    else <action on false>

     

    If you leave <action on false> blank, that effectively is the same thing as the event doing nothing.  It will only perform the <action on true> so long as <condition macro> = true.



  • 3.  Re: How to cancel the event if the condition test is false

    Posted May 09, 2018 03:20 PM

    I'm trying to send an e-mail as long the ticket is set to a specific status



  • 4.  Re: How to cancel the event if the condition test is false

    Broadcom Employee
    Posted May 09, 2018 03:26 PM

    My advice is to use the SLOs and repeat the event.

     

    Suppose you have a ticket set to status "Pending".  What you can do is:

     

    -Create a site defined condition macro in which the condition is to check if status = Pending, it will return "true"

     

    -Create the event so that the above condition is in place and on True, send email.  On False, do nothing.

     

    -on the given SLO, have it run at whatever interval of time you want.  

     

    In the above example, the moment the status is set to a value other than Pending, the event will find as condition false and do nothing further.

     

    I believe that on False, you could run another action macro that stops the Service Type event perhaps?



  • 5.  Re: How to cancel the event if the condition test is false

    Posted May 09, 2018 03:10 PM

    Hi,

    you can cancel event using cancel_me function: SPEL EVENT methods 

    also event can be accessed from attached macro using attached_event object.

     

    Regards,

    Timur Alimov



  • 6.  Re: How to cancel the event if the condition test is false

    Posted May 09, 2018 03:18 PM

    In the action macro just use the cancel_me() function?



  • 7.  Re: How to cancel the event if the condition test is false
    Best Answer

    Posted May 10, 2018 01:52 AM

    I was wrong, cancel_me actually is a method, not a function.

    Have you checked cancel_me example?

    In the action macro you can access event using attached_event object, you need to check it out using group_leader, then cancel and check in. Regarding to attached event/macro execution logic it can be already checked out so you can simply try to cancel it without checking out/in it:

    send_wait(0, attached_event, "cancel_me");