Translate detail type
The translate detail type translates the message according to the actions in the specified translation file. This is also referred to as xlate.
The translate route detail has these main parts:
- Pre-processors. These are code fragments that act on a message before translation. This is not required.
- Translation. This performs one translation containing translation actions. This is required.
- Post-processors. These are code fragments that act on a message after translation. This is not required.
Each translation is made up of translation actions. Sometimes there are zero translation actions; often there are many more. Each action in the translation can have a pre- or post-processor. The pre- and post-processor calling sequence is different than all other Tcl interfaces in the system: more context is created before the processor is run, so that it can use a Tcl code fragment for the processor. Pre- and post-processor Tcl callouts must be written using the input and output API of the system. The pre- or post-processor affects the translation process by modifying local Tcl variables in the code fragment.
These local variables are supported:
- Translation In Values or
xlateInVals
- Translate In Types or
xlateInTypes
- Translation Out Values or
xlateOutVals
- Translate Out Types or
xlateOutTypes
- Translate In List or
xlateInList
- Translate Out List or
xlateOutList
- Translate Send Message or
xlatesend
The pre- and post-processors have the same interface and power described
in the raw route detail procedures. Each procedure can use the CONTINUE
and SEND
keyed lists to process
messages.
If pre-processor run results in more than one message, then the translation and
the post-processor are called in sequence for each resulting message. Both the xlate and
the post-processors do not track multiple messages unless they track the message’s
source ID (msgSrcMid
) value of messages. Between the pre- and post-processors,
a single message is translated using a .xlt file
extension.
If a pre- or post-processor needs to modify the destination connection
information, then it modifies a Tcl variable named XlateDests
. These are translation
destinations. As with the raw route detail, these modifications are made by direct
manipulation or by calling a programmatic interface.
If a processor needs to generate a message unrelated to the source message’s flow, then it:
- Creates a binary object.
- Updates the new object’s translation
destination that is specified in the
XlateDests
field to point to the appropriate destination. - Modify a Tcl variable named
XlateSend
.
The contents of this variable is a keyed list with a key of SEND
.
After the action’s pre-processor or post-processor code fragments are
complete, the xlate thread checks the values of all the translation, or Xlate,
variables. Messages pointed to by the XlateSend
sending translation variable are moved to the
Protocol Queue. The movement and delivery semantics of these messages are the same as
messages returned by procedures in a raw detail using the SEND
keyed list.
An invocation operation can also be specified for an action. This operation is a Tcl code fragment and has the same calling semantics as the action pre- and post-processors. This functionality gives complete control over the translation action.