Siebel Developer's Reference > Tags >

swe:if, swe:switch, swe:case, swe:default


The SWE framework supports the following conditional tags: swe:if, swe:switch, swe:case, and swe:default.

swe:if

Purpose

Provides a simple conditional branching capability.

Usage

<swe:if condition="xxx,yyy,aaa:bbb,ccc:ddd,..."> ... </swe:if>

Attributes

Condition. The condition to check for. In the usage example above:

If the condition evaluates to TRUE, the body of the <swe:if> tag is processed. If the condition evaluates to FALSE, the body of the tag is skipped.

You can use the <swe:if> tag with any business service, such as a custom business service that checks an HTTP header. However, the output arguments for the business service must contain a property that includes the method name and a value of 1 or 0 to indicate whether it is true or false.

The common conditions supported by the preconfigured business service Web Engine State Properties are:

NOTE:  This tag does not provide an "else" capability like the if tags in programming languages. To get that behavior use the tags <swe:switch>, <swe:case> and <swe:default> described below.

swe:switch, swe:case, and swe:default

Purpose

These three tags are used together to provide a conditional branching capability similar to the switch, case, and default statements in C/C++ languages. The <swe:switch> is a container tag for the <swe:case> and <swe:default> tags. Anything other that <swe:case> and <swe:default> within the body of the <swe:switch> tag will be ignored. The condition to check is specified as an attribute of the <swe:case> tag. The <swe:case> tags are checked starting from the first <swe:case> tag. If any of the <swe:case> tags satisfies the condition, the other <swe:case> tags and the <swe:default> tags are skipped. If none of the <swe:case> tags satisfy their condition, the body of the <swe:default> tag is processed. There should only be one <swe:default> tag within the body of a <swe:switch> tag.

Usage

<swe:switch>

<swe:case condition="xxx">

...

</swe:case>

<swe:case condition="yyy">

...

</swe:case>

<swe:default>

...

</swe:default>

</swe:switch>

Attributes

Condition. Supported only in the <swe:case> tag. If the condition evaluates to TRUE, the body of the <swe:case> tag is processed. Any subsequent <swe:case> tags within the <swe:switch> tag are skipped without checking their associated conditions. If the condition evaluates to FALSE, the body of the tag is skipped.

NOTE:  The format for the condition is the same as the format described for the <swe:if> tag.


 Siebel Developer's Reference 
 Published: 23 October 2003