Show TOC

 Determining PathsLocate this document in the navigation structure

Use

Determining the path for a parameter value is the second step in using path replacement to dynamically parameterize commands and Web items.

Procedure

The path for the parameter value can be divided into two parts. The first part is a prefix that describes the element for the dynamic replacement and that references the data provider, Web item, or page. The path is specified in the second part, which starts after a question mark (?); this path follows the XPath notation.

path=<XML_PROVIDER_OBJECT>?<XPath>

Placeholder <XML_PROVIDER_OBJECT> has one of the following values:

  • DATA_PROVIDER for data providers
  • ITEM for Web items
  • VARIABLE_CONTAINER for variable values
  • PAGE for pages of a Web application

Placeholder <XPath> contains the path in XPath notation. With XPath notation, nested XML nodes and XML elements are represented as paths, and every XML element is separated by a slash (/). Attributes of an XML element can be queried using an at sign (@) (like @name, @type or @text). Function text() can be used to query the content of an XML element (see the example below).

Simple Example of Determining Paths

The value "true" from XML element HAS_INPUT_VARIABLES needs to be specified as a path:

<PAGE> 

<VARIABLE_CONTAINER>

<HAS_INPUT_VARIABLES value="true"/>

</VARIABLE_CONTAINER>

</PAGE>

The XML nodes and XML elements up to the value are separated by slashes (/). The value of the value attribute is queried with @value:

/PAGE/VARIABLE_CONTAINER/HAS_INPUT_VARIABLES/@value

Some XML nodes contain repeated XML elements. These XML elements below the XML node have to be addressed using the index or an attribute. The index is specified using [<index>] (like [1]), and <index> needs to be replaced with an integer. The first XML element has the index 1. An attribute is specified using [@<attribute>='<value>'] (for example, [@name='0D_PRODUCT']).

Examples of XML nodes and their corresponding XML elements:

  • CHARACTERISTICS contain CHARACTERISTIC (addressing using index or attribute)
  • VARIABLES contain VARIABLE (addressing using index or attribute)
  • SELECTIONS contain SELECTION (SELECTION does not have an attribute; addressing has to be done using the index)

Complex Example with XML Nodes and Corresponding XML Elements

The path for value "Candy tin" needs to be determined:

XML node CHARACTERISTIC can contain multiple XML elements (in this example, only one characteristic exists). CHARACTERISTIC can be addressed using index [1] or using the attribute name [@name='0D_PH2']. SELECTION contains multiple XML elements. However, it is not a unique attribute that can be used for addressing. It is therefore necessary to use an index.

<BICS_VIEW>

...

<SELECTION_STATE>

<SELECTION type="CARTESIAN_PRODUCT">

<CHARACTERISTICS>

<CHARACTERISTIC name="0D_PH2">

<SELECTIONS>

<SELECTION type="SINGLE_MEMBER">

<MEMBER name="PDS03" type="MEMBER" text="A4 Writing Case"/>

</SELECTION>

<SELECTION type="SINGLE_MEMBER">

<MEMBER name="PDS05" type="MEMBER" text="Candy tin"/>

</SELECTION>

</SELECTIONS>

</CHARACTERISTIC>

</CHARACTERISTICS>

</SELECTION>

</SELECTION_STATE>

Paths for value "Candy tin" (using index and attribute for CHARACTERISTIC)

BICS_VIEW/SELECTION_STATE/SELECTION/CHARACTERISTICS/CHARACTERISTIC[1]/SELECTIONS/SELECTION[2]/MEMBER/@name

BICS_VIEW/SELECTION_STATE/SELECTION/CHARACTERISTICS/CHARACTERISTIC[@name='0D_PH2']/SELECTIONS/SELECTION[2]/MEMBER/@name

Result

You have determined a path for a parameter value so that you can use this path in the Web template.

More information:

Using Paths

Example

Example with the navigational state and result set of a data provider

The following examples show the paths to the name and description of the query for data provider DP_1.

XML (displayed with path="DATA_PROVIDER:DP_1?/BICS_VIEW" and &debug=x)

Path XML<?xml version="1.0" encoding="UTF-8"?><BICS_VIEW>

<SERVICE_DESCRIPTION>

<SYSTEM_ALIAS>BR9CLNT000</SYSTEM_ALIAS>

<QUERY>0D_DX_Q01</QUERY>

</SERVICE_DESCRIPTION>

<INFO_PROVIDER name="0D_DX_C01" text="Demo Scenario DalSegno Company Sales Data"/>

<QUERY name="0D_DX_Q01" text="DalSegno Sales Data">

...

/QUERY>

<VARIABLES>

...

</BICS_VIEW>

Path to name of query (value "OD_DX_Q01")

DATA_PROVIDER:DP_1?/BICS_VIEW/QUERY/@name

Path to description of query (value "DalSegno Sales Data")

DATA_PROVIDER:DP_1?/BICS_VIEW/QUERY/@text

Example with the current state of a Web item

The example returns the value of the Active (ENABLED) parameter of the first button of the button group Web item with the name BUTTON_GROUP_1.

XML (displayed with path="ITEM:BUTTON_GROUP_1?/ITEM" and &debug=x)

Path XML<?xml version="1.0" encoding="UTF-8"?><ITEM>

<INIT_PARAMETERS>

<BUTTON_LIST value="">

<BUTTON value="" index="1">

<ENABLED value="true"/>

...

</BUTTON>

</BUTTON_LIST>

...

</INIT_PARAMETERS>

</ITEM>

Path (value "true")

ITEM:BUTTON_GROUP_1?/ITEM/INIT_PARAMETERS/BUTTON_LIST/BUTTON[1]/ENABLED/@value

Example with the current state of a variable

The example returns the value of variable 0P_MAT in data provider DP_1 (single value variable; therefore with index [1]).

XML (displayed with path="VARIABLE_CONTAINER?/VARIABLES" and &debug=x)

Path XML<?xml version="1.0" encoding="UTF-8"?><VARIABLES>

<VARIABLE name="0P_MAT" type="INFO_OBJECT_MEMBER" text="Material (Single value, mandatory)">

<SELECTIONS>

<SELECTION type="SINGLE_MEMBER">

<MEMBER name="000000000000000002" type="MEMBER" text="2"/>

</SELECTION>

</SELECTIONS>

</VARIABLE>

</VARIABLES>

Path (value "000000000000000002")

DATA_PROVIDER:DP_1?/BICS_VIEW/VARIABLES/VARIABLE[@name='0P_MAT']/SELECTIONS/SELECTION[1]/MEMBER/@name

Example with current state of the page in a web application

In this example, a pushbutton should only be activated if the Web application has input-ready variables.

XML (displayed with path="PAGE?/PAGE" and &debug=x)

Path XML

<?xml version="1.0" encoding="UTF-8"?><PAGE>

<PERSONALIZATION>

<IS_PERSONALIZED value="false"/>

<USE_PERSONALIZATION value="false"/>

</PERSONALIZATION>

<STATE>

<HAS_PERVIOUS_STATE value="false"/>

</STATE>

<VARIABLE_CONTAINER>

<HAS_INPUT_VARIABLES value="true"/>

</VARIABLE_CONTAINER></PAGE>

Path (value "true")

PAGE?/PAGE/VARIABLE_CONTAINER/HAS_INPUT_VARIABLES/@value

Web item with path referencing

<bi:param name="BUTTON" index="1">

...

<bi:param name="ENABLED" path="PAGE?/PAGE/VARIABLE_CONTAINER/HAS_INPUT_VARIABLES/@value">

</bi:param>

...

</bi:param>

Example with the first characteristic in the rows in a data provider

The example below shows the path to the technical name of the first characteristic in the rows in data provider DP_1. Function text() is used to display the technical name.

XML (displayed with path="DATA_PROVIDER:DP_1?/BICS_VIEW" and &debug=x)

Path XML

<?xml version="1.0" encoding="UTF-8"?>

<BICS_VIEW>

...

<AXES>

<AXIS name="ROWS">

...

<CHARACTERISTICS>

<CHARACTERISTIC>0D_PH2</CHARACTERISTIC>

...

</CHARACTERISTICS>

<CUSTOM_PARAMETERS />

</AXIS>

...

</BICS_VIEW>

Path to the technical name of the characteristic (value "OD_PH2")

DATA_PROVIDER:DP_1?/BICS_VIEW/AXES/AXIS[@name="ROWS"]/CHARACTERISTICS/CHARACTERISTIC[1]/text()