IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > FTP > Configure the module for deployment > Configure the adapter for outbound processing > Passing the connection parameters dynamically during outbound processing

Create a Java component

After creating an interface and testing it, create a Java™ component to set the values for the properties element.

Ensure that you have created an interface that has multiple input properties to pass the connection properties.

You must create a Java component and set the connection-related properties to pass it as input to the interface on the business graph object. To create a Java component, use the following procedure.


Procedure

  1. Create a Java component in the assembly diagram.
  2. Wire the Java component to the FTPOutboundInterface import. The Java component interface, that is, FTPDynamicConnectionInterface is created. To create the Java component, click the Java component. Click the 'add an interface' icon and select the interface, FTPDynamicConnectionInterface.
  3. Set the connection-related properties, which are sent as input to the interface on the BusinessGraph object, for the implementation of the Java component.

    The following sample code is the Java EE component implementation that sets the connection parameters on the properties business object of the BusinessGraph:

    public DataObject createFTPFile(DataObject createFTPFileWrapperBG,String userName, 			String password, String privateKeyFilePath, 			String passphrase) {
    
    	DataObject prop = createFTPFileWrapperBG.getDataObject("properties");
    
    	// check if they already created this child object or not 	if(prop == null) {
    		// Create the "properties" business object 		prop = createFTPFileWrapperBG.createDataObject("properties");
    	} 
    	// Setting the property 'userName' to connectionSpec
    	// If  that the username property is prefixed by CS
    	prop.setString("CSuserName", userName);  
    
    	// Setting the property 'password' to connectionSpec
    	// If  that the password property is prefixed by CS
    	prop.setString("CSpassword", password);
    
    	//Setting the property ‘privateKeyFilePath' which is used for SFTP protocol to connection spec
    	prop.setString("CSprivateKeyFilePath", privateKeyFilePath);
    
    	//Setting the property ‘passphrase' which is used for SFTP protocol to connection spec
    	prop.setString("CSpassphrase", passphrase);
    
    
    	// invoke the Adapter
    	Service serv= locateService_SFTPImportPartner();
    	Object boReturn= serv.invoke(
    			"create", 			createFTPFileWrapperBG);
    
    	// return the result BO that we got back from the FTP Adapter
    	return ((DataObject)boReturn).get(0);
    
      }   

    During run time, the connection properties values are set on the input parameters of the Java component. This in turn is set on the dataobject 'properties' of the BusinessGraph by the above displayed code. The EIS binding then passes the connection properties to the adapter which is set on the dataobject 'properties' by populating it in the ConnectionSpec bean. The adapter uses the ConnectionSpec properties to get a connection to the EIS.

    For more information about EIS binding, see http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp?topic=/com.ibm.websphere.wesb.doc/doc/cadm_dynamicheader.html. For information about how to configure dynamic authentication, see http://www.ibm.com/developerworks/websphere/library/techarticles/0608_martinez/0608_martinez.html.


Results

A Java component is created.


What to do next

Deploy the application onto the IBM BPM and send an outbound request, which includes the connection parameters using the IBM Integration Designer test client. As a result, the adapter uses these connection parameters from the request to create the connection. Any value specified in the Managed Connection Factory properties is ignored by the adapter.

Passing the connection parameters dynamically


Related concepts:

Authentication using connection specification properties