How Sessions for Business Processes Are Established

Before you transfer files or initiate processes between Sterling Connect:Direct® servers and the Sterling Connect:Direct Server Adapter, you configure those components in Sterling B2B Integrator so that it knows who it will be communicating with. One of the required parameters you define for both Sterling Connect:Direct nodes and the Connect:Direct Server Adapter is the maximum number of locally initiated sessions the Connect:Direct Server Adapter may have active at any point in time. This parameter, Max locally initiated (pnode) sessions allowed, determines the maximum number of sessions available for establishing and re-establishing sessions, and plays a key role when business processes are suspended and resumed. If this value is also specified at the remote node-level, the effective session limit is the smaller of two values: the limit for the adapter and the session limit for the remote node.

When a Connect:Direct Server Adapter initiates a data transfer between itself and a remote Sterling Connect:Direct node, it does so as part of a Sterling B2B Integrator business process. If the business process invokes a Connect:Direct Server Adapter service to establish a session and the local PNODE session limit has been met, the business process is suspended and placed in a queue of business processes waiting for an available session. When a session has become available, it is assigned to a previously suspended business process, if any, on a first-come first-served basis.

The first (oldest) suspended business process is given the first chance to use the next free PNODE session for the Connect:Direct Server Adapter. If no suspended business process can use the session or if no business processes are in the suspended business process queue, the freed session is returned to the available session count. If a PNODE session limit was also specified at the node level, the number of currently active sessions with the particular remote node and the total number of active PNODE sessions are both decremented when a freed session goes back to the available session count.

If Sterling B2B Integrator or a Connect:Direct Server Adapter is terminated while business processes are suspending awaiting the next freed session, then an error is returned to the service invocation that caused the business process to be suspended.

If you suspect an error has occurred or that the execution of a business process has been delayed, you can check its status and the status of all related services. If a business process has been suspended, the message, Session count exhausted, waiting for session availability, is displayed for the Connect:Direct Server Begin Session Service, CopyTo, or CopyFrom service involved in establishing or re-establishing a session. When a session count becomes available, the message, Session now available: resuming, is displayed, and the Status Report screen will show how long the business process was suspended, for example, Session now available, resuming after wait of 1 minutes 35 seconds.

Sample Scenario of Workflow Suspension Processing and Session Counts

In this sample scenario, there are three entities, all of which are configured as shown below in Example 1:

  • The Connect:Direct Server Adapter, which is invoked by business process X (BP-X) to establish sessions with NODEA or NODEB.
  • NODEA is a remote Sterling Connect:Direct node that Sterling B2B Integrator wants to communicate with
  • NODEB is a remote Sterling Connect:Direct node that Sterling B2B Integrator wants to communicate with

Example 1

Connect:Direct Server Adapter session limit = 2

Connect:Direct Server Adapter current sessions = 2

NODEA session limit = 2

NODEA current sessions = 1

NODEB session limit = 1

NODEB current sessions = 1

SUSPENDED WORKFLOW QUEUE = <empty>

In this scenario, the following sequence of events occurs:

  1. BP-X attempts to establish a new PNODE session with NODEB.
  2. Since NODEB is already at its session maximum, this triggers the workflow suspend mechanism.
  3. BP-X is placed on the suspended workflow queue to await a session count.
  4. The current session with NODEA terminates and is freed.
  5. Connect:Direct Server Adapter looks for a suspended workflow that can use the newly freed session.
  6. BP-X cannot use the freed NODEA session because NODEB is still at its session maximum.
  7. The freed NODEA session is returned to the available session count, and BP-X continues to wait.

So, after this sequence of events, the situation is:

Connect:Direct Server Adapter session limit = 2

Connect:Direct Server Adapter current sessions = 1

NODEA session limit = 2

NODEA current sessions = 0

NODEB session limit = 1

NODEB current sessions = 1

SUSPENDED WORKFLOW QUEUE = BP-X

A new session can now be established with NODEA, but BP-X must still wait for the current session with NODEB to be freed before it can proceed.

Example 2

In this example, the session limit for NODEB has been bumped up one:

Connect:Direct Server Adapter session limit = 2

Connect:Direct Server Adapter current sessions = 2

NODEA session limit = 2

NODEA current sessions = 1

NODEB session limit = 2

NODEB current sessions = 1

SUSPENDED WORKFLOW QUEUE = <empty>

The following sequence of events occurs:

  1. BP-X attempts to establish a new PNODE session with NODEB.
  2. NODEB is not at its session maximum, but the overall Connect:Direct Server Adapter is at its limit. As a result, the workflow suspend mechanism is triggered.
  3. BP-X is placed on the suspended workflow queue to await a session count.
  4. The current session with NODEA terminates and is freed.
  5. Connect:Direct Server Adapter looks for a suspended workflow that can use the newly freed session.
  6. BP-X can use this session because both NODEB and the adapter now have a session available.
  7. BP-X is resumed and allowed to attempt session establishment with NODEB.

After this sequence of events transpires, the situation stands as this:

Connect:Direct Server Adapter session limit = 2

Connect:Direct Server Adapter current sessions = 2

NODEA session limit = 2

NODEA current sessions = 0

NODEB session limit = 2

NODEB current sessions = 2

SUSPENDED WORKFLOW QUEUE = <empty>