8.4
Table Of Contents
- Table of Contents
- Welcome to PlanetPress Workflow 8.4.1
- Basics
- Features
- The Nature of PlanetPress Workflow
- About Branches and Conditions
- Configuration Components
- Connect Resources
- About Data
- About Documents
- Debugging and Error Handling
- The Plug-in Bar
- About Printing
- About Processes and Subprocesses
- Using Scripts
- Special Workflow Types
- About Tasks
- Task Properties
- Working With Variables
- About Configurations
- About Related Programs and Services
- The Interface
- Copyright Information
- Legal Notices and Acknowledgements
Perl
$everythingOK = true;
if (everythingOK = true) {
$Script->{ReturnValue} = 1;
} else {
$Script->{ReturnValue} = 0;
}
Stopping Execution
When using a script, you may come to a point where you'd like the task to fail (raise an error)and trigger
your On Error tab under certain conditions. This can be done by using the scripting language's built-in error
features, described here.
Note that the value or description of the error will not be available to your error process if one is used.
However, when available, a description of the error message will be logged in the Watch log.
VBScript
In VBSCript, the Err.Raise method will halt the execution of the script and trigger the On Error tab. When
using On Error Resume Next, raising an error will not stop execution. See MSDN for the Raise method
properties and this page for a list of available errors to raise. In the case of VBScript, the error number used
will determine the message shown in the log.
Dim s
s = Watch.GetJobInfo(9)
If (s = "") Then
Err.Raise 449 ' Raises Error #449: "Argument is not optional"
Else
' Do somethign with Job Info 9!
Watch.Log "Job Info 9's value is: " + s, 4
End If
JavaScript
JavaScript uses the throw statement within try to create an exception which, if not caught using catch() ,
will cause the script execution to stop and the On Error tab to be triggered. See this page on W3Schools.
var s;
s = Watch.GetJobInfo(9);
if (s == "") {