Skip to main content

Implementing the OnProcessInput() Method

Implementing the OnProcessInput() Method

Within your custom business service class, your OnProcessInput() method should have the following signature:

Method OnProcessInput(pInput As %CharacterStream,pOutput As %RegisteredObject) As %Status

Or:

Method OnProcessInput(pInput As %BinaryStream,pOutput As %RegisteredObject) As %Status

Where:

The OnProcessInput() method should do some or all of the following:

  1. Examine the input stream (pInput) and decide how to use it.

    This input type depends on the value of the Charset adapter setting:

  2. Create an instance of the request message, which will be the message that your business service sends.

    For information on creating message classes, see Defining Messages.

  3. For the request message, set its properties as appropriate, using values in the input.

  4. Call a suitable method of the business service to send the request to some destination within the production. Specifically, call SendRequestSync(), SendRequestAsync(), or (less common) SendDeferredResponse(). For details, see Sending Request Messages.

    Each of these methods returns a status (specifically, an instance of %StatusOpens in a new tab).

  5. Make sure that you set the output argument (pOutput). Typically you set this equal to the response message that you have received. This step is required.

  6. Return an appropriate status. This step is required.

Invoking Adapter Methods

Within your business service, you might want to invoke the following instance methods of the adapter:

Connect()
Method Connect(pTimeout As %Numeric = 30,
                pInbound As %Boolean = 0) As %Status

Connect to the FTP server and log in, setting the directory and transfer mode.

Disconnect()
Method Disconnect(pInbound As %Boolean = 0) As %Status

Disconnect from the FTP server.

ParseFilename()
Method ParseFilename(pFilenameLine As %String,
                     Output pTimestamp As %String,
                     Output pSize As %String) As %Boolean
TestConnection()
Method TestConnection()

Correct the properties reflecting the connection state, in case the adapter thinks it is connected but has lost the socket.

The following methods are also available. Each method corresponds to an adapter setting that the user can adjust using the Management Portal. Each time the user clicks Apply to accept changes to the value of a Setting, the corresponding SettingSet method executes. These methods provide the opportunity to make adjustments following a change in any setting. For detailed descriptions of each setting, see Reference for Settings.

ArchivePathSet()
Method ArchivePathSet(pInVal As %String) As %Status

ArchivePath is the directory where the adapter should place a copy of each file after processing.

CharsetSet()
Method CharsetSet(cset As %String) As %Status

Charset is the character set of the input file.

ConnectedSet()
Method ConnectedSet(pValue As %Boolean) As %Status

Connected is an internal property that tracks the adapter’s connection to the FTP server.

CredentialsSet()
Method CredentialsSet(pInVal As %String) As %Status

Credentials is a production credentials entry that can authorize a connection to the FTP server. For information on creating production credentials, see Defining Credentials.

FilePathSet()
Method FilePathSet(path As %String) As %Status

FilePath is the directory on the FTP server in which to look for files.

FTPPortSet()
Method FTPPortSet(port As %String) As %Status

FTPPort is the TCP Port on the FTP Server to connect to.

FTPServerSet()
Method FTPServerSet(server As %String) As %Status

FTPServer is the FTP Server to connect to. This can be the IP address or server name, as long as the domain host controller can resolve the name.

SSLConfigSet()
Method SSLConfigSet(sslcfg As %String) As %Status

SSLConfig is the TLS configuration entry to use to authenticate this connection.

FeedbackOpens in a new tab