Difference between revisions of "Throw Exception"

From PresenceWiki
Jump to: navigation, search
(Throw Exception Node)
(Throw Exception Node)
 
(One intermediate revision by one other user not shown)
Line 9: Line 9:
 
Here is an example of a Task that uses a Throw Exception Node:
 
Here is an example of a Task that uses a Throw Exception Node:
  
http://www.international-presence.com/wikidocs/images/throw_exception_task.png
+
[[file:throw_exception_task.png]]
  
 
In this Task the SQL Query looks up a list of servers. If no servers are found, this is a problem and the administrator needs to be alerted. A [[Decision Node]] checks the number of servers returned, and if it is not one or more an Exception is raised which is then handled by the Error Handler Node earlier in the Task.
 
In this Task the SQL Query looks up a list of servers. If no servers are found, this is a problem and the administrator needs to be alerted. A [[Decision Node]] checks the number of servers returned, and if it is not one or more an Exception is raised which is then handled by the Error Handler Node earlier in the Task.
  
 
The benefit of doing this (as opposed to just sending an email if the Decision returns false) is that we save time building the Task, because if there is an error generated by the SQL Query this will also be handled by the Error Handler.
 
The benefit of doing this (as opposed to just sending an email if the Decision returns false) is that we save time building the Task, because if there is an error generated by the SQL Query this will also be handled by the Error Handler.
 +
 +
 +
=== See Also ===
 +
 +
{{FlowControl}}

Latest revision as of 09:57, 20 August 2015

Throw Exception Node

This Node is useful when you want your Task to generate an exception and return execution to an earlier point.

For instance, you may not receive the expect results from a query, but this may not in itself generate an error.

Generally you will use Throw Exception Nodes in combination with an Error Handler Node.

Here is an example of a Task that uses a Throw Exception Node:

Throw exception task.png

In this Task the SQL Query looks up a list of servers. If no servers are found, this is a problem and the administrator needs to be alerted. A Decision Node checks the number of servers returned, and if it is not one or more an Exception is raised which is then handled by the Error Handler Node earlier in the Task.

The benefit of doing this (as opposed to just sending an email if the Decision returns false) is that we save time building the Task, because if there is an error generated by the SQL Query this will also be handled by the Error Handler.


See Also

Task Elements > Flow Control Task Elements > Throw Exception

Schedule Nodes | Decision Point Nodes | Start of Task | End of Task | Error Handler
Throw Exception | Passive Node | Log Entry | Sleep For n Seconds | While Node | Loop Node | Exit Loop Node | |Switch Node
Fork Execution | Join Forked Threads | Start Synch Block | End Synch Block | Event Notification Nodes



Task Elements | Resources