Previous Topic

Next Topic

Book Contents

Book Index

Operation Mapping

This guide elaborates on XML representation of the operation mapping. The ability that Device Access mapping mechanism provides is to construct mapping between:

<operation-mappings>

The <operation-mappings> is an optional element. It holds the list with defined mapping between Target Device Item operations and Source Device Item operations or Source Device Item properties. This element has one or many child elements <operation-mapping>. The <operation-mapping> tag has required attribute "targetOperation" that holds the Target Device Item operation. The <operation-mapping> has two child elements: <source-property> and <source-operation>. Only one of this child element can be available.

<source-property>

If the mapping is between Target Device Item operation and Source Device Item property, then the child element <source-property> should be provided and the <source-operation> child element must not be provided. The <source-property> element holds the representation of the Source Device Item property. The <source-property> tag has required attribute "name" that holds the name of the Source Device Item property. The representation of the Source Device Item property value depends on the type of the value. In Mapping XML Value Representation guide there is detailed information about how to represent the different values.

<source-operation>

If the mapping between Target Device Item operation and Source Device Item operation, then:

The <source-operation> element holds the representation of the Source Device Item operation. The <source-operation> tag has required attribute "name" that holds the name of the Source Device Item operation. The <source-operation> has optional child element <params> that describes the operation parameters.

<params>

The <params> element describes the operation parameter. It is optional and has one or many <param> child elements .

<param>

The <param> element is required. It holds the value of the parameter. This value can be simple value or complex object value. On Mapping XML Value Representation page there is detailed information about how to represent the different values. In addition to the attributes – "value", "script" and "ref", the <param> tag has also a "targetArgument" attribute. This attribute is optional too and it holds the Target Device Item parameter that should be passed as parameter on the Source Device Item operation.

For example when the Target Device Item operation "start" is invoked, then the Source Device Item operation "open" should be invoked too.

<operation-mappings>

  <operation-mapping targetOperation="start">

    <source-operation name="open" />

  </operation-mapping>

  <operation-mapping targetOperation="stop">

    <source-operation name="stop" />

  </operation-mapping>

</operation-mappings>

As an addition when the mapping is between Target Device Item operation and Source Device Item operation then the <operation-mapping> tag has two optional attributes –"returnScript" and "returnRef". The value which is returned by the invocation of the Target Device Item operation can be represented by using "returnScript". The "returnScript" attribute holds the script expression that should be executed. Refer to Scripting in XML Mapping page for detailed information.