We have configured remote action policy in BPPM to trigger remote action automatically whenever an event is received on cell that matches criteria defined in remote action policy’s selector and it works as expected. However, we dont want this remote policy to trigger remote action soon as event received, instead cell should wait for specific time period let's say 5 minutes before triggering remote action. Is this possible to apply timer on remote action execution? |
Yes, it is possible to trigger remote action on events after specific time period with the help of execute and timer MRL rules. #The selection criteria which events must satisfy in order to trigger automated remote action should be specified in the where clause of execute rule as below. For e.g. EVENT ($EV) where [ $EV.status != CLOSED AND $EV.status != BLACKOUT AND $EV.Customer equals 'XYZ'] Once an event which satisfies given criteria is received, below rule is triggered and it sets timer of 5 minutes on this event. execute set_timer_for_remote_action_execution: EVENT ($EV) where [ $EV.status != CLOSED AND $EV.status != BLACKOUT AND $EV.Customer equals 'XYZ'] when $EV.status: equals OPEN { delete_timers($EV, RemoteAction_Timeout); set_timer($EV, 300, RemoteAction_Timeout); opadd($EV,'remote_action_timer.mrl', 'RemoteAction_timeout_set',''); } END #Once timer is expired, below rule is triggered and it executes remote action. timer start_remote_action_execution: EVENT ($EV) where [ $EV.status != CLOSED AND $EV.status != BLACKOUT ] timer_info: equals RemoteAction_Timeout { perform($EV,'Create Remedy Incident,[]); } END Follow below steps to implement this workaround. 1. Place attached rule i.e. remote_action_timer.mrl in $MCELL_HOME\etc\<cell_name>\kb\rules directory. 2. Make an entry of this rule in .load file of $MCELL_HOME\etc\<cell_name>\kb\rules directory. 3. Compile the KB with mccomp -n <cell_name> 4. Restart the cell 5. Disable the Remote action policy (if any). After this send an event which has Customer slot set to "XYZ" and timeout of 5 minutes should be set on this event, this can be confirmed by looking at mc_operations slot of event and it will have similar value as below. mc_operations=['1/24/18 3:06 PM','remote_action_timer.mrl:execute set_timer_for_remote_action_execution','remote_action_timer.mrl','RemoteAction_timeout_set','']; Once timer of 5 minutes is expired remote action "'Create Remedy Incident'" will be triggered on this event which in turn will trigger corresponding script placed in $MCELL_HOME\etc\<cell_name>\kb\bin\* directory. |