Tutorial & Interface
eiConsole Tutorial Basic
Configuration Using Transaction Attributes
This interface demonstrates how the eiConsole can be used to utilize Transaction Attributes to dynamically set configuration values for modules. Transaction Attribute based Configuration may be used when:
- A file being written needs to use the same filename as a file that was read (Example)
- A file being written needs to use a complex filename based on the data
- An HTTP Post transaction needs to write to different URLs depending on the incoming data
- An e-mail needs to be written to different Targets depending on the incoming data
- A database transport needs to change username and password and/or Target database dep. on data
How to Run This Example
You must run from the listener by configuring the attached environmental properties file; any input file will work. It must be run for the listener to avoid an error, as the transport depends upon transaction attributes created by the Directory Listener.
The incoming transaction will be written to disk, using the incoming filename and extension to determine the filename.
How to Use This Example
Click the links below for the files you will need for this tutorial, then download the INTERFACE to get started. (Once logged into the eiConsole it immediately shows up in your “PIE” inbox for use.)
Note: if you are not logged in to the eiConsole, or have arrived at this page via a browser, you will be prompted to login before the interface downloads into your eiConsole “PIE” inbox. Or if you have not downloaded and installed a FREE eiConsole Trial you will have the opportunity to register after you click the Interface Download link. Once you are logged in the interface will automatically download into your “PIE” inbox. First, you’ll see a screen pop up indicating that a new product is ready for download. Select the Download Now button. Once you’ve downloaded the Interface you can drag it into your current Working Directory and begin.
Next, follow the tutorial and walk through it step-by-step. You may check your work against the provided Route (Sample Data).
Open the Main Route Grid for the Sample Interface
This interface has two functioning pieces; the listener and the transport.
The listener polls a directory set by a configuration value stored in the environment properties file (included with this interface) every five seconds. The sample file intended to be used with this interface is provided alongside this instructional guide; it is Sample2.xml.
The pre-defined polling directory is C:\Test\Directory\In. If it doesn’t exist on your local machine, you can create it, or change the Polling directory for desired one.
Looks a little more interesting here, no? If you did the previous tutorial, you’ll recognize this as our OGNL Expression Constructor, our tool for building OGNL expressions. This configuration is concatenating the file extension with the file name – “Sample2.xml” will be written as “Sample2xml”. This was intentional. You can try to use this expression:
getAttribute('com.pilotfish.FileName') + getAttribute('com.pilotfish.FileExtension')
Any Java function may be used here, as well as string concatenation; this particular output configuration, for example, lacks a period between the file name and file extension. It’s relatively simple to add this; the configuration simply becomes:
getAttribute('com.pilotfish.FileName') + '.' + getAttribute('com.pilotfish.FileExtension')
And the example interface will generate “Sample2.xml”. Or you can get the same result by moving the second getAttribute to the file extension configuration – Target file extension.
The prepopulated transaction attributes are simply those attributes that the eiConsole expects to be available; if you’ve created your own attributes which don’t show up, it’s relatively easy to use them here, simply write “getAttribute(‘[attribute name]’), as seen here.
This concludes this demonstration of using attributes in complex configurations.