# @jpd:unexpected-message Annotation

Allows a business process to ignore messages received by a business process for a Control Receive node or a Client Request node (in positions in the business process other than at the Start node) before the process flow encounters the node at which the message is expected.

Syntax

@jpd:unexpected-message

action = "save | discard"

Attributes

action

Specifies the action to be taken for messages that are received by a business process before the process flow encounters the node at which the message is expected. Possible values are save (the default) and discard.

Remarks

Business processes can include Control Receive or Client Request nodes, at which the process flow waits at run time for delivery of a message before continuing. By default, messages that arrive before they are expected—that is, before the business process encounters the Control Receive or Client Request node in the process flow—are buffered and are delivered when the process is ready to receive them (that is, when the Control Receive or Client Request node is encountered). You can design your process such that any such unexpected (early) messages are discarded. This enables the Control Receive and Client Request nodes to ignore messages that arrived and were buffered by the business process, but that are no longer relevant to the process. The jpd:unexpected-message annotation is available for Control Receive nodes and Client Request nodes in positions other than the Start node. This annotation gives you the ability to control this behavior on a node-by-node basis at design time.

To Specify the jpd:unexpected-message Annotation

1. Switch your view of the business process to the Source View.
2. Click on the Control Receive or Client Request node's method header. The Property Editor displays the unexpected-message property. Note that the action attribute is specified as the default value: save.
3. In the Property Editor, change the specification from save to discard. The annotation is written into the JPD source code, immediately preceding the method header:

    /**
    * @jpd:unexpected-message action="discard"
    */

Related Topics

Interacting With Clients

Interacting With Resources Using Controls