Subexpression builder

Use the subexpression builder to build complex rule conditions from subexpressions by using AND, OR, NOT and parenthetical grouping. The rule builder validates the rule when you apply the changes, and alerts you to mismatched parentheses, and unsupported logic operators.

To view this administrative console page, click Servers > Server types > On demand routers > odr_name > On demand router properties > Generic server cluster service policies > work_class_name > Addrule > Subexpression builder.

To modify rules with the Subexpression builder, you must have administrator administrative privileges.

Select operand

Depending on the protocol you select, different operands are displayed. The following table includes the operand names as displayed in the console, the actual operand as it will appear in the expression, the valid protocols per operand, and the description for each operand.

Table 1. Operands and their descriptions
Operand displayed Operand Valid protocols Description
Application name application IIOP The name of the application where the EJB is contained.
Client host clienthost HTTP, SOAP, IIOP The fully-qualified client host name. This is the value of the internet protocol (IP) command host name. This operand does not support numeric operators such as >, >=, <, <=.
Client port clientport IIOP The client port name.
Client IPV4 clientipv4 HTTP, SOAP The Internet Protocol Version 4 address of the client, using the dotted quad address type: n.n.n.n
Client IPV6 clientipv6 HTTP, SOAP The Internet Protocol Version 6 128-bit address type of x:x:x:x:x:x:x:x of the client computer.
Cookie header name cookie$<name> HTTP, SOAP A cookie name. For example, the expression cookie$My_Cookie_Name='My_Cookie_Value' tests a request to see if it contains a cookie named My_Cookie_Name with a value of My_Cookie_Value. To test for the presence or absence of a particular cookie, use one of the following expressions:
  • cookie$MyCookieName IS NOT NULL
  • cookie$MyCookieName IS NULL
EJB module name ejbmodule IIOP The module name of an EJB.
EJB name ejbname IIOP The name of an EJB.
EJB method name ejbmethod IIOP The name of a method within the EJB.
Group IDs gids$<name> HTTP, SOAP The group ID of the request sender.
HTTP method HTTPMethod HTTP, SOAP The HTTP method for the request. Possible values are POST, GET, PUT, and DELETE.
MIME type MIMEType HTTP, SOAP The MIME type of the request.
Port port HTTP, SOAP, IIOP The listening port where service is provided on the host.
Protocol protocol HTTP, SOAP The communications protocol that transmits the request. Currently supported protocols are HTTP, HTTPS, SOAP, and SOAPS
Request header name header$<name> HTTP, SOAP

A header name and value. For example, the expression header$Host='localhost' tests a request to see if it contains an HTTP host header with a value of localhost. To test for presence or absence of the host header, use one of the following expressions:

header$Host IS NOT NULL ,header$Host IS NULL

Request query parameter name queryparm$<name> HTTP, SOAP A query parameter name specified on the request URL. For each request, there is a name/value pair map of query parameters, if they exist. The on-demand router (ODR) uses the request query parameter name as a key to search the parameter map, and if it exists, extracts the value to evaluate the rule expression. If the rule matches, then the specified action is taken. Otherwise, the default action for the work class in which the expression is defined is used.
For example, the expression queryparm$timezone=EST tests a request to see if the request contains an HTTP query parameter named timezone with a value of EST. To test for presence or absence of a query parameter, use one of the following commands:
  • queryparm$timezone IS NOT NULL
  • queryparm$timezone IS NULL
Roles roles$<name> HTTP, SOAP The role of the request sender.
Server host serverhost HTTP, SOAP, IIOP The fully-qualified host name of the server. This operand does not support numeric operators such as >, >=, <, <=.
Server IPV4 serveripv4 HTTP, SOAP The IP address of the server machine using the IPv4 dotted quad address type n.n.n.n.
Server IPV6 serveripv6 HTTP, SOAP The IPv6 128-bit address type of x:x:x:x:x:x:x:x following RFC 1924 of the server machine.
Time time HTTP, SOAP, IIOP

The time operand has the following format:

dayOfWeek/dayOfMonth/month/year::hour:minute:second
  • dayofWeek values include Sun, Mon, Tue, Wed, Thu, Fri, Sat.
  • dayOfMonth includes values of 1-31.
  • month is the numeric number representing the month, starting with January as 1 and December as 12. For example, a numeric value of 5 represents the month of May.
  • year is the 4 digit year. For example, 2007.
  • hour is the hour of day in the 24-hour clock.
  • minute are integers ranging from 0-59.
  • second are integers ranging from 0-59.
Note: Omissions and wild cards are not supported for the time operand.

The forward slash (/) is used to separate date parameters, the double colon (::) is used to separate the date and time parameters, and the colon (:) is used to separate the time of day parameters. Note that it is the boolean result of the entire rule in which the time operand is used that determines the routing action taken.

User ID uid$<name> HTTP, SOAP The user ID of the request sender.
Virtual portal virtualportal HTTP, SOAP The virtual portal is the request URL minus the context root for the WebSphere® Portal application's web module. If a given request matches the virtual portal defined, then the routing action defined for that rule is taken.
XPath expression xpathexpr SOAP

The XPath string expression has a required field used to contain the XPath expression and an optional field for defining local namespace(s). If all the name spaces contained in the XPath expression are standard, then the second field can be optional. If there are multiple local namespaces, then separate each with a comma (,). The following is an example of an xpathexpr with one local namespace definition:

xpathexpr$/soap:Envelope/soap:Body/m:getTimeZone/n:clientId$m\\=http://test.classify.ws.ibm.com,n\\=http://test2.classify.ws.ibm.com = \\'1000\\' or operation IS NOT NULL

Operator

  • = The equality operator expresses a case-sensitive match.
  • <> The not equal operator expresses that the operand value is not equal to the value you enter.
  • > The greater-than operator is for use with numbers.
  • >= The greater-than or equal to operator is for use with numbers.
  • < The less-than operator is for use with numbers.
  • <= The less-than or equal to operator is for use with numbers.
  • AND: For xx AND yy, expresses matches that contain both xx, yy.
  • BETWEEN: This operator is used with AND to select a range of values inclusive of the first, or low, value and the last, or high, value. Together, they operate on numbers and dates.
  • EXISTS: This Boolean operator checks for an operand or the result of a compound subexpression, for example, while checking for certain HTTP header element attributes.
  • IN: This operator expresses an operand with multiple values in a single expression. For example, if, for an operand called port, you want to express that the port value can be any or all of the values such as 9080, 9090, 9091, the expression fragment is port IN (9080,9090,9091). How the values inside the brackets are expressed depends on the data type of port. If port is an integer, the correct syntax is the values without quote marks. If port is a string, the correct syntax is port IN (9080,9090,9091).
  • IS NULL: This operator expresses that a validation of the query shows that the requested parameter does not exist.
  • IS NOT NULL: This operator expresses that a validation of the query shows that the requested parameter exists.
  • LIKE: This operator expresses pattern matching for string operand values. The value must contain the wildcard character percent sign (%) in the position where the pattern matching starts. For example, the expression, host LIKE %blanca, matches the word blanca, or any other word that ends in blanca, while the expression host LIKE blanca% matches the word blanca or any other word that starts with blanca, and the expression, host LIKE %blanca% matches the word blanca or any word that has blanca embedded in it.
  • NOT: For NOT xx, this operator expresses matches that do not contain xx.
  • OR: For xx OR yy, this operator expresses matches that contain either xx, yy.

Value

Depending on the operator that you choose, type in a value for the subexpression that you want to create.

Build subexpression

Generate the subexpression as a result of the operand, operator, and values that you specified.

Generated subexpression

Copy and paste this subexpression into your rule.



File name: wc_rulebuilder_detail.html