Event handling - Need to run a script when the event is fired
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2012 10:58 AM
There is an event created on discovery_device_history table. Want to take some action when the event is fired.
I have already performed the following steps:
1. Register the event (event is registered in table : sysevent_register)
2. Fired the event in the business rule (gs.eventQueue("discovery.device.complete", current, current.sys_id, current.status));
3. Handle the event that is fired (Don't want to send notifications but have to run a script that performs certain actions)
Am stuck with step3. How do I run a script that performs certain action when a event is fired?
- Labels:
-
Analytics and Reports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2012 11:10 AM
Create a scehduled job and call the job in business rule instead of event (never did same using event, but I am sure it's possible via event as well).
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'YOUR_JOB_NAME_HERE');
Packages.com.snc.automation.TriggerSynchronizer.executeNow(rec);
ND
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2012 11:20 AM
Is there a way directly to read/process the event when it is fired?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2012 11:24 AM
You can check it at "Events" System logs. It will give you all the details regarding the event and you can reprocess the event from there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2012 11:37 AM
So you mean to create a scheduled job to read/process the entries for that event name from "sysevent" table. Is this correct understanding?