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-17-2012 08:13 AM
Instead of stopworkflow(false) try setWorkflow(false)
(note the camelCase with the capital "W")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2012 09:51 AM
Yes. This solution is working as well. Thanks once again.
Want to know the implications of stopping the workflow when the script action is running.
My code looks like below:
var isWorkflow = !current.wf_activity.nil();
if(isWorkflow) {
grCMDB.setWorkflow(false);
}
grCMDB.update();
if(isWorkflow) {
grCMDB.setWorkflow(true);
}
Can you think of any scenarios which could be impacted because of the stopping of workflow in the script action?