TIBCO WebFOCUS Script Commands

How to:

Reference:

You can use WebFOCUS script (WFS) commands with WebFOCUS Client settings and HTTP header variables (see HTTP Header Variables Available for Script Processing) to further customize processing and control of the WebFOCUS Client.

You can use WFS commands to:

Tip: You can also use the following variables with WebFOCUS script commands:

Reference: WFS Command Syntax

You can place the following WFS commands in the site.wfs file, found at drive:\ibi\WebFOCUS82\client\wfc\etc.

Command Syntax

Description

<EXIT>

Causes the WebFOCUS Client to stop processing and exit immediately.

<INCLUDE> filename

Incorporates WFS logic from external files into standard WFS processing. The file must exist for processing to continue. For more information, see Separate WFS Logic Outside of Standard WFS Files.

<CONDITIONAL_INCLUDE> filename

Works in the same manner as <INCLUDE> filename, except that the file does not need to exist. For more information, see Separate WFS Logic Outside of Standard WFS Files.

<SET> variable (option)

Sends variables to the WebFOCUS Server for use with server procedures. It is used for variables that are not automatically sent to the Server. For more information, see Send Variables to the WebFOCUS Reporting Server.

<CALL> function(parm1,...)

Invokes WebFOCUS plug-ins. Each WebFOCUS plug-in can contain a maximum of ten input parameters. For more information, see Invoke the TIBCO WebFOCUS Servlet Plug-in.

<IF> variable operator value 
<ELSE>
<ENDIF>

Allows the conditional checking of WebFOCUS Client variables. For more information, see Conditionally Check Variables.

<IFDEF> variable 
<ELSE>
<ENDIF>

Checks for the existence of a WebFOCUS Client variable. For more information, see Check for the Existence of a Variable.

<IFNDEF> variable 
<ELSE>
<ENDIF>

Checks to see whether a WebFOCUS Client variable does not exist. For more information, see Check If a Variable Does Not Exist.

<SENDVAR> name={constant|&value}
<ENDSENDVAR>

Sends variables to the WebFOCUS Server for use with server procedures. It is used for variables that are not automatically sent to the Server. For more information, see Send Variables to the WebFOCUS Reporting Server.

Note: This syntax has been deprecated. It is recommended that the <SET> variable_name (pass) is used, instead of the <SENDVAR> technique.

Reference: WFS Language Syntax

When coding WFS commands, you can use the following syntax.

Command Syntax

Description

<! >
#

Comment characters that tell the WebFOCUS Client that the current line is a comment. The less than sign and exclamation point (<!) or hash (#) sign must be the first characters in the line. For example:

<! This is a comment.> 
# This is also a comment.
\\=

Continuation character that you can add at the end of any line. It tells the WebFOCUS Client that the next line is a continuation of the current line.

\n

Carriage return line feed that enables you to put multiple commands on a single line.

value = 
{constant|&variable}

Assigns a value to a variable in a WFS file as either a constant or a variable, where:

constant

Is a literal value. If you include quotation marks ("), they are passed as part of the variable.

Note: If the constant contains special characters, for example, an ampersand (&) or backslash (\), the backslash character (\) can be used as an escape character, to ensure that the special character is passed as part of the value.

&variable

Is a placeholder for a value.

Once a variable has been assigned a value, you can use the variable name, prefixed with an ampersand (&), in place of the value. You can concatenate literal values in this way. For example:

long_string = this is a 
long_string = &long_string very long string 
long_string = &long_string that requires 
multiple lines

Reference: Backslash Escape Character

When a backslash (\) is used as the escape character, you can:

  • Include a string delimiter, such as a single quotation mark ('), as part of the value within the string. If you precede the character with a backslash (\), the character is interpreted as data, not as the end-of-string delimiter.
  • Include a backslash (\) as part of the value within the string. You can precede the backslash (\) with a second backslash (\\).

When a backslash (\) is used as an escape character, it is not included in calculations based on the length of the string. A string of five characters and one escape character fits into a five-character variable.

Syntax: How to Include External Files in Standard WFS Processing

You can incorporate external files into standard WFS processing. The following <INCLUDE> command allows another WFS file to be called from standard WFS files. The custom file must exist for processing to continue. The <CONDITIONAL_INCLUDE> filename command works in the same manner as the <INCLUDE> filename command, except that the file does not need to exist.

<INCLUDE> filename
<CONDITIONAL_INCLUDE> filename

where:

filename

Is the name of the file to be included for WFS processing.

Example: Including External Files in Standard WFS Processing

The following command includes a file called custom.wfs in the client/wfc/etc directory, specified by the &CGI_BASE_DIR variable. This file must exist for processing to continue.

_exit=custom.wfs
-<INCLUDE> &CGI_BASE_DIR&_exit

The following conditional include command checks for a file called custom.wfs in the client/wfc/etc directory, specified by the &CGI_BASE_DIR variable.

_exit=custom.wfs
-<CONDITIONAL_INCLUDE> &CGI_BASE_DIR&_exit