SFTP Client MKDIR Service

The SFTP Client MKDIR service creates directories on the trading partner's SFTP server when the SFTP protocol is required as the transport mechanism.

The following table provides an overview of the SFTP Client MKDIR service:

Category Description
System name SFTP Client MKDIR Service
Graphical Process Modeler (GPM) category All Services, B2B Protocols > SFTP Client
Description Creates directories on the trading partner's SFTP server.
Business usage Use this service to create directories and put the files into the respective directories on the server side when the SFTP protocol is required as the transport mechanism.
Usage example A Sterling B2B Integrator business process is executed that translates documents that must be sent to a trading partner daily. After the translation, Sterling B2B Integrator uses the SFTP Client MKDIR Service, working through the SFTP Client Adapter, to create the directory with the current date so that the documents are placed in the specified directory on the trading partner system.
Preconfigured? Yes. Uses the preconfigured service in a business process.
Requires third-party files? No
Platform availability All Sterling B2B Integrator supported platforms
Related services The following services are related. Configured in a business process, they initiate the SFTP Client adapter to perform their operations:
  • SFTP Client Begin Session service
  • SFTP Client CD service
  • SFTP Client DELETE service
  • SFTP Client End Session service
  • SFTP Client GET service
  • SFTP Client LIST service
  • SFTP Client MOVE service
  • SFTP Client PUT service
  • SFTP Client PWD service
  • SFTP Client RMDIR service

The SFTP Client MKDIR service must be placed in between an SFTP Begin Session Service and an SFTP End Session Service. It may be used to create directory on server side. The CD service can be used to change to that directory. Documents can then be put or retrieved from the newly created directory using the PUT service and GET service.

Application requirements An SFTP Server at the external trading partner location.
Initiates business processes? No
Invocation This service is invoked from a business process.
Business process context considerations None
Returned status values
Returned status values:
  • 0 –Success
  • 1 – Error
Restrictions N/A
Persistence level System Default
Testing considerations Debug information for this service is located at: Operations > System > Logs > SFTP Client Adapter and Services.

Configuration Parameter

The following fields are the configurable options in either the UI service configuration page or the GPM or both:

Parameter Configure in GPM or UI Description
Name UI Name that the service will have in the system. Required.
Description UI Description of service. Optional.
Select a Group UI
Group of services or adapters of the same type that can act as peers. A Service Group name is used in BPML in place of the Service Configuration name. Service Groups show up in the GPM as if they were Service Configurations. Select a Service Group to associate with this adapter. Valid values are:
  • None - You do not want to include this configuration in a group at this time (default)
  • Create New Group - You can enter a name for a new group in this field, which is then created along with this configuration.
  • Select Group - If you have already created one or more groups for this service type, they are displayed in the list. Select a group from the list.

For more information about service groups see Managing Services and Adapters.

Configuration Parameters Passed from Business Process to Service

The following table contains the parameters passed from the business process to the service:

Parameter Description
RemoteDirName Specifies the directory name that the system uses to create a directory on the remote system. Required.
SessionToken Specifies the identifier for the session established between the SFTP Client adapter and an SFTP server. Required.

Configuration Parameters Passed from the Service to the Business Process

The following table contains the parameters passed from the service to the business process:

Parameter Description
ServerResponse The SFTP server response, which may include a reply code and any text associated with the reply code. Required.
Valid values are:
  • OK - 0
  • No Such File - 2
  • Permission Denied -3
  • General Failure - 4
  • Bad Message - 5
  • No Connection - 6
  • Connection Lost - 7
  • Operation Unsupported - 8

Business Process Examples

This following business process example uses the SFTP Client Adapter create a directory on the remote SFTP server.


<process name="SftpExample">
<sequence>
[[Insert Begin Session ]]
<operation name="SFTP Client MKDIR Service">
  <participant name="SFTPClientMkdir"/>
    <output message="SFTPClientMkdirServiceTypeInputMessage">
      <assign to="." from="*"></assign>
      <assign to="RemoteDirName">SFTPTEST</assign>
    </output>
   <input message="inmsg">
      <assign to="." from="*"></assign>
   </input>
</operation>
[[Insert end session here]]
</sequence>
</process>


This following business process example uses the SFTP Client Adapter to create a directory on the remote SFTP server, change to the directory and put the primary document from Sterling B2B Integrator to the remote SFTP server.


<process name="SftpExample">
<sequence>
[[Insert Begin Session ]]
<operation name="SFTP Client MKDIR Service">
   <participant name="SFTPClientMkdir"/>
   <output message=" MkdirRequest ">
     <assign to="SessionToken" from="/ProcessData/BeginSessionResults/
                 SessionToken/text()">
     </assign>
     <assign to="RemoteDirName">NEWSFTP </assign>
   </output>
  <input message="SFtpMkdirResults ">
     <assign to=”MkdirResults” from=”*”/>
   </input>
</operation>
<operation name="SFTP Client CD Service">
   <participant name="SFTPClientCd"/>
   <output message=" CdRequest ">
     <assign to="SessionToken" from="/ProcessData/BeginSessionResults/
                 SessionToken/text()">
     </assign>
     <assign to="Directory">NEWSFTP</assign>        
    </output>
  <input message="SftpCdResults ">
     <assign to=" CdResults " from="*">
     </assign>
   </input>
</operation>
<operation name="SFTP Client PUT Service">
   <participant name="SFTPClientPut"/>
   <output message=" PutRequest">
   <assign to="SessionToken" from="/ProcessData/BeginSessionResults/
               SessionToken/text()">
   </assign>
   <assign to="RemoteFileName">TestDoc</assign>
  </output>
  <input message="SftpPutResults">
     <assign to="PutResults" from="*"></assign>
     </input>
     <assign to="." from="*">
     </assign>
   </input> 
</operation>
[[Insert End Session]]
</sequence>    
</process>