Add Computed Node dialog
The Add Computed Node dialog provides an efficient means of adding customized entries to the mapping rules in the Mapping Definitions section. This feature helps you take advantage of the following benefits:
You do not need to re-enter the custom entries each time you want to map a node.
You can modify the entry dynamically for all mappings rules generated from a node at once, by simply modifying the entry.
To add customized entries to the mapping rules
1. By default, the Type is selected as Computed Node. Depending on the customization you want to add before the mapping, select one of the following from the drop-down list in the Select method field:
String.concat to concatenate the specified string to the end of this string. The
Display name field appears with a default value. Edit the value if you want. Enter the String in the String field that you want to concatenate in the
Method Arguments section.
String.contains to determine whether a specific substring is contained within the string. A Boolean value,
true is returned if the substring is contained within the string;
false otherwise. The
Display name field appears with a default value. Edit the value if you want. Enter the Substring in the Substring field in the
Method Arguments section.
String.endsWith to determine whether the string ends with a specific suffix. A Boolean value,
true is returned if the string ends with the specified suffix;
false otherwise. The
Display name field appears with a default value. Edit the value if you want. Enter the suffix string in the Suffix field in the
Method Arguments section.
String.replaceAll to replace each substring of this string that matches the given regular expression with the given replacement String. The
Display name field appears with a default value. Edit the value if you want. Enter the regular expression and the replacement Strings in the Regex and Replacement fields of the
Method Arguments section.
String.startsWith to determine whether the string starts with a specific prefix. A Boolean value,
true is returned if the string starts with the specified prefix;
false otherwise. The
Display name field appears with a default value. Edit the value if you want. Enter the suffix string in the Suffix field in the
Method Arguments section.
String.subString to obtain a specific substring within a given string. The substring is specified by a beginIndex (inclusive) and an endIndex (exclusive). The
Display name field appears with a default value. Edit the value if you want. Enter the begin index in the Begin index field and end index in the End index field in the
Method Arguments section.
String.toLowerCase to convert all of the characters in this String to lower case. The
Display name field appears with a default value. Edit the value if you want.
String.toUpperCase to convert all of the characters in this String to upper case. The
Display name field appears with a default value. Edit the value if you want.
String.trim to return a copy of the String, with leading and trailing whitespace omitted. The
Display name field appears with a default value. Edit the value if you want.
XPath if your mapping requires an XPath transformation. The
Display name field appears with a default value. Edit the value if you want. In the
Method Arguments section, enter the expression manually or click
Browse and select the name of the file that contains a definition of the XML structure (the drop-down arrow allows you to select the scope of the selection process). Click
OK. The XPath Helper opens, showing the XML structure of the selected file in the left-hand pane. Build the desired XPath expression using the XPath Helper.
XML transformation if your mapping requires an XSLT transformation. The
Display name field appears with a default value. Edit the value if you want. In the
Method Arguments section, enter the expression manually or click
Browse to locate the file of the stylesheet to use. You can also use the drop-down arrow to create a new stylesheet or select from the local file system or workspace.
XMLDecode if your mapping requires parsing information from an XML document, and you want to use Apama's XMLDecode transformation which offers higher performance than XPath transformation. See
XMLDecode for more information on XMLDecode properties. The
Display name field appears with a default value. In the
Method Arguments section:
In the
Node path field, specify a valid node path. For example,
/root/someelement[2]/text().
In the
Properties field, specify the properties as
property=value. If you want to specify multiple properties, specify the properties separated by a semicolon.
Convert To XML if you want to convert an event to XML, or to convert an event field that is an
event type or
sequence type to XML. The
Convert to XML method uses convention-based mapping. See
Using convention-based XML mapping with JMS messages for more information. To use convention-based XML mapping, the event type representing the XML document must be nested inside a parent event type, so ensure that such a parent event type has been created. Typically, the parent event type might have two fields, a
string field representing the JMS destination, and an
event field representing the root of the XML document. The
Display name field appears with a default value.
In the Method Arguments section:
Optionally, type a namespace for the generated XML document in the
Namespace field. For example,
http://www.example.com/myevent.
By default the
Include empty fields option is enabled. This specifies that empty XML nodes will be generated when empty EPL string fields are encountered within an Apama event. This option does not affect empty strings within a sequence of EPL strings. If you clear the check box to disable the option, empty XML nodes will not be generated.
The expression that will be used in the mapping rule is displayed in the Expression value field.
2. Click OK.