Production instruction meta-objects (PIMOs)

A PIMO is a hierarchical meta-object that supports the transformation of business objects from one format to another. PIMOs specify not only the attribute-to-attribute mapping but also the computation instructions required to perform the transformation. The mapping and the computation instructions constitute meta-data that is used by the mapping engine.

Map_objects.txt contains 20 PIMOs in their entirety. Each PIMO contains all of the meta-data required to transform a business object representing an ISO 7775- or 15022-formatted SWIFT message to a business object representing the corresponding ISO 15022- or 7775-formatted SWIFT message. For more on these PIMOs and how to create or modify them, see "Creating PIMOs".

PIMO structure and syntax

As Figure 17 shows, a simple PIMO has two mandatory child objects, Port and Action, and an optional child object, Declaration.

Figure 17. Simple PIMO


The attribute structure is as follows:

Port This child object always contains an input port and output port.

Declaration This optional child object contains attributes that name local variables.

Action This attribute describes objects that contain compute instructions. The instructions, which reside in the attribute's application-specific information, are used to process Declaration variables and Port objects. Action child objects represent computational sub-tasks listed in the order of execution:

In fact, as shown in Figure 18, the PIMOs that are used to map SWIFT business objects are hierarchical objects that contain many nested levels of PIMOs, each with their own Port, Action, and Declaration objects as well as discrete mapping and computing instructions. At every level, however, the Port, Action and Declaration attributes exhibit the same syntax, structure, and function, which are described in the sections below.

Note:
A simple PIMO can have multiple nested levels of Port, Declaration, and Action objects. A complex PIMO has more than one Port object on the same level. The PIMOs available with this release are simple PIMOs.

Figure 18. Excerpt of expanded PIMO


Port

The Port object type describes the specific transformation the mapping engine undertakes and has the following naming syntax:

PimoName>_Port

In Figure 17, for example, the Port is of type Map_Swift_MT520_to_MT540_Port, which names the transformation of a business object representing an ISO 7775 SWIFT message to an object representing an ISO 15022 SWIFT message.

Port contains as child objects IPort (input port) and OPort (output port). The types of the IPort and OPort attributes describe the parameters to be mapped: an IPort is used to pass an input parameter (for example, Swift_MT_520), and an OPort is used to pass an output parameter (for example Swift_MT_540). The parameters are passed by way of reference to their object types.

The IPort and OPort object may be a primitive type, such as int, float, or String, or a business object, such as Swift_MT520. The computation instructions contained in an Action child object refer to, and act on, these IPort and OPort object types.

Note:
IPort and OPort cannot specify a meta-object as a type.

By convention, the Port and IPort attributes are marked as key (IsKey = true).

Declaration

The Declaration object type describes the objects to be transformed and has the following naming syntax:

PimoName_Declaration

The attributes in Declaration child objects specify local variables for the computing instructions that are detailed in Action objects for the Port. The attribute type declares the type of variable.

Variables can be constant or variable. The keyword final in a Declaration object's AppSpecificInfo designates a constant variable. If a Declaration object's AppSpecificInfo is blank, the variable is not constant. In the PIMO excerpt shown in Figure 19, for example, Qualifier and Letter are declared constant variables; Var Boolean and the Map_Swift_Tag35E_to_70E_Declaration itself are variable.

Figure 19. Declarations in a PIMO


By convention, the first variable in the Declaration object is marked as key (IsKey = true).

Note:
A Declaration object is optional; when Action objects require no local variable, the Declaration attribute can be omitted. The data type of the Declaration child object cannot be a meta-object.

Action

The Action object describes the computing instructions that the mapping engine performs. The top-level Action object has the following naming syntax:

PimoName_Action

The computing instructions specified in Action objects act on the IPort and OPort objects and use the variables specified in Declaration objects. For each Port and Declaration, the Action objects aggregate, in sequential order, all of the computing instructions for the map engine. No space or period is allowed in the Action type names.

Actions can be one of the following types:

Compute action

A Compute type indicates that the Action can be performed by a simple operation. All compute type Actions use the keyword opCode to specify the name of operation. The keyword Target designates the receiving party of the operation. The syntax for a compute type Action is specified in its AppSpecificInfo and is as follows:

opCode=<opCode>;target=<variable>;<parameters

where opCode, variable, and parameters are described in Table 33.

Table 33. Compute action opCodes

opCode Example Description
+ type=compute;opCode=+;target=Var_B;Var_1;Var_2 Addition. Var_2 is added to Var_1 and the sum assigned to the target, Var_B; applies to string and numeric type variables.
- type=compute;opCode=-;target=Var_B;Var_1;Var_2 Subtraction. Var_2 is subtracted from Var1 and the difference is assigned to the target, Var_B. Applies to numeric type variables.
move type=compute;opCode=move;target=OPort;Var_1 Copy the value of Var_1 to the target, OPort. Applies to all variable types.
index type=compute;opCode= index;target=var_4;Var_1;Var_2;Var_3 Looks for first occurrence of string Var_2 in the string Var_1, starting at the position Var_3.

Returns Var_4 to the target, OPort. Var_4 can be -1 if Var_2 is not found. Applies to string variables only.

substring type=compute;opCode= substring;target=result;sourceString;index1;index2 Assign target the result of the sub-string of sourceString from index1 to index2. When index2 exceeds the string length of sourceString, index2 is deemed the same length as that of sourceString.
append type=compute;opCode= append;target=result;source1String;index;source2String Append source2String to source1String at index. The result is assigned to the target, result.
size type=compute;opCode= size;target=OPort;Var; Assign target the length of variable Var when Var is of type String. When Var is of type containment, assign target the number of instances of Var.

Delegate action

Delegate Action is specified when more than one Compute Action is required. A Delegate Action relies on nested PIMOs to complete the Action, and in this sense is analogous to a function call. The syntax of a Delegate Action object is specified in its AppSpecificInfo and is as follows:

type=delegate;<var1>;<var2>

where type indicates the Delegate Action type and var1 is passed to the IPort of a child PIMO, and var2 is passed to the OPort of the child PIMO. The relative position of the variables corresponds to the sequence of Ports in the invoked PIMO. (The invoked PIMO is the PIMO to which Action is delegated.) Looping occurs if one or both of the IPort and OPort objects in the invoked PIMO is of cardinality n.The loop syntax of the delegation is as follows:

For example, in Figure 20, Action6 is of type Delegate. The computing tasks for this action are too complex for specification using Compute Action. In fact, the computing tasks require two levels of Delegate Action. The first Delegate Action is to a nested PIMO, Map_Swift_MT520_A_to_MT540_A_Port. The Action of this Port is also of type Delegate, with its variables passed to the IPort and OPort of Map_Swift_Tag_20_to_20C_Port. The Action of this nested PIMO is of the compute type, and the results are passed back up to the invoking PIMOs, just like a function call.

Figure 20. Delegate action in a PIMO


Native action

Native Action is used to invoke components implemented in Java. In particular, a Native Action object supports calls to the public static method of a Java class, which allows you to develop more complicated processing functions in Java. The syntax of a Native Action object is specified in its AppSpecificInfo and is as follows:

type=nativeStatic;class=<className>;method=<methodName>; 
target=return;var1;var2, varn

where type indicates the Native Action type, className indicates the name of a Java class, methodName indicates the name of the static Java method that provides the functionality for the action, and the return value of the function call is passed to the target variables as follows: var1 is passed to the first variable of the method, and var2 will be passed to the second variable of the method, and so on.

Note:
The order and type of variables in the method call must match the that of the parameters in the method.

Scenario action

A Scenario Action is a construct that makes possible conditional computing and branching in PIMOs.

A Scenario Action is a child object that consists of two to three attributes:

Scenario (Action Object)

The Scenario attribute is always a boolean expression, and the TrueAction or FalseAction (or both) attributes contain conditional computing instructions that are processed after the boolean expression is evaluated.

The syntax of a Scenario Action object is specified in its AppSpecificInfo and is as follows:

type=scenario

The syntax of a Scenario attribute is specified in its AppSpecificInfo and is as follows:

Boolean_Expression

where Boolean_Expression corresponds to one of the entries in Figure 18.

Table 34. Scenario attribute boolean expressions

Boolean symbol Example Description
== IPort==LetterA Equal. When applied to string type variables, equality means that the lexical content of the two strings is the same.
> Var_A>Var_B Greater than. When applied to String type variables, string length is compared.
>= Var_A>=Var_B Greater than or equal to. When applied to String type variables, string length is compared.
&& (IPort==LetterA)&& (IPort==LetterC) And
|| (IPort==LetterA)|| (IPort==LetterC) Or
<
Less than. When applied to String type variables, string length is compared.
<=
Less than or equal to. When applied to String type variables, string length is compared.

Note:
PIMOs support parentheses in the Boolean expression.

A TrueAction attribute indicates the computing instruction that the map engine will process if the Boolean expression (in the Scenario attribute) evaluates to true; likewise, a FalseAction attribute indicates the action if the Boolean expression evaluates to false. Actions specified in the TrueAction and FalseAction can be Compute, Delegate and Native types, and follow the syntax of the Compute, Delegate and Native type Actions, respectively.

For example, Figure 21 shows the attributes of a Scenario Action. If the IPort Object is equal to Code_AVAL, then the computing instruction type=compute;opCode=move;target=OPort;Qualifier_TAV1 will be processed by the map engine.

Figure 21. Scenario action in a PIMO


Object references in actions

Actions make reference to other PIMO objects, whether Port or Declaration objects. By convention, the application-specific information of Action objects follows the path name convention that uses a period to denote the attribute names at different levels in the hierarchy of the PIMO.

For example, consider an IPort of type Swift_Tag_20 (the type shown in parentheses), which has the following hierarchy:

IPort (Swift_Tag_20)

Then the reference to the Swift_20_C attribute is IPort.DataField.Swift_20_C.

Copyright IBM Corp. 1997, 2003