Development tools : Transaction editor : Drawing flows in the flow editor : Setting data mappings to states or transitions : Reference : Type data mapping compatibility
  
Type data mapping compatibility
This section describes how to handle the type data mapping compatibility with sample code.
Purposes
In the data mappings, the data types in the mapping source and mapping target should be compatible. If the two types are compatible, the source data value will be mapped into the target data value. If the two types are not compatible, server side will throw exceptions and the mapping will fail.
Parameter
The following tables list the compatibility of the data types. In the leftmost column, the data types represent the mapping source data type, and all other columns represent the mapping target data type.
Y indicates compatible types.
N means the types are not compatible.
In some situations, the compatibility depends on the more details about the data. You can refer to the detailed information according to the guide below the table.
Data Compatibility in server side
 
Mapping source data type
Mapping target data type
 
 
 
 
[context] field
[context] typed Data
[context] kColl
[context] iColl
context -> field
Y
Yes. If the source value can be correctly converted to destination type. See Example 1 in Sample.
N
N
context -> typed Data
Y
Yes If the source value can be correctly converted to destination type. See Example 2 in Sample. Note that, value conversion might lead the loss of precision.
N
N
context -> kColl
N
N
Yes. See Example 3 in Sample.
N
context -> iColl
N
N
N
Yes. See Example 4 in Sample.
String (The string can be constant or the returned value from function or expressions)
Y
Yes If the source value can be correctly converted to destination type. See Sample.
N
N
NLS (The NLS is set from tooling using Constant->NLS or the expressions)
Y
N
N
N
In tooling side, if the types of the chosen source data and target data are not compatible, the "Bind" button will be disabled. If the types are compatible, the "Bind" button will be enabled. Tooling provides a basic but not completely compatibility validation that helps you avoid some errors. For example, mapping from filed to kColl is avoided from tooling.
However, the mapping among the type data is not validated accurately according to the real inner data type. Tooling always allow all the mappings among the type data. For example, mapping from "abc" with type String to a data with type Numer is allowed in tooling, but it will cause exception in server side.
Best practice is set correct mapping according to the compatibility in server side.
Go up to
Reference