# @jpd:mb-static-subscription Annotation

Specifies the subscription parameters for a business process that is started as the result of receiving a message from a Message Broker channel to which the process is subscribed.

Business processes are started by messages. The first activity in a business process (that is, the first child of the <process> tag) must be either a Client Request node or an Event Choice node. When the client invokes this operation, an instance of the business process is started.

A special case of message-started processes is when the Message Broker starts the process as a result of a subscription to a Message Broker channel. The subscription parameters are defined by annotating the starting clientRequest method to indicate that this process is invoked by the Message Broker when it delivers the message.

See Note About Static and Dynamic Subscriptions.

Syntax

@jpd:mb-static-subscription

channel-name="/prefix/xxxx/Name"
[xquery="xquery"]
[filter-value-match="myvalue"]
[message-metadata="{x1}"] [message-body="{x0}"]

Attributes

channel-name

Required. The name of the Message Broker channel to which the business process subscribes. Channel files (filename.channel) define the Message Broker channels available in a WebLogic Integration application. Channel files must be placed in a Schemas project in your application. To learn how to create Message Broker channels, see How Do I: Create Message Broker Channels?

xquery

Optional. Specifies the xquery to use for filtering. Element variables are named by Filter-body and Filter-header. The element variables are named by the message-body and message-metadata attributes.

filter-value-match

Optional string constant. (Required if xquery is specified.) The value of the filter-value-match attribute is compared against the results of the xquery.

message-metadata

Optional string constant. This attribute maps a named parameter in the xquery to the SOAP headers of an incoming message.

message-body

Optional string constant. This attribute maps a named parameter in the xquery to the XML body of an incoming message.

Note About Static and Dynamic Subscriptions

There are two categories of subscriptions to a Message Broker channel for WebLogic Integration business processes:

- You can create an instance of a Message Broker Subscription control and design the subscription to a Message Broker channel using the control.
- For the special case of a process that is started as a result of a subscription to a Message Broker channel, you design the subscription on the process' Start node. (See How Do I: Subscribe to Message Broker Channels?)

Subscriptions on a Start node in a business process are called static subscriptions because WebLogic Integration is aware of the subscription when the business process (JPD) is deployed. At deployment time, WebLogic Integration updates its in-memory tables with the subscription information. Tables remain updated until the business process is undeployed.

Subscriptions to Message Broker channels that are defined at a Control node, which communicates with a Message Broker Subscription control, are called dynamic subscriptions. This means that WebLogic Integration is not aware of the subscription when the business process (JPD) is deployed (because the subscription is embedded in the JPD code). When the Message Broker Subscription control node is executed at run time, WebLogic Integration update the tables with the subscription information. The dynamic part for dynamic subscriptions refers to:

- The subscription state (subscribed or not)
- The filter value for the filter expression

Related Topics

Message Broker Control Annotations

Subscription Start (Asynchronous)

Subscription Start (Synchronous)

Event Choice Start

How Do I: Create Message Broker Channels?