Connect:Direct process definitions file format

The ConnectDirectProcessDefinitions.xml file in the Connect:Direct® bridge agent configuration directory specifies the user-defined Connect:Direct process to start as part of the file transfer.

The ConnectDirectProcessDefinitions.xml file must conform to the ConnectDirectProcessDefinitions.xsd schema. The ConnectDirectProcessDefinitions.xsd schema document is located in the MQ_INSTALLATION_PATH/mqft/samples/schema directory of the MFT installation. A template ConnectDirectProcessDefinitions.xml file is created by the fteCreateCDAgent command in the agent configuration directory.

The file ConnectDirectProcessDefinitions.xml is periodically reloaded by the agent and any valid changes to the file will affect the behavior of the agent. The default reload interval is 30 seconds. This interval can be changed by specifying the agent property xmlConfigReloadInterval in the agent.properties file.


Schema

The following schema describes which elements are valid in the ConnectDirectProcessDefinitions.xml file.

<schema targetNamespace="http://wmqfte.ibm.com/ConnectDirectProcessDefinitions" 
        elementFormDefault="qualified" 	
        xmlns="http://www.w3.org/2001/XMLSchema" 
        xmlns:tns="http://wmqfte.ibm.com/ConnectDirectProcessDefinitions">  	

    <element name="cdprocess" type="tns:cdprocessType"></element>  	

    <complexType name="cdprocessType"> 		
        <sequence> 			
            <element name="processSet" type="tns:processSetType" 
                     minOccurs="0"     maxOccurs="unbounded"></element> 		
        </sequence> 	
    </complexType>   	

    <complexType name="processSetType"> 		
        <sequence> 			
            <element name="condition" type="tns:conditionType" 
                     minOccurs="0"    maxOccurs="1" /> 			
            <element name="process"   type="tns:processType" 
                     minOccurs="1"    maxOccurs="1" /> 		
        </sequence> 	
    </complexType>  	 	

    <complexType name="conditionType"> 		
        <choice minOccurs="0" maxOccurs="unbounded"> 			
            <element name="match" type="tns:matchType" /> 			
            <element name="defined" type="tns:definedType" /> 		
        </choice> 	
    </complexType>  	 	

    <complexType name="matchType"> 		
        <attribute name="variable" type="string" use="required" /> 		
        <attribute name="value" type="string" use="required" /> 		
        <attribute name="pattern" type="tns:patternType" use="optional" /> 	
    </complexType>  		

    <complexType name="definedType"> 		
        <attribute name="variable" type="string" use="required" /> 	
    </complexType>  		

    <complexType name="processType"> 		
        <sequence> 			
            <element name="preTransfer"         type="tns:transferType" 
                     minOccurs="0"              maxOccurs="1" /> 			
            <element name="transfer"            type="tns:transferType" 
                     minOccurs="0"              maxOccurs="1" /> 			
            <element name="postTransferSuccess" type="tns:transferType" 
                     minOccurs="0"              maxOccurs="1" /> 			
            <element name="postTransferFailure" type="tns:transferType" 
                     minOccurs="0"              maxOccurs="1" /> 		
        </sequence> 	
    </complexType>  	 	

    <complexType name="transferType"> 		
        <attribute name="process" type="string" use="required" /> 	
    </complexType>  	

    <simpleType name="patternType"> 		
        <restriction base="string"> 			
            <enumeration value="regex" /> 		
            <enumeration value="wildcard" /> 		
        </restriction> 
    </simpleType> 

</schema>


Understanding the ConnectDirectProcessDefinitions.xml file

The elements and attributes used in the ConnectDirectProcessDefinitions.xml file are described in the following list.

    cdProcess
    The root element of the XML document.
    processSet
    Group element containing all the information about a set of user-defined processes.
    condition
    Group element containing the conditions that a transfer is tested against to determine whether the set of processes contained in the processSet element are used.

      match
      A condition that tests whether a the value of a variable matches a given value.
      Attribute Description
      variable Specifies a variable. The value of this variable is compared with the value of the value attribute. The variable is an intrinsic symbol. For more information, see Substitution variables for use with user-defined Connect:Direct processes.
      value Specifies a pattern to match against the value of the variable specified by the variable attribute.
      pattern Specifies the type of pattern that is used for the value of the value attribute. Valid values for the pattern attribute are

      • wildcard - wildcards are used
      • regex - Java regular expressions are used
      This attribute is optional and the default is wildcard.
      defined
      A condition that tests whether a variable has been defined.
      Attribute Description
      variable Specifies a variable. If this variable exists, the match condition is satisfied. The variable is an intrinsic symbol. For more information, see Substitution variables for use with user-defined Connect:Direct processes.

    process
    Group element containing the information about where to locate the Connect:Direct processes to call when a match is found.

      transfer
      The Connect:Direct process to call during a transfer request.
      Attribute Description
      process Optional. Specifies the name of a file that contains a Connect:Direct process to call during a transfer request. The file path is relative to the Connect:Direct bridge agent configuration directory. This attribute is optional, the default is to use a process generated by MFT. For IBM® WebSphere MQ Version 7.5 or later, the value of this property can contain environment variables. For more information, see The use of environment variables in MFT properties


Example

In this example, there are three processSet elements.

The first processSet element specifies that if a transfer request has a %FTESNODE variable with a value that matches the pattern Client* and a %FTESUSER variable with a value of Admin, the Connect:Direct bridge agent submits the Connect:Direct process located in the agent_configuration_directory/AdminClient.cdp as part of the transfer.

The second processSet element specifies that if a transfer request has a %FTESNODE variable with a value that matches the pattern Client*, the Connect:Direct bridge agent submits the Connect:Direct process located in the agent_configuration_directory/Client.cdp as part of the transfer. The Connect:Direct bridge agent reads the processSet elements in the order that they are defined, and if it finds a match, it uses the first match and does not look for another match. For transfer requests that match the conditions of both the first and second processSet, the Connect:Direct bridge agent calls only the processes specified by the first processSet.

The third processSet element has no conditions and matches all transfers. If the transfer request does not match the conditions of the first or second processSet, the Connect:Direct bridge agent submits the Connect:Direct process specified by the third condition. This process is located in the agent_configuration_directory/Default.cdp as part of the transfer.

<?xml version="1.0" encoding="UTF-8"?>
<tns:cdprocess xmlns:tns="http://wmqfte.ibm.com/ConnectDirectProcessDefinitions"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://wmqfte.ibm.com/ConnectDirectProcessDefinitions ConnectDirectProcessDefinitions.xsd">                 
                    	
    <tns:processSet> 		
        <tns:condition> 			
            <tns:match variable="%FTESNODE" value="Client*" pattern="wildcard" /> 			 
            <tns:match variable="%FTESUSER" value="Admin" pattern="wildcard" /> 		
        </tns:condition> 		
        <tns:process> 			
            <tns:transfer process="AdminClient.cdp" /> 		
        </tns:process> 	
    </tns:processSet> 	 	

    <tns:processSet> 		
        <tns:condition> 			
            <tns:match variable="%FTESNODE" value="Client*" pattern="wildcard" /> 		
        </tns:condition> 		
        <tns:process> 			
            <tns:transfer process="Client.cdp" /> 		
        </tns:process> 	
    </tns:processSet> 	 	

    <tns:processSet> 		
        <tns:process> 			
            <tns:transfer process="Default.cdp" /> 		
        </tns:process> 	
    </tns:processSet> 

</tns:cdprocess>