# MTPipeline

General purpose pipeline methods used to retrieve sessions and change and retrieve settings.

Note: To retrieve the XML message of a failed session, use the XMLMessage property on the MTSessionError object.

## Program ID

MetraPipeline.MTPipeline.1

## MTPipeline Methods

AddPortMapping | Adds an additional mapping between port number and instance name in the registry. Used for multi-instance mode.
ExamineSession | Parses a session from its XML representation.
ExportSession | Generates an autosdk format file from any session object. This method can be used to edit and resubmit failed sessions.
GetLostMessage | Returns the original MSIX message from the routing queue journal for a session, given the session ID.
GetLostSessions | Returns the list of sessions that would be logged as "lost" by the auditor.
Login | Method to provide security credentials for some operations.
MultiInstanceSetup | Starts using the instance name associated with the given port number. This changes the value returned from the ConfigurationDirectory property.
SubmitMessage | Submits a specified XML message to the message queue.

## MTPipeline Properties

ConfigurationDirectory | Returns the fully qualified configuration directory. This property takes into account multi-instance configurations. This is a read-only property.
IsMultiInstance | Returns true if the running system is setup as a multi-instance configuration. This is a read-only property.
SessionServer | Returns an initialized session server object. This is a read-only property.

## Example

Example to be provided in a future release of this online help system.

# Method Detail

## MultiInstanceSetup

Starts using the instance name associated with the given port number. This changes the value returned from the ConfigurationDirectory property.

### Visual Basic Syntax

Sub MultiInstanceSetup(port As Long)

### C++ Syntax

HRESULT MultiInstanceSetup(/*[in]*/ int port);

### Arguments

port

TCP/IP port number being used. An associated instance name must be found in the registry.

## GetLostMessage

Returns the original MSIX message from routing queue journal for a session, given the session ID.

### Visual Basic Syntax

Function GetLostMessage(sessionID as String) as String

### C++ Syntax

HRESULT GetLostMessage(BSTR sessionID, [out, retval] BSTR * message);

### Arguments

sessionID

base64 encoded session UID. The login name for the session. Must be the ID of the root session if a compound.

### Return Value

full MSIX message.

### Errors Raised

PIPE_ERR_INVALID_SESSION

(If session ID cannot be found.)

## GetLostSessions

Calculates the list of "lost" sessions, returning a collection of UIDs.

### Example

option explicit

Dim pipelineObj
Set pipelineObj = CreateObject("MetraPipeline.MTPipeline.1")

Dim sessions
Set sessions = pipelineObj.GetLostSessions()

Dim uid
For Each uid in sessions
wscript.echo uid
Next

### Visual Basic Syntax

Function GetLostSessions as IMTCollection

### C++ Syntax

HRESULT GetLostSessions([out, retval] IMTCollection * * sessions);

### Return Value

Collection of UID strings. These messages are in the routing queue journal but not the audit queue.

## Login

Login method is used to support Authentication/Authorization functionality. This method is currently only needed for the ExportSession method.

### Visual Basic Syntax

Function Login(login As String, login_namespace As String, password As String)

### C++ Syntax

HRESULT Login(BSTR login, BSTR login_namespace, BSTR password);

### Arguments

login

The login name for the session.

login_namespace

The name space corresponding to the login parameter being passed.

password

The password corresponding to the login parameter being passed.

## AddPortMapping

Adds an additional mapping between port number and instance name in the registry. Used for multi-instance mode.

### Visual Basic Syntax

Sub AddPortMapping(port As Long, instance As String)

### C++ Syntax

HRESULT AddPortMapping([in] int port, [in] BSTR instance);

### Arguments

port

TCP/IP port number

instance

unique instance/customer name

## ExportSession

Generates an autosdk format file from any session object. This method can be used to edit and resubmit failed sessions.

### Visual Basic Syntax

Function ExportSession(session As IMTSession) As String

### C++ Syntax

HRESULT ExportSession([in] IMTSession * session, [out, retval] BSTR * buffer);

### Arguments

session

Session object.

### Return Value

Contents of autosdk file

## ExamineSession

Parse a session from its XML representation, and returns the session as a session object.

### Visual Basic Syntax

Function ExamineSession(xml As String) As IMTSession

### C++ Syntax

HRESULT ExamineSession(BSTR xml, [out, retval] IMTSession * * session);

### Arguments

xml

the XML representation of the session.

### Return Value

Full MSIX message

### Errors Raised

PIPE_ERR_INVALID_SESSION

(If session ID cannot be found.)

## SubmitMessage

### Submits a specified XML message to the message queue.

### Visual Basic Syntax

SubmitMessage(message As String, txn As Variant)

### C++ Syntax

HRESULT SubmitMessage(BSTR message, [in, optional] VARIANT txn);

### Arguments

Message

The XML text of the message.

txn

An optional MTTransaction object.

# Property Detail

## SessionServer

Returns an initialized session server object.

This is a read-only property.

### Visual Basic Syntax

Property SessionServer As IMTSessionServer

### C++ Syntax

HRESULT SessionServer([out, retval] IMTSessionServer * * server);

### Return Value

The initialized session server.

## ConfigurationDirectory

Returns the fully qualified configuration directory. This property takes into account multi-instance configurations.

This is a read-only property.

### Visual Basic Syntax

Property ConfigurationDirectory As String

### C++ Syntax

HRESULT ConfigurationDirectory([out, retval] BSTR * dir);

### Return Value

Fully qualified configuration directory.

## IsMultiInstance

Returns true if the running system is set up as a multi-instance configuration.

This is a read-only property.

### Visual Basic Syntax

Property IsMultiInstance As Boolean

### C++ Syntax

HRESULT IsMultiInstance([out, retval] VARIANT_BOOL * multi);

### Return Value

True if the machine is in multi-instance mode.