Application Platform 10.7 | Application Platform API | webMethods Tag Library for JSP | <webm:scope>
 
<webm:scope>
Use the <webm:scope> tag to limit the variables in the Integration Server pipeline that are available for a specified block of code in the JSP.
The specified scope remains in effect until Integration Server encounters the next </webm:scope> tag.
Syntax
<webm:scope [recordName="document"]
[options="param(name=’value’)
param(stringList[]=’value1’, ’value2’,...’valuen’)
rparam(document={name1=’value1’;name2=’value2’;...namen=’valuen’})
rparam(documentList[]={name1=’value1’;name2=’value2’;...namen=’valuen’}|
{name1=’value1’;name2=’value2’;...namen=’valuen’})"]> block_of_code
</webm:scope>
Arguments
Argument
Description
[recordName="document"]
Specifies the document to use as the current scope.
[options="param(name= ’value’)"]
Adds to the current scope a String named name whose value is value.
Example
<webm:scope options="param(csClass=Gold)
param(csName='Joe Smith')"/>
[options="param(stringList[]= ’value1’, ’value2’,... ’valuen’)"]
Adds to the current scope a String List named stringList whose values are value1 value2...valuen.
Example
<webm:scope options="param(shipPoints[]=BOS,LAX,NYC,PHL)
param(warehouseLoc[]=’Los Angeles’,Philadelphia)"/>
[options="rparam(document={ name1=’value1’; name2=’value2’;...   namen=’valuen’})"]
Adds to the current scope a Document named document whose variables are name and whose values are value.
Example
<webm:scope options="rparam(custServiceInfo=
{csClass=Gold; csPhone=’800-444-2300’;
csRep=’Ann Johnson’})
rparam(buyerInfo={buyerName=’Joe Smith’;
buyerPhone=’800-333-1234’})"/>
[options="rparam(documentList[]={ name1=’value1’; name2=’value2’;...   namen=’valuen’}| {name1=’value1’; name2=’value2’;... namen=’valuen’})"]
Adds to the current scope a Document List named documentList whose variables are name and whose values are value.
Example
<webm:scope options="rparam(custServiceCtrs[]=
{csName=Memphis;csPhone=’800-444-2300’}|
{csName=Troy;csPhone=’800-444-3300’}|
{csName=Austin;csPhone=’800-444-4300’})
rparam(custServiceReps[]={csRep=’Ann Johnson’;csExt=27}|
{csRep=’John Jones’;csExt=28}|
{csRep=’Chris Smith’;csExt=29})"/>
Usage Notes
*If you specify multiple options, use a space to separate the options.
*If the value of a variable contains spaces, enclose the value within single quotes.
*If you set the value of a variable with one of the options, the value that you specify will replace the current value of that variable.
*When you use the <webm:scope> tag in a JSP, the entire tag must appear on one line.
Examples
*To code set a scope to the Document buyerInfo and insert the information from the scope into the HTML page produced by the JSP:
<webm:scope recordName="buyerInfo">
<p>Shipped To:<br>
<webm:value variable="companyName"/><br>
<webm:value variable="streetAddr1"/><br>
<webm:value variable="streetAddr2"/><br>
<webm:value variable="city"/>
<webm:value variable="state"/>
<webm:value variable="postalCode"/>
</p>
</webm:scope>
*To set a scope to the Document buyerInfo, add variables named buyerClass and shipPoint to the scope, and insert the information from the scope into the HTML page produced by the JSP:
<webm:scope recordName="buyerInfo"
options="param(buyerClass=Gold) param(shipPoint='BWI Hub')">
<p>Shipped To:<br>
<webm:value variable="companyName"/><br>
<webm:value variable="streetAddr1"/><br>
<webm:value variable="streetAddr2"/><br>
<webm:value variable="city"/>
<webm:value variable="state"/>
<webm:value variable="postalCode"/>
</p>
<hr>
<p>Point of Departure: <webm:value variable="shipPoint"/><br>
Customer Class: <webm:value variable="buyerClass"/></p>
</webm:scope>
*To set a scope to the Document buyerInfo, add variables named buyerClass and shipPoint from a Document named shipInfo to the scope, and insert the information in the scope into the HTML page produced by the JSP:
<webm:scope recordName="buyerInfo"
options="rparam(shipInfo={buyerClass=Gold;shipPoint='BWI Hub'})">
<p>Shipped To:<br>
<webm:value variable="companyName"/><br>
<webm:value variable="streetAddr1"/><br>
<webm:value variable="streetAddr2"/><br>
<webm:value variable="city"/>
<webm:value variable="state"/>
<webm:value variable="postalCode"/>
</p>
<hr>
<p>Point of Departure: <webm:value
variable="shipInfo/shipPoint"/><br>
Customer Class: <webm:value variable="shipInfo/buyerClass"/></p>
</webm:scope>
*To set a scope to the Document buyerInfo, adds a variable named shipPoints to the scope, add variables named name and ssid from a Document List called custInfo, and insert the information in the scope into the HTML page produced by the JSP:
<webm:scope recordName="buyerInfo"
options="param(shipPoints[]=DC,VA,LA,MD)
rparam(custInfo[]={name=Joe;ssid=ssid1}|{name=John;ssid=ssid2})">
<h3>Ship Points: </h3>
<webm:loop variable="shipPoints">
<webm:value /><br>
</webm:loop>
<h3>Customers: </h3>
<webm:loop variable="custInfo">
<webm:value variable="name" />, <webm:value variable="ssid" /> <br>
</webm:loop>
</webm:scope>