Obtaining Configuration Properties Using Special Registers

Topics:

How to:

Special registers are named tokens that contain information available to services. You can use special registers in:

Special registers are accessed by their token name, _sreg(sregname).

Some special registers are completed automatically by iWay Service Manager (iSM) during operation. For example, the correlation ID of a message from a queue (for example, JMS, MQ, or SONIC) can be obtained by _sreg(correlid). An emitter with the property correlid= that is used to set the correlation ID might be set to _sreg(msgid) so that the reply is correlated with the incoming message.

You can define other special registers to the iSM configuration by using the defined special register facility. You can also use a defined special register elsewhere in the configuration and as a value substitution in a document. This feature enables you to define a value, such as a queue manager name, in one place and reference it in another. A system with a dozen MQSeries listeners would then need to change the queue manager name only in one place.

In addition, you can use a special register in the LDAP function as a value for the filter, enabling a search on a complex name without having to spell it out in several places.

Procedure: How to Display System-Wide Special Registers

To display system-wide special register names and values:

  1. In the top pane, click Server.
  2. From the Settings list in the left pane, click Register Settings.

    The Register Settings pane opens.

    The name, value, and data type for the special registers in use are displayed.

Procedure: How to Display Special Registers (Register Sets) for a Channel

To display special registers (register sets) for a channel:

  1. In the top pane, click Registry.
  2. From the Variables list in the left pane, click Registers.

    The Registers pane opens.

    The special register sets used by various conduits are displayed in this pane. In this example, the special register set for a channel called javadoc is shown.

    You can use the Registers pane to define groups of registers that can be assigned to channels and process flows (in iIT Designer). These registers may be used to configure components of a channel and process flow, or used by these components at run time in the case when components refer to registers.

  3. In the Registers pane, click javadoc.

    The Register set pane for the javadoc channel opens.

    This table lists the names, types, values, and descriptions of registers that belong to a register set. For example, javadocport is a register that has been defined for the javadoc register set.

    To see where the javadocport register is actually being used, you can look at the inlet of the javadoc channel, which is an HTTP listener.

    To use the register set for a channel, the SREG definition must fully qualify the register set, for example, _sreg(javadoc.javadocport). Notice the period that separates the register set from the actual register name defined within the register set.

    The following image shows the Listeners pane for the javadoc listener.

    Notice the Port field, which contains the following value:

    _sreg(javadoc.javadocport)

Procedure: How to Use a Special Register

This procedure uses a special register to configure an emitter. For example, to send reply mail to the sender, you can configure an email emitter as follows:

Destination=_sreg(from)

To use a special register:

  1. In the top pane, click Registry.
  2. From the Components list in the left pane, click Emitters.

    The Emitters pane opens.

  3. Click Add.

    The Select emitter type pane opens.

  4. From the Type drop-down list, select EMAIL and click Next.

    Configuration parameters for the email emitter are displayed.

  5. In the Destination field, type _sreg(from).
  6. In the Outgoing Mail Host field, specify an email host.
  7. Enter appropriate values for the remaining parameters that are applicable to your environment, for example, an email user name and password, and click Next.

    The following pane, which contains a Name and Description field for the emitter is displayed.

  8. Type a name and description for the emitter, and click Finish.

    Once executed, this emitter will send an email message to the recipient using the address defined in the special register _sreg(from).

Enriching a Document With the Content of a Special Register

You can enrich a document by referring to a special register that supplies content for the document. For example, you can update the following document with the name of the sender of the email message.

<document>
 <sender></sender>
</document>

To place the name of the sender of the email in the document code:

<document>
<sender>_sreg(from)</sender>
</document>

After execution, the document is enriched as follows:

<document>
<sender>John_Smith@iWaysoftware.com</sender>
</document>

Processing a document using this method requires that the EvalWalk service be configured and chained. For more information, see the iWay Service Manager Component and Functional Language Reference Guide.