Chapter 2. Concepts

The following topics describe iWay Service Manager concepts, including channels, thread management, transaction management, and variables.

 

System (Server-Level) Variables

This section describes some of the global Special Registers (SREGs) in iWay Service Manager (iSM). These SREGs are read-only and cannot be set in a process flow. These SREGs and their values can be viewed in the iSM Administration Console by clicking Server from the top menu and then Register Settings in the left pane, as shown in the following image.

The values of these SREGs can be used in the application logic, but cannot be modified.

Variable Namespaces

Variables can be defined in groups, also known as namespaces. This allows variables with the same name to reside in different groups and carry different information. For example, consider AS2-based processes where multiple processes can change the content-type register carrying the valuable information. As a result, you would want to preserve the original content-type received by the application, and set the resulting content-type into a different variable, but with the same name.

Register names can be preceded with a namespace prefix. The namespace is the first part of the name before the first decimal. For example, register xyz is in the default namespace, while register abc.xyz is in the abc namespace.

The following register namespace service operations are available for the Variables object (from the Select Action drop-down list) when configured in a process flow:

  • copy a group of variables. Duplicates registers from a source namespace to a destination namespace. After a Copy operation is performed, the registers are available in both namespaces.
  • rename a group of variables. Moves registers from one namespace to another namespace.
  • delete a group of variables. Deletes all registers in the namespace.
  • check if a group of variables exists. If any registers exist in the namespace, the process flow is passed to the Success edge. Otherwise it is passed to the Notfound edge.

Some of the available iWay components (for example the REST object, AS2 components, and many others), have an option to specify Request and Response header namespaces. The Request namespace enables an application to specify which namespace variable should be sent as part of the request. The Response namespace enables the component to save the auto-generated variables into a given response namespace, which ensures that the existing variables are not overwritten.

In the following example, the REST object is being configured to send all of the header-type variables within the req_headers namespace as part of the call. All of the response variables will be saved in the resp_headers namespace.

In another example shown below, the AS2 Emit Service has a namespace configured as well. The variables in the as2_req_hdr namespace will be sent as part of the header, the variables in the as2_req_main namespace will be sent as part of the AS2 MIME header, and the response header variables set by the AS2 Emit service will be saved into the as2_resp_hdr namespace.

Accessing the namespace variable is the same as accessing any other variable, which can be done through the _SREG() iFL function. For example:

_SREG(resp_headers.size)

Variable Usage

Variables are defined for various usage, which is determined by the Usage parameter for the variable definition.

  • User. User-defined register available for any purpose.
  • Document. Register available for any purpose, but is attributed to the document being processed.
  • Header. Register available for any purpose, but is special for protocol-based interactions. Header-type registers are emitted along with the document to the supported emit protocols, such as HTTP-based protocols.

Variable (Register) Scope

Variables can be defined at the following supported scopes, which determine the accessibility to the variable:

  • Global (Server). These registers are global to the entire server (iSM), accessible and shared across all components. They require a serialization lock for the register setting operation.
  • Global (Channel). These registers are global only to the channel, and all workers running on this channel. They require a serialization lock for the register setting operation. These registers are used to share information across workers processing messages on the channel (protocol).
  • Message (Worker). These registers are bound to the message/document that is flowing through the system (service bus). These registers are available only for the given worker processing the document from the point of definition, all the way to the completion of the channel (outlet).
  • Local (Flow). These registers are bound to a process flow and any of its sub-flows. These registers are available from the point of definition to the end of the process flow.
  • Local (Thread). These registers are bound to a specific thread in a process flow (execution line). These registers are available only on a specific process flow from the point of definition to the point of completion.

The following are several visual representations of variables within commonly used message and channel scopes.

Message (Worker) Scope

  • Register set in a process flow

  • Register set in a channel inlet

Channel Scope

  • Register set in a process flow

  • Register set in a channel inlet

Setting Registers

Registers can be set at various points within an application by the system (iSM) or by the user. This section describes some of the common areas where users would create registers to be used by various application components.

How to Set Registers Using the Variables Object

You can use the Variables object to set variables directly in a process flow.

From the Select Action drop-down list, you can set a supported variable scope, as shown in the following image.

Variables Object Actions

How to Set Registers Using the Pre-Execution and Post-Execution Facility

You can use the Pre-Execution or Post-Execution facility on actionable process flow objects, as shown in the following image.

You can set a scope of message, flow, or thread for these variables.

Register Sets Associated With a Channel

The scope of these registers is at the channel level. These registers are also available to all sub-channels (workers) of the channel.

Deployment Template

The scope of these registers is at the server (iSM) level. These registers are available to the entire application when configured through a template using the Deployment Template Builders in iIT, as shown in the following image.