Rules Guide

CHAPTER 9

Rule JSP Tag Library

This chapter describes the JSP tags contained in RuleTag.jar:

For more information    For background information, see the chapter on using the exteNd Director tag libraries in Developing exteNd Director Applications.

 
Top of page

doAction

Description

Fires an exteNd Director action and returns the response phrase.

This tag wraps the doAction() method on the EbiAction interface and the getResponsePhrase() method on the EbiContext interface.

Syntax

  <prefix:doAction action="action" id="ID" />

Attribute

Required?

Request-time expression values supported?

Description

action

Yes

No

Specifies the class name for the action that will be fired.

id

No

No

Specifies the name of the variable that will be used to store the response phrase.

If no value is specified, the response phrase is inserted in the page at the location where the tag appears.

Examples

This example shows how to use the doAction tag to insert an action's response phrase at the tag location:

  <% taglib uri="/re" prefix="re" %>
  ...
  Result of Action is...
  <re:doAction action="com.sssw.re.action.ReturnAsHtmlBold" />

This example shows how to use the doAction tag to store an action's response phrase in a variable for further processing:

  <% taglib uri="/re" prefix="re" %>
  ...
  <re:doAction action="com.sssw.re.action.ReturnAsHtmlBold" id="results"/>
  ...
  The response phrase is: <%=pageContext.getAttribute("results")%>

 
Top of page

doCondition

Description

Fires an exteNd Director condition and returns a string that represents the boolean value returned by the condition.

This tag wraps the doCondition() method on the EbiCondition interface.

Syntax

  <prefix:doCondition condition="condition" id="ID" />

Attribute

Required?

Request-time expression values supported?

Description

condition

Yes

No

Specifies the class name for the condition that will be fired.

id

No

No

Specifies the name of the variable that will be used to store the result of the condition.

If no value is specified, the result is inserted in the page at the location where the tag appears.

Examples

This example shows how to use the doCondition tag to insert a condition's result at the tag location:

  <% taglib uri="/re" prefix="re" %>
  ...
  Result of condition is ...
  <re:doCondition condition="com.sssw.re.condition.CheckDate" />

This example shows how to use the doCondition tag to store an action's response phrase in a variable for further processing:

  <% taglib uri="/re" prefix="re" %>
  ...
  <re:doCondition condition="com.sssw.re.condition.CheckDate" id="result"/>
  ...
  The result is: <%=pageContext.getAttribute("result")%>

 
Top of page

conditionalRule

Description

Fires an exteNd Director rule that returns a true or false result.

This tag wraps the isTrue() method on the EbiRuleManager interface.

Syntax

  <prefix:conditionalRule rule="rule" owner="owner" id="ID" />

Attribute

Required?

Request-time expression values supported?

Description

rule

Yes

No

Specifies the ID for the rule that will be fired.

owner

No

No

Specifies the owner for the rule.

id

No

No

Specifies the name of the variable that will be used to store the result returned by the rule.

If no value is specified, a default id of ruleResult is used.

Example

  <% taglib uri="/re" prefix="re" %>
  ...
  <re:conditionalRule rule="sample.bonus" id="rule1"/></p>
  <%=pageContext.getAttribute("rule1")%>

 
Top of page

fireRule

Description

Fires an exteNd Director rule and returns the response phrase.

This tag wraps the fireRule() method on the EbiRuleManager interface and the getResponsePhrase() method on the EbiContext interface.

Syntax

  <prefix:fireRule rule="rule" owner="owner" id="ID" />

Attribute

Required?

Request-time expression values supported?

Description

rule

Yes

Yes

Specifies the ID for the rule that will be fired.

owner

No

No

Specifies the owner for the rule.

id

No

No

Specifies the name of the variable that will be used to store the response phrase.

If no value is specified, the response phrase is inserted in the page at the location where the tag appears.

Examples

This example shows how to use the fireRule tag to insert a rule's response phrase at the tag location:

  <% taglib uri="/re" prefix="re" %>
  ...
  <re:fireRule rule="myrule" />

This example shows how to use the fireRule tag to store a rule's response phrase in a variable for further processing:

  <% taglib uri="/re" prefix="re" %>
  ...
  <re:fireRule rule="myrule" id="results"/>
  ...
  The response phrase is: <%=pageContext.getAttribute("results")%>


Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...