|
Rules Guide |
This chapter describes the actions installed with your Director project in Workbench. It has these sections:
For information about how to use conditions and actions in the Rule Editor, see
Rule and Macro Editors.
Condition and action class files, sources, and supporting files are contained in JAR files that are added to your project using the Director EAR Wizard. The default location for the JARs in your project is ResourceSet/Web-INF/lib. Here is a list of the JARs that are added, depending on the subsystems you select:
|
JAR file |
Subsystem dependencies |
|---|---|
|
RuleCA.jar |
Rule |
|
PortalCA.jar |
Rule and Portal |
|
WorkflowRE.jar |
Rule and Workflow |
|
CQA.jar |
Rule, Portal, and Content Management |
Some of the condition and action properties support the !valueOf template. You can either enter the actual value you want to use or specify a whiteboard key that holds the value you want. Properties that support this feature are marked with the ^ character. Use this format:
!valueOf.keyname
You can also specify a key that holds the name of another key. To get a value from another key, specify !valueOf.anotherkey.
For more information about the !valueOf construct, see
Using whiteboard values.
Some of the conditions and actions have properties for accessing a database. These properties include JDBC Driver and Database Name. These values vary with the database and server vendors. You should consult your database and application server documentation for details.
Here is a list of database drivers and URL patterns for some of the databases supported in Director:
Performs addition. The value you specify is added to a value stored in a whiteboard key.
Results The whiteboard key contains the new, incremented value. No response status or response phrase is set.
Specifies that a whiteboard key will be removed at some future time: either after a number of seconds or after a number of times accessed. Set seconds to zero to use the activation counter, and set the activation counter to zero to use seconds.
Results No immediate resultbut after the number of seconds has elapsed or the specified number of hits has occurred, the key is deleted.
Calculates the difference in years between a date on the whiteboard and the current date and stores the difference in another whiteboard key.
Setup Code in the component must add a key to the whiteboard using the name you specified in Date Key, or you could use the Save To Whiteboard action. The data type of its value must be Date.
Results The key specified in Detail Key contains the number of years between the dates. The value is saved as an integer.
Removes a key and its value from the whiteboard.
|
Property |
Description |
|---|---|
|
Detail Key ^ |
The name of the whiteboard key to be removed. |
Setup If you use a template for Detail Key, you need to add the key to the whiteboard either in your application or through another action (see the Save To Whiteboard action).
Results The whiteboard key and its value are removed. If the key doesn't exist, nothing happens.
Creates a Vector of objects from a specified database column and makes the Vector available from the whiteboard through a specified detail key.
NOTE All of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template
|
Property |
Description |
|---|---|
|
Key Column ^ |
The name of the column for the SQL WHERE clause. |
|
User ID ^ |
The user ID expected by the database. |
|
Detail Key ^ |
The name of the key that holds the object Vector name. |
|
Password ^ |
The password expected by the database. |
|
Object Name ^ |
The name of the object or objects to retrieve, for the SQL WHERE clause. |
|
SQL String ^ |
The SQL statement you want to execute. NOTE If you are using a template key for this value, place the expression in quotesfor example: "!valueOf.mySQL". |
|
JDBC Driver ^ |
The Java class name for the JDBC driver.
|
|
Database Name ^ |
The URL for the database. The format for the URL depends on the DBMS.
|
Does nothing. Use this action when you want nothing to happen if the conditions are met. You can also use it as a placeholder as you work on a rule.
TIP Instead of using the Default action, you can use the Set Response Status action to set a success status code. Portal code that uses the rule can check the status code to confirm that the rule ran correctly.
Deletes a cookie from the client. If the cookie exists, the action sets the cookie's age to zero, which signals the browser to delete it.
|
Property |
Description |
|---|---|
|
Cookie Name |
The name of the cookie you want to delete. |
Results Removes the cookie from the user's Web browser or other client. No status code is set. If the cookie does not exist, nothing happens.
Sets the response status and response phrase. Application code can check the response status and act accordingly.
|
Property |
Description |
|---|---|
|
Message ^ |
The text to store in the response phrase. Application code can display this text to the user to explain what the action is doing. |
Results The response status is set to 403 and the response phrase is set to the specified message. (Neither the console nor the log displays the response status.)
Displays the contents of a component.
|
Property |
Description |
|---|---|
|
CID |
The component ID. |
Displays the cookies and their values in the Rule subsystem log. By default, the log output displays on the server console. Use this action when debugging a rule.
For information on configuring logs, see the chapter on error handling in the Core Development Guide.
Displays the parameters in the request header and their values in the Rule subsystem log. By default, the log output displays on the server console. Use this action when debugging a rule.
For information on configuring logs, see the chapter on error handling in the Core Development Guide.
Displays the whiteboard keys and their values in the Rule subsystem log. By default, the log output displays on the server console. Use this action when debugging a rule.
For information on configuring logs, see the chapter on error handling in the Core Development Guide.
Performs division. The value you specify is divided into a value stored in a whiteboard key.
Results The whiteboard key contains the quotient of the division. If the divisor value is zero, the whiteboard key's value is set to the text Infinity. No response status or response phrase is set.
Puts a cookie named userID in the browser with a value of the portal user's ID. (Drop is used to mean dropping it into the browser, not dropping tables in a database.)
|
Property |
Description |
|---|---|
|
Maximum Number of Days |
The number of days before the cookie expires. |
Results The cookie is set in the browser. No response status or response phrase is set. If the user has disabled cookies, nothing happens.
Success or failure is reported in the log (the default log output is displayed on the server console.)
|
Property |
Description |
|---|---|
|
Rule ID ^ |
The ID of the rule you want to fire. Specify the ID (which is displayed in the Rule Editor). |
Tells the system to empty the caches that hold rules.
Gets a whiteboard Timestamp value stored in a specified Date key, formats it for the current locale, and saves the result to the whiteboard in the specified Detail key. See also Set Date On Whiteboard.
Setup A key must be on the whiteboard. The keyname is the value you specified in the Date Key property, and the key's value has a data type of Timestamp.
Results The formatted date text is put on the whiteboard using the key named in the Detail Key property. If the value for Date Key is not a valid Timestamp object, the Detail Key is set to an empty string.
Gets the value of the specified cookie.
Results Sets the response phrase to the cookie value.
Gets the value of a user attribute for the current portal context. The attribute must be set on the whiteboard in the specified key.
See also the
Set User Property action and the
Check User Property condition.
|
Property |
Description |
|---|---|
|
Key ^ |
The name of the attribute. |
Resets the user to Anonymous and removes all key/value pairs from the whiteboard.
Results Does not set a response status or response phrase.
Performs multiplication. The value you specify is multiplied by a value stored in a whiteboard key.
Results The Whiteboard Key contains the result of the multiplication. No response status or response phrase is set.
Returns the result of a query to the Content Management Subsystem as an XML string. This action is used in the Content Query sample application.
For more information, see Using the Content Query Action in Samples.
Removes a value and its key from the whiteboard.
|
Property |
Description |
|---|---|
|
Whiteboard Key |
The name of the key you want to remove. |
Results The key is removed. No response status or response phrase is set.
Formats a decimal value as text using the specified formatting. You can add special characters such as currency and percent signs. This action does not support formatting as phone numbers and other non-arithmetic formats.
Results The formatted number is stored as text in the key specified by Detail Key. The response type is set to TEXT and the response status is set to 302.
Returns the opening of an HTML BODY tag with a color attribute.
|
Property |
Description |
|---|---|
|
Background Color ^ |
A color value specified as text that would be recognized by a browser. You can specify a hexadecimal value, such as #FFFFFF, or a browser-supported color name. |
Results The action does these things:
Returns the specified text enclosed in HTML bold tags.
|
Property |
Description |
|---|---|
|
Value ^ |
The text you want to format with bold tags. |
Results Sets the response phrase to <b>value</b>. It does not set the response status or response type.
Returns the specified text preceded or followed by HTML break tags.
|
Property |
Description |
|---|---|
|
Value ^ |
The text to which you want to add break tags.
To put break tags around the response phrase, use the default value of !valueOf.response. |
|
After |
When selected, a break tag is added before the text. |
|
Before |
When selected, a break tag is added before the text. |
Results Sets the response phrase to one of the following:
The action does not set the response status or response type.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="CHECKBOX" VALUE="important" NAME="cb1" CHECKED>
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns HTML for a file upload field.
NOTE Three of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="FILE" VALUE="Select a file" NAME="fileupload" ACCEPT="image/*, text/html">
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns HTML for a hidden field.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="HIDDEN" VALUE="important" NAME="hfld1">
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns the JavaScript code you specify enclosed in HTML SCRIPT tags.
|
Property |
Description |
|---|---|
|
JavaScript ^ |
The JavaScript code to be returned. |
Results Sets the response phrase to HTML that looks something like this:
<SCRIPT LANGUAGE=JavaScript> [your code here] </SCRIPT>
The action sets the response type to TEXT and the response status to 302.
Performs a SQL query and creates an HTML SELECT element from the result set.
NOTE Several of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
|
Property |
Description |
|---|---|
|
HTML Tag |
The name of the SELECT element. The value is used for the NAME attribute. |
|
User ID ^ |
The user ID expected by the database. This is not usually the same as the portal user ID. |
|
SQL String ^ |
A SQL statement whose result set contains the values for the list. NOTE If you are using a template key for this value, place the expression in quotesfor example: "!valueOf.mySQL". |
|
Key Column |
The column whose values will be used for the VALUE attribute of each OPTION element. |
|
Size ^ |
The value for the SIZE attribute, which specifies the number of items to display in the list. Specify 1 for a dropdown list. |
|
Database Name ^ |
The URL for the database. The format for the URL depends on the DBMS.
|
|
JDBC Driver ^ |
The Java class name for the JDBC driver.
|
|
Password ^ |
The password expected by the database. This is not usually the same as the portal user's password. |
|
Detail Key |
A name used to create whiteboard keys for the result set and SQL statement. The name is used for the result set, and name.sql is used for the SQL statement. |
|
Children Column |
The column containing related information. Generally this is left blank. It requires the database to be organized with parent/child relationships. |
|
Width (%) ^ |
The value for the WIDTH attribute, which specifies the width of the list. This attribute is ignored by some browsers. |
|
Description Column |
The column whose values will be used as the text of each OPTION element. |
Results Sets the response phrase to HTML that looks something like this:
<SELECT id=opt1 name=opt1 size=1 width= 100"> <OPTION value="portalcorpid">Official <OPTION value="anonymous">Anonymous <OPTION value="administrator">User0 <OPTION value="contentadmin">User1 <OPTION value="default">null <OPTION value="sample">Sample <OPTION value="testID">Smith </SELECT>
The action sets the response type to TEXT and the response status to 302. The result set and SQL statement are stored on the whiteboard (see the Detail Key property in the table above). If you specify a Detail Key, the rule ends after this action.
Returns HTML for a password input field.
NOTE Several of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="PASSWORD" VALUE="PASSWORD" NAME="default" SIZE="25" MAXLENGTH="50" READONLY >
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns HTML for a radio button.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="RADIO" VALUE="One" NAME="radio1" CLASS="INPUT">
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns HTML for a reset button.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="RESET" VALUE="Reset">
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns HTML for a reset button.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="BUTTON" VALUE="Cancel" onclick="JavaScript code here">
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns HTML for a submit button.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="SUBMIT" VALUE="Submit">
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Constructs an HTML table tag, using the result set from the SQL query specified to create associated HTML table row and table data tags, and sets the result in the specified detail key.
NOTE Many of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
|
Property |
Description |
|---|---|
|
HTML Tag |
Appends a NAME or ID attribute to the TABLE tag element. |
|
User ID ^ |
The user ID expected by the database. |
|
SQL String ^ |
The SQL statement you want to execute. |
|
Border ^ |
The value for the HTML table BORDER attribute. |
|
Database Name ^ |
The URL for the database. The format for the URL depends on the DBMS.
|
|
JDBC Driver ^ |
The Java class name for the JDBC driver.
|
|
Query String ^ |
The value for the HTML hyperlink query string. |
|
Cell Spacing ^ |
The value for the HTML table CELLSPACING attribute. |
|
Display Headings |
When selected, appends the HTML table row for the table headings to the output buffer. |
|
Password ^ |
The password expected by the database. This is not necessarily the same as the application user's password. |
|
Cell Padding ^ |
The value for the HTML table CELLPADDING attribute. |
|
Detail Key |
A name used to create a whiteboard key for the result set and SQL statement. The name is used for the result set, and name.sql is used for the SQL statement. |
|
Width^ |
The value for the HTML table WIDTH attribute. |
|
Description Column |
The value for the column name in the result set whose data is used for the HTML OPTION tag DESCRIPTION. |
Returns HTML for a multiline text field.
NOTE Several of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
Results Sets the response phrase to HTML that looks something like this:
<TEXTAREA NAME="txt1" ROWS="25" COLS="50">This is where to enter text</TEXTAREA>
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns HTML for a single-line text field.
NOTE Several of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
Results Sets the response phrase to HTML that looks something like this:
<INPUT TYPE="TEXT" VALUE="TEXT" NAME="default" SIZE="25" MAXLENGTH="50" READONLY>
The action sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Submits a SQL query and formats the result set as XML. The root element is table, and its subelements are:
columns, which contains column elements that identify the column names.
tuples, which are the rows of data. Each tuples element contains a tuple element for each row. Each tuple element contains tuple subelements for each column in the result set. The order of these match the column elements. The order of the elements must be preserved.
NOTE Many of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
|
Property |
Description |
|---|---|
|
User ID ^ |
The user ID expected by the database. This is not usually the same as the portal user ID. |
|
Detail Key |
A name used to create whiteboard keys for the result set and the SQL statement. The name is used for the result set, and name.sql is used for the SQL statement. |
|
Password ^ |
The password expected by the database. This is not usually the same as the portal user's password. |
|
Description |
Text that will be the value of a description attribute assigned to the root element, which is called table. |
|
SQL String ^ |
A SQL statement whose result set contains the data to be formatted as XML elements. NOTE If you are using a template key for this value, place the expression in quotesfor example: "!valueOf.mySQL". |
|
JDBC Driver^ |
The Java class name for the JDBC driver.
|
|
Database Name^ |
The URL for the database. The format for the URL depends on the DBMS.
|
Results Sets the response phrase to XML that looks something like this:
<table description="test user list" key="test" sqlString="select * from FWUSERS">
<columns count="3">
<column value="USERID"/>
<column value="FIRSTNAME"/>
<column value="LASTNAME"/>
</columns>
<tuples count="2">
<tuple number="1">
<tuple value="portalcorpid"/>
<tuple value="Portal Corporate Administrator"/>
<tuple value="unknown"/>
</tuple>
<tuple number="2">
<tuple value="anonymous"/>
<tuple value="Portal Anonymous User"/>
<tuple value="unknown"/>
</tuple>
</tuples>
</table>
The action sets the response type to TEXT and the response status to 302. The result set and SQL statement are stored on the whiteboard (see the Detail Key property in the table above). If you specify a Detail Key, the rule ends after this action.
Sets the context response status 401, forcing the browser to ask for authentication.
Results The response status is 401.
Sets the response status to 412, which signifies the boolean value false.
Results The response status is 412.
Sets the response phrase to the specified text. You can use !valueOf templates to build a text value from phrases stored on the whiteboard.
Results Sets the response phrase. It also sets the response type to TEXT and the response status to 302. If Stop Processing is checked, rule processing ends.
Returns text associated with a whiteboard key or uses a default message.
NOTE The properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
Results Sets the response phrase to the message, stores the message on the whiteboard, sets the response type to TEXT, sets the response status to 302, and stops rule processing.
Sets the response status to 200, which signifies the boolean value true.
Results The response status is 200.
Puts the cookies the browser has sent onto the whiteboard. The whiteboard keys are created using the cookie name as the keyname and the cookie's value as the value for the key.
See the
Save Cookies To Whiteboard condition.
Puts the query string from the browser on the whiteboard using the specified key.
See the
Save Form Get Data To Whiteboard condition.
|
Property |
Description |
|---|---|
|
Whiteboard Key ^ |
The name of the whiteboard key. |
Puts the parameters in the request header on the whiteboard. The names of the request parameters are used as the whiteboard keys and the values of the request parameters are their values.
See the
Save Request Data To Whiteboard condition.
Saves a value on the whiteboard using the specified keyname.
NOTE Two of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
Results The value is set on the whiteboard. No response phrase or status is set.
Sends a mail message to a specified e-mail address. Use this action to send alerts or logging information to an administrator.
Results The mail is sent. No response phrase or status is set.
Sets the value of a component parameter for the current portal context. The component parameter must exist.
NOTE The properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
|
Property |
Description |
|---|---|
|
Key ^ |
The name of the parameter. |
|
Value ^ |
The value for the parameter. |
Creates a cookie or changes its value and expiration date.
Results The cookie is set. No response phrase or status is set.
Sets the current date on the whiteboard with a specified key and format. The default format is a timestamp and the default time is the runtime value.You can specify other formats and time values..
Sets the context response headers in the browser to be expired.
Results The headers are set to expired. No response phrase or status is set.
Sets the destination link in a workflow process. For use with a Rule Link the Workflow Editor.
Two of the properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
Sets the active pipeline's canProcessRequests flag to the On/Off for this action.
|
Property |
Description |
|---|---|
|
On |
When selected, the pipeline is active for this action. |
Result The active status is changed for this action only.
Sets a named parameter value in the HTTP response header (EbiResponse).
|
Property |
Description |
|---|---|
|
Key |
The name of the parameter being added to the response header. |
|
Value |
The text value associated with the parameter name. |
Results Sets the parameter using the keyname and value you specify. No response phrase or status is set.
|
Property |
Description |
|---|---|
|
Status |
A status value. You must use one of the numeric values identified in EbiResponse. For information, see the API Reference. |
Results Sets the status to the value you specify. If your rule performs several actions, the response status will be the last status that was set. To control the status value, make the Set Response Status action the last one in the rule.
Sets the value of a user attribute for the current portal context. The user attribute must exist.
NOTE The properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
|
Property |
Description |
|---|---|
|
Key ^ |
The name of the user attribute. |
|
Value ^ |
The value for the user attribute. |
Sets the specified value as an Integer associated with the current workitem. For use with a Rule Activity or a Rule Link in a workflow process.
NOTE If you use this action with a Rule Link, be sure the action section also sets the next destination. See Set Next Activity.
|
Property |
Description |
|---|---|
|
Priority ^ |
A string value. |
.
Sets the property value for the Document associated with a workitem in a workflow process. The document and property must exist and have been added previously to the workitem. The action handles locking and unlocking of the Document to set the property. For use with a Rule Activity or a Rule Link in a workflow process.
NOTE If you use this action with a Rule Link, be sure the action section also sets the next destination. See Set Next Activity.
The properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
|
Property |
Description |
|---|---|
|
Document Property ID ^ |
The ID for the property. |
|
Document ID ^ |
The Document ID. |
|
Property Value ^ |
The property value to set. |
Does the same as the SQL String action. There is no corresponding condition.
Executes a SQL statement and stores the result on the whiteboard. If more than one row is returned, only the last row in the result set is saved to the whiteboard.
See also the
SQL String condition.
NOTE The properties for this action support the !valueOf template construct. For more information, see Properties that support the !valueOf template.
|
Property |
Description |
|---|---|
|
User ID ^ |
The user ID expected by the database. |
|
Password ^ |
The password expected by the database. This is not necessarily the same as the portal user's password. |
|
SQL String ^ |
The SQL statement you want to execute. NOTE If you are using a template key for this value, place the expression in quotesfor example: "!valueOf.mySQL". |
|
JDBC Driver ^ |
The Java class name for the JDBC driver.
|
|
Database Name ^ |
The URL for the database. The format for the URL depends on the DBMS
|
Ends processing of the current rule. If the rule has been invoked as part of a rules pipeline, it ends the pipeline too.
Results Stops rule processing by throwing EboActionException.
Performs subtraction. The value you specify is subtracted from a value stored in a whiteboard key.
Results The whiteboard key contains the result of the subtraction. No response status or response phrase is set.
|
Rules Guide |
Copyright © 2002, SilverStream Software, LLC, a wholly owned subsidiary of Novell, Inc. All rights reserved.