uCosminexus Service Platform, Basic Development Guide
To define the mapping in Excel, set up values of the transformation source node or transformation destination node to each object, based on table format XML schema definition file.
This section describes items that you can define in input and output values of a mapping definition and method to set up each item.
Set up path or function name of transformation source node in the Data transformation definition screen, in Input of objects such as CopyObjects(mapping to transformation destination node) or ConcatenateObjects (Concatenate function). Set the path of transformation destination node of Data transformation definition screen in Output of CopyObjects (mapping to transformation destination node). You can specify node conditions, when specifying transformation source node in the input value.
Following table describes nodes and functions that you can define in each item of mapping definition and possibility of setting up conditions to transformation source node.
Table 6-18 TableDefinition items of input and output value (node)
Definition items of input and output value | Node that can be set | Possibility of setting conditions to transformation source node | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Object | Item | Transformation source node | Transformation destination node | |||||||||
Simple contents | Complex contexts | Attributes | any element | anyAttribute attribute | Simple contents | Complex contents | Attribute | any element | anyAttribute attribute | |||
CopyObjects (mapping to transformation destination node) | Input | Y | Y | Y | Y | Y | - | - | - | - | - | Y |
Output | - | - | - | - | - | Y | Y | Y | Y | Y | - | |
Dependency | N | N | N | N | N | - | - | - | - | - | - | |
ConcatenateObjects (Concatenate function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
SubstringObjects (Acquire substring function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
LengthObjects (Acquire string length function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
ContainObjects (Check string function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
TrimObjects (Trim node function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
FormatObjects (Convert number format function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
CalculateObjects (Perform node operation function) | Input1 | Y | N | Y | N | N | - | - | - | - | - | Y |
Input2 | Y | N | Y | N | N | - | - | - | - | - | Y | |
RoundObjects (Round node function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
SumObjects (Sum up nodes function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
NotObjects (NOT operation function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
BitOpObjects (Logical operation function) | Input1 | Y | N | Y | N | N | - | - | - | - | - | Y |
Input2 | Y | N | Y | N | N | - | - | - | - | - | Y | |
ShiftObjects (Shift operation function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
NameObjects (Acquire node name function) | Input | Y | Y | Y | N | N | - | - | - | - | - | Y |
CountObjects (Acquire node count function) | Input | Y | Y | Y | N | N | - | - | - | - | - | Y |
ExistObjects (Check node function) | Input | Y | Y | Y | N | N | - | - | - | - | - | Y |
LoopObjects (Repeat function) | Input | Y | Y | N | N | N | - | - | - | - | - | Y |
RelationalPath | Y | Y | N | N | N | - | - | - | - | - | Y | |
SortKey | Y | Y | Y | N | N | - | - | - | - | - | N | |
ChooseObjects (Select function) | Condition | Y | N | Y | N | N | - | - | - | - | - | - |
OutputValue | Y | N | Y | N | N | - | - | - | - | - | Y | |
ReplaceObjects (Replace value function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
RadixObjects (Radix conversion function) | Input | Y | N | Y | N | N | - | - | - | - | - | Y |
CustomObjects (Set custom function) | Input | Y | Y | Y | Y | Y | - | - | - | - | - | Y |
Setting up conditions to transformation source node | Y | N | Y | N | N | - | - | - | - | - | - |
Table 6-19 TableDefinition items of input and output value (function)
Definition items of input and output value |
Configurable functions | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Object | Item | C o n c a t e a t e |
A c q u i r e s u b s t r i n g |
A c q u i r e s t r i n g l e n g t h |
C h e c k s t r i n g |
T r i m n o d e |
C o n v e r t n u m b e r f o r m a t |
P e r f o r m n o d e o p e r a t i o n |
R o u n d n o d e |
S u m u p n o d e s |
N e g a t i o n o p e r a t i o n |
L o g i c a l o p e r a t i o n |
S h i f t o p e r a t i o n |
A c q u i r e n o d e n a m e |
A c q u i r e n o d e c o u n t |
C h e c k n o d e |
R e p e a t |
S e l e c t |
R e p l a c e v a l u e |
T r a n s f o r m b a s i c n u m b e r |
C u s t o m |
C o n s t a n t |
CopyObjects (mapping to transformation destination node) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
Output | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | |
Dependency | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y | N | N | N | N | N | |
Concatenate Objects (Concatenate function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
Substring Objects (Acquire substring function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
Length Objects (Acquire string length function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
Contain Objects (Check string function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
TrimObjects (Trim node function) | Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
Format Objects (Convert number format function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | N | Y | Y | Y | N | N | Y | Y | Y | Y |
Calculate Objects (Perform node operation function) |
Input1 | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | N | Y | Y | Y | N | N | Y | Y | Y | Y |
Input2 | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | N | Y | Y | Y | N | N | Y | Y | Y | Y | |
Round Objects (Round Node function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | N | Y | Y | Y | N | N | Y | Y | Y | Y |
SumObjects (Sum up Nodes Function) |
Input | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
NotObjects (NOT operation function) |
Input | Y | Y | N | N | Y | N | N | N | N | Y | Y | Y | N | N | N | N | N | Y | Y | Y | Y |
BitOp Objects (Logical operation function) |
Input1 | Y | Y | N | N | Y | N | N | N | N | Y | Y | Y | N | N | N | N | N | Y | Y | Y | Y |
Input2 | Y | Y | N | N | Y | N | N | N | N | Y | Y | Y | N | N | N | N | N | Y | Y | Y | Y | |
ShiftObjects (Shift operation function) |
Input | Y | Y | N | N | Y | N | N | N | N | Y | Y | Y | N | N | N | N | N | Y | Y | Y | Y |
Name Objects (Acquire Node Name function) |
Input | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
Count Objects (Acquire node count function) |
Input | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
ExistObjects (Check node function) |
Input | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
LoopObjects (Repeat function) |
Input | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
Relational Path |
N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | |
SortKey | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | |
Choose Objects (Select Function) |
Condition | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
Output Value |
Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | |
Replace Objects (Replace Value function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
RadixObjects (Transform basic number function) |
Input | Y | Y | Y | N | Y | N | Y | Y | Y | Y | Y | Y | N | Y | N | N | N | Y | Y | Y | Y |
Custom Objects (Custom function) |
Input | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
Setting up conditions to transformation source node | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | Y | Y | Y | Y |
For details on definition items and definition example of each object, see "6.13 Definition details of table format XML schema definition file".
Following table describes BNF mapped to input and output value of each object.
Table 6-20 TableBNF mapped to input and output value of each object
Object/item | Mapped BNF |
---|---|
Copy/Input | Input path or function with conditions |
Concatenate/Input | |
Substring/Input | |
Length/Input | |
Contain/Input | |
Trim/Input | |
Format/Input | |
Calculate/Input1 | |
Calculate/Input2 | |
Round/Input | |
Not/Input | |
BitOp/Input1 | |
BitOp/Input2 | |
Shift/Input | |
Choose/OutputValue | |
Radix/Input | |
Custom/Input | |
Sum/Input | Input path with conditions |
Name/Input | |
Count/Input | |
Exist/Input | |
Loop/Input | |
Loop/RelationalPath | |
Copy/Output | Output path |
Copy/Dependency | Function |
Loop/SortKey | Input path |
Choose/Condition | Conditions# |
Following table describes the syntax rules of these BNF.
Table 6-21 TableSyntax rules of BNF
BNF | Syntax rules of BNF |
---|---|
Input path | ::= [ Variable ] ( '/' Node )+ |
Path with conditions | ::= [ Variable ] ( '/' Step )+ |
Function | ::= '{' NCName '}' |
Output path | ::= [ Variable ] ( '/' Node)+ |
Conditions | ::= Basic method | ( 'not(' Condition ')' ) | '(' Condition ')' |
Variable | ::= '$' NCName |
Steps | ::= Node [ '[' Condition ']' ] |
Node | ::= ( [ '@' ] [ Namespace prefix ':' ] NCName ) | '#any' | '#anyAttribute' |
Namespace prefix | ::= NCName |
Basic format | ::= Input path | Input relative path | Function | Condition expression | Complex condition expression |
Condition expression | ::= ( 'position()' | Input path | Input relative path | Function) Operator ( Value | Function | Input path | Input relative path ) |
Input relative path | ::= '.' | Node ( '/' node )* |
Complex conditions expression | ::= or expression |
or expression | ::= and expression [ 'or' and expression ] |
and expression | ::= Condition [ 'and' condition ] |
Operator | ::= '=' | '!=' | '>' | '<' | '>=' | '<=' |
Value# | ::= "'" [^']+ "'" |
When setting up the transformation source node in an object, specify the path of transformation source node in Input, with absolute path. Specification in relative path is not supported. For details on how to set up the node path, see "(7) Setting up the node path".
Also, you can specify the node conditions in transformation source node depending on the definition items. For details on how to specify node conditions, see "(6) Setting up node conditions".
To set up the transformation destination node, specify path of transformation destination node in Output of CopyObjects (mapping to transformation destination node). For details on setting up the node path, see "(7) Setting up the node path".
In function, specify a function name defined in other objects. Specify function name in the part enclosed in curly brackets ({ }).
Following figure shows the definition example.
Figure 6-51 FigureDefinition example (setting up a function)
When you set up transformation source node in the items in which node conditions can be specified, you can specify node conditions in each element of transformation source node.
For the types of transformation source node or function for which you can specify node conditions, see Table6-18 and Table 6-19.
Specify node conditions in the part enclosed in square bracket ([ ]) at the end of each item.
Specify node conditions by either of the following methods:
Table 6-22 Table Methods for specifying node conditions
# | Method of setting node conditions | Outline |
---|---|---|
1 | Node o function that returns boolean value | When you specify the conversion source node or function, returns boolean value depending on their existence. |
2 | Condition expression | Returns boolean value for the conditions specified in the format of "<left edge><operation><right edge>" condition. Specify transformation source node or function in the left edge and right edge. |
3 | Logical total or logical sum of 2 conditions | "<Condition 1><Operation><Condition 2>" Returns boolean value for the conditions specified by combining the conditions in above-mentioned #1 and #2 with and or or. |
Specify path of transformation source node of node conditions setting, by either of absolute path, or relative path from condition setting target node. For details on node path specification, see "(7) Setting up the node path".
However, when you use the grandchild node of condition settings target node, in conditions, it is referred as relative path after importing to data transformation definition screen, regardless of relative path specification.
For details on how to specify function, see "(5) Setting up a function".
When you specify transformation source node or function, boolean value is returned depending on their existence.
Following figure shows the definition example of setting existence of node or function in the condition.
Figure 6-52 FigureDefinition example (node condition settings 1)
Boolean value is returned for the condition expression specified in "<Left edge><Operation><right edge>" format. Following table describes the values that you can specify in left edge, operation and right edge:
Table 6-23 TableValues that you can specify in each item of condition expression
Item of condition expression | Value that you can specify |
---|---|
Left edge | You can specify either of the following.
|
Operation | You can specify either of "=", "!=", ">", "<", ">=", "<=". |
Right edge | You can specify either of the following:
|
Following figure shows the definition example when setting the condition expression:
Figure 6-53 FigureDefinition example (Node condition settings 2)
Boolean value is returned in logical total or logical sum, in which two conditions are combined with and or or operation, in the "<Condition1><Operation><Condition2>" format. Specify either of the following in <Condition>:
If condition has multiple "logical total or logical sum of two conditions", logical total is given priority. However, if you enclose leading and trailing part of "logical product and logical sum of two conditions" in bracket, that logical expression is given priority.
Also, you can deny these conditions. For details, see "(d) Denying conditions".
Following figure shows the definition example when logical product or logical sum of two conditions is set in the condition:
Figure 6-54 FigureDefinition example (node condition settings 3)
You can deny conditions in the format of "not (<condition>)".
Following figure shows the definition example when denying the condition:
Figure 6-55 FigureDefinition example (node condition settings 4)
This section describes method of specifying logical name and namespace in case of specifying the path of the transformation source node or transformation destination node.
Description of the method to specify the relative path of transformation source node in node conditions specification is as follows:
Specify a logical name of transformation source node and transformation destination node, before root element in ""$"+logical name" format.
When there are multiple transformation source nodes of the Data transformation definition screen, you must specify the logical name of transformation source node. If there is not even 1 transformation source node, specifying the logical name is optional.
Specification of the logical name is optional in the transformation destination node.
Following figure shows the definition example:
Figure 6-56 FigureDefinition example (node path settings 1)
In each element name in the path of transformation source node and transformation destination node, you can use namespace prefix defined in namespace. For details on how to define the namespace prefix, see "6.13.1 Namespaces (namespace information)".
Specify namespace prefix in the "Namespace prefix+":"+element name" format.
Following figure shows the definition example:
Figure 6-57 FigureDefinition example (node path settings 2)
When specifying the node conditions, you can specify path of transformation source node in relative path from conditions setting target node. You can specify relative path for the nodes described in the following table. You cannot use any other description method (".." or "//").
Table 6-24 TableMethod of specifying a relative path
Node to be specified in relative path | Specification method |
---|---|
Condition settings target node | Specify period (.).
|
Grandchild node of condition settings target node | Specify path from child node, of the condition settings target node.
|
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.