The Join component can be used to join two input XML structures using the Fiorano Mapper into one output XML. This component has two input ports and three output ports. The two input ports, IN_PORT1 and IN_PORT2 are used to input the two XML structures that have to be joined. After the join operation is performed messages are sent on each of the output ports.
Message received on input IN_PORT1 is sent on output port OUT_PORT_IN1.
Message received on input IN_PORT2 is sent on output port OUT_PORT_IN2.
The result of the join operation is sent on OUT_PORT_RESULT.
When the component receives a message on one of the input ports, it checks if there are messages that are received on the other port which are not already used in join operation.
If there are no messages that are received on the other port and are not already used in join operation, the message received is added to an internal queue. There is a separate queue for each input port that holds messages until the join operation is performed.
If there are messages received on the other port which are not already used in the join operation, then the first message is picked from the queue and the join operation is performed.
The Join component can be configured using its Custom Property Sheet as shown in figure 1.

Figure 1: Join configuration Property Sheet
Mappings
The mappings between input and output structures can be defined by clicking on the ellipsis button against this property. Fiorano Mapper gets launched upon clicking the ellipsis as shown in figure 2.

Figure 2: Sample Join configuration
XSLT engine
XSLT engine for the join operation can be specified by this parameter. Join operation is performed using a XSLT. The component can be configured to use a specific XSLT engine to perform XSLT. Xalan (2.7.0) and Saxon (8.4) transformer implementations are bundled with Fiorano environment for performing transformations. By default, the component uses Xalan
Xalan
Xalan implementation (org.apache.xalan.processor.TransformerFactoryImpl) is used to perform transformation.
Note: Xalan (2.7.0) does not support XSLT 2.0
Saxon
Saxon implementation (net.sf.saxon.TransformerFactoryImpl) is used to perform transformation.
Note: Saxon implementation does not support custom functions
Other
This option should be used when a custom transformer implementation has to be used.
Note: Selecting this option enables the property Transformer factory class Name which can be used to provide the transformation factory implementation that should be used.
Transformer factory class Name
XSLT engine for the join operation can be specified by this parameter. Join operation is performed using a XSLT. The component can be configured to use a specific XSLT engine to perform XSLT. Xalan (2.7.0) and Saxon (8.4) transformer implementations are bundled with Fiorano environment for performing transformations. By default, the component uses Xalan
Resources (jar files) containing the java class specified against this property should be added as resources to Join component.
Use context value from
This property determines the input port from which the value of the application context has to be picked. This value is set on the joined message coming out of OUT_PORT_RESULT port. One of IN_PORT1 or IN_PORT2 can be chosen.
Use properties and headers from
This property determines the input port from which the headers / properties have to be picked up and set on the joined message coming out of OUT_PORT_RESULT port. If either IN_PORT1 or IN_PORT2 is chosen, properties are fetched form the chosen port and properties from the other port are discarded. If BOTH is chosen, properties from both the ports are set on the joined message.
Note: When BOTH is selected, the property Prefer Properties and Headers from will be enabled and if both input ports have any properties with same name, the values of such properties are picked based on that property.
Prefer Properties and Headers from
When the property Use properties and headers from is set as BOTH and if there are headers / properties with same name on both IN_PORT1and IN_PORT2 with different values, the port from which the values of such headers / properties have to be picked up and set on the joined message is determined by this property.
Note: This property is enabled when the property Use properties and headers from is set as BOTH.
Join component is configured as shown in Figure2 and the transformation can be tested using the Test XSL button in Fiorano Mapper launched on clicking ellipsis against property Mapping.
Sample schema for input XML message 1
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:element name="shiporder">
<xs:complexType>
<xs:sequence>
<xs:element name="orderperson" type="xs:string"/>
<xs:element name="shipto">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="item" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="note" type="xs:string" minOccurs="0"/>
<xs:element name="quantity" type="xs:positiveInteger"/>
<xs:element name="price" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="orderid" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>

Figure 3: Sample Join input 1 message
Sample schema for input XML message 2
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.fiorano.com/fesb/activity/FileWriter1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.fiorano.com/fesb/activity/FileWriter1">
<xsd:complexType name="Result">
<xsd:sequence>
<xsd:element ref="FileInfo" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="Result" type="Result"/>
<xsd:element name="FileInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="FullName" type="xsd:string"/>
<xsd:element name="FileName" type="xsd:string"/>
<xsd:element name="FilePath" type="xsd:string"/>
<xsd:element name="Type" type="xsd:string"/>
<xsd:element name="ReadAccess" type="xsd:string"/>
<xsd:element name="WriteAccess" type="xsd:string"/>
<xsd:element name="Size" type="xsd:integer"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Figure 4: Sample Join input 2 message

Figure 5: Sample Join output message
Send two different messages for which mapping is configured in the Join component and displaying the response message.
Configure the Join as described in Configuration and Testing section and use feeder and display components to send sample input and check the response.

Figure 6: Demonstrating Scenario 1 with sample input and output
Sample Input
Input 1
<shiporder orderid="orderid">
<orderperson>orderperson</orderperson>
<shipto>
<name>Fiorano</name>
<address>address</address>
<city>city</city>
<country>country</country>
</shipto>
<item>
<title>title</title>
<note>note</note>
<quantity>60</quantity>
<price>-162</price>
</item>
</shiporder>
Input 2
<ns1:FileInfo xmlns:ns1="http://www.fiorano.com/fesb/activity/FileWriter1">
<FullName>Software</FullName>
<FileName>FileName</FileName>
<FilePath>FilePath</FilePath>
<Type>Type</Type>
<ReadAccess>ReadAccess</ReadAccess>
<WriteAccess>WriteAccess</WriteAccess>
<Size>-84</Size>
</ns1:FileInfo>
Sample Output
<?xml version="1.0" encoding="UTF-8"?>
<shiporder xmlns:ns2="http://www.fiorano.com/fesb/activity/FileWriter1" xmlns:ns1="http://www.w3.org/2001/XMLSchema">
<shipto>
<name>Fiorano Software</name>
</shipto>
</shiporder>
It is advised to configure the components connected to IN_PORT1, IN_PORT2 and OUT_PORT_RESULT of the Join component before configuring Join component. This allows join component to pick input and output structures appropriately. Input and output structures can also be provided in the CPS of Join. But, to make sure there are no schema mismatches after configuring all components, it is suggested to configure the components connected to this component before Join is configured
More than three input structures (including Application Context) and one output structure cannot be added.
Only after Join component receives at least one input message on each input port, it will perform the join operation and sends message onto output ports. If ten messages are received on the first input port and five on the second input port or vice versa, then the join is performed five times.