SPEL: Dummy atevs cancellation

Document created by cdtj Champion on Nov 25, 2015
Version 1Show Document
  • View in full screen mode

In our production environment we had about 300 000 active Attached Events but as I found 170 thousands of them was dummy.


What I name dummy attached event?

In my vision dummy attached event is event that never triggers,

this could happen on system lag, animator_nxd error, invalid customization, data import or any other abnormal behavior.



What is condition to determine event as dummy?

I selected 3 filters:

     - atev haven't linked object (obj_id);

     - object is not exists in the system; (regular thing for Workflow Tasks because they could be easily deleted)

     - object is inactive; (as we know all events should stop when object becomes inactive);



What this macro do?

This macro is looking for active attached events,

I selected 2 statuses for this purpose:

     2 - running;

     12 - paused;

If event matches conditions it will be canceled using "cancel_me" method.



Before we start

This is fully automated macro but I can't guarantee that everything will pass fine, so I highly recommend to:

     - make a backup of affected atevs, this could be done via this command:

pdm_extract -f "select * from Attached_Events where status_flag IN (2, 12)" > atev.txt

     - run it on testing env first;

     - know SPEL basics;




This macro is presented as frg file and can be executed via bop_cmd,

more information could be found inside of file.



Comments or suggestions are welcome!