Showing posts with label mediation primitive. Show all posts
Showing posts with label mediation primitive. Show all posts

Monday, June 11, 2012

WPS : Data Base Lookup Mediation Primitive Functionality



Introduction :  Database Lookuo Mediation primitive allows us to get the values from existing database by using key element and then update the message with values obtained from selected fields.

 

Terminals :  Database lookup primitive have 1 input terminal, 2 output terminals, 1fail terminal.
Input terminal :  which accepts the smo message which contains the key element.
Output Terminals :
Out terminal :  This propagates when the database lookup successful. The updated message is propagated from this terminal.
KeyNotFound: Database record not found with the specified key element, the unchanged message is propagated from this terminal.
Fail Terminal :  Which propegate the original message along with fail information in context

NOTE : Database Lookup primitive does not modify the message body structure, it modifies the message body contents.


Database Lookup mediation primitive properties :



Data Source :  The JNDI name of the datasource.
Table : Need to give fully qualified name. The name of the database table, including the schema name; for example, myschema.mytable.
Search Column : The name of the database's primary key column. The specified Search column must contain a unique value; multi-column database keys are not supported. In addition, the unique value must be of the same element type as the value located in the message using the Search location.
Search Location :  Where, in the input message, to find the database key. Specified as an XPath 1.0 expression; the value returned from the XPath expression is used as the key into the database.
Validate Input :  If you select the check box, the input message is validated before the mediation is performed.
Data Elements :  
 Column : The name of the database column from which to copy information. The valid type is String. 
 Type : The information type: the only supported String types are a simple XML schema type, or an XML schema type that extends a simple XML schema type. At run time, the value obtained from the database is converted to the type defined by the Type property.
Java primitive types or string are supported only for compatibility with old mediation flows.
 Target Location : Where, in the message, to store the information obtained from the database. The valid type is String. Specified as an XPath 1.0 expression describing the location of a message element. The XPath expression must evaluate to a single element in the message.

 Considerations :  Consider the following when using the Database Lookup mediation primitive:
  • You must set up a database, datasource and any server authentication settings for the Database Lookup mediation primitive to use. You can do this using the runtime administrative console.
  • The list of supported databases is provided on the systems requirements Web page for the runtime product.
  • The Database Lookup mediation primitive can read only from one table.
  • You can route a message to the same location whether or not the key is found in the database. To do this you wire both the out terminal and the keyNotFound terminal to the same output location.
  • You can able to get single record by unique key element.





Monday, June 4, 2012

WPS : Mediation Primitive Message Logger

Introduction : We have MessageLogger in Tracing palette. Message Logger writes a copy of the message to a database for future retrieval or audit. You can also create your own custom message log. All or part of the SMO can be written.
Message Logger contains one input, one output and one fail terminal. All message terminal have the same message type.

Properties :
Root : Xpath expression defining portion of SMO to log. Xpath expression can identify any element or portion of the SMO.
default : /body

Transaction mode : It contains two options :: same,new
Same : Commit database update with in the flow transaction  (or) Log the massage to the same file
New : Commit database update immediately using a new transaction. (or) Log the massage to the new file for each message.
default : Same

Logging Type : It contains two options :: Database, Custom
Database : Log the message in the database by using Data source name
Custom : Log the message in fileby using Handler,Formatter,Filter options which are not applicable those are ignorable at runtime.  The file is created in temporary folder : D:\DOCUME~1\user\LOCALS~1\Temp with the file name : MessageLog
default : Database



Data source name : JNDI name of data-source identifying the database. 
default : jdbc/mediation/messageLog

Handler, Formatter, Filter : these options are used for custom logging type. implementation classes are defined by java logging API's. default implementation types are availabe by default. handler is required and formatter and filter is optional.

Literal : {0} to {5} representing following :
{0} Time Stamp : Indicates when the message is logged.
{1} Message ID : Message id from SMO.
{2} Mediation Name : The name of the message logger primitive that logged in the message.
{3} Module Name : The name of the mediation module containing the message logger.
{4} Message : The message specified in the root property
{5} Version : The version of the SMO