-
What are expressions? Why would I need them?
-
Expressions are tiny little scripts written in Rapid Integration Flow Language (RIFL). RIFL is based on Visual Basic. Expressions are used to accomplish things that are very specific to your conversion.
They can be used to filter out unwanted characters or complete records, combine or separate fields, perform mathematical calculations, and many other things. The user interface is designed for simplicity, so there is no way it can represent all of the functions available in the Rapid Integration Flow Language. In general, if you need to do something with your data for which there is no button or screen, use the expression language.
See Writing Expressions in the Help file of Map Designer for more information.
-
Where do I write expressions?
-
The placement of an expression is determined by its intended function.
As a general rule, expressions written to do field level data manipulation should be placed in the Target Field Expression cells on the Map Tab.
Expressions written to determine if a record gets converted or ignored should be placed in the Source or Target Filters.
Expressions written to do record level data manipulation, but do not specifically filter the records (such as Reject expressions) should be written in the first Target Field Expression cell. Or in Execute action before the Map action.
Expressions written to initialize global variables are executed only at the very beginning of a transformation.
Expressions written to be executed only once at the very end of a conversion should be placed in the Before Transformation event actions of the Transformation Properties dialog box. See Writing Expressions in the Help file of Map Designer for more information.
-
I need to write an expression to filter certain characters out of a field. For example, commas, dollar signs, letters, etc. Where do I put the expression? And which one should I use?
-
Expressions written to alter or otherwise affect fields should be placed in the Target Field Expression cells on the Map Tab. Place the expression in the Target Field Expression cell next to the name of the Target Field it will affect.
Some good functions for filtering out unwanted characters include StrReplace, GSub, and Sub.
Here are some examples:
GSub("[^0-9n]","", [SourceFieldName])
This will remove every character that is not a digit.
StrReplace("#","Number", [SourceFieldName])
This will replace all instances of the # symbol with the word "Number".
Sub("Doctor", "Dr", [SourceFieldName])
This will replace the first instance of the word "Doctor with the abbreviation "Dr".
See the Help file in Map Designer for more information and examples of these functions.
See also Writing Expressions in the Help file of Map Designer for more information.
-
Can ADO be written in RIFL?
-
Yes. Map Designer now implements the IDispatch interface that gives it automation capabilities. That means that you can write client programs in the integration expression language.
Also, with this interface, automation applications can be controlled from outside. Most of the OLE enabled application now exposes a set of classes. Map Designer working as a client can instantiate those objects, and call the methods and properties. To start programming using ActiveX, you should have a basic knowledge of the object model and how its components fit together. To see the object models of different software vendors see the documentation that comes with the product.
Also, with this interface, automation applications can be controlled from outside. Most of the OLE enabled application now exposes a set of classes. Map Designer working as a client can instantiate those objects, and call the methods and properties. To start programming using ActiveX, you should have a basic knowledge of the object model and how its components fit together. To see the object models of different software vendors see the documentation that comes with the product.
In Map Designer, you can only create objects (classes) that are inside Automation DLLs at run time. The CreateObject function creates an object at run time. The class of the object is passed as a String argument to CreateObject.
The following are ADO createable object classes: ADODB.Connection, ADODB.Command, ADODB.Parameter, and ADODB.Recordset.
See the topic OLE Automation/ActiveX in Map Designer Help file in for more information and examples.
-
Can Map Designer run Java Classes?
-
Yes. Rapid Integration Flow Language (RIFL) supports Java class objects from within a Transformation. The Java object can be used to call any method available to the object from within its underlying Java class. You can pass parameters in the method calls and any value returned from the method call can be used within the Transformation. Passing and returning of Java objects is also supported.
For related information, see JavaVM and JavaObject and Java Classes and RIFL Expressions.