# Managing Conversations

Business processes and clients can communicate multiple times to complete a single task. Also, multiple clients can communicate with the same business process at the same time. Conversations provide a straightforward way to keep track of data between calls and to ensure that a service always responds to the right client.

Conversations uniquely identify a communication between a client and a service, so that messages are always returned to the correct client.

Conversations maintain state between calls to a service, that is, they keep track of the data associated with a particular client between calls. Conversations ensure that the data associated with a particular client is saved until it is no longer needed or the operation is complete.

To learn about conversations in business processes, see the following topics:

- How Do I: Specify the Conversation Lifetime?
- How Do I: Manage Conversations When Using a JPD Proxy?

## How Do I: Specify the Conversation Lifetime?

You use the @jws:conversation-lifetime annotation in the JPD file to specify the maximum age and the maximum idle-time for a conversation. The valid specifications for conversation lifetime include:

max-idle-time

Default: Zero (0) seconds. Conversations with max-idle-time of zero never time out due to inactivity. This attribute specifies the amount of time that the conversation can remain idle before it is completed by WebLogic Server. Note that only activity between a business process and its client resets the idle timer; activity between a business process and controls does not reset the idle timer.

max-age

The amount of time (since it started) that a conversation remains active before it is finished by WebLogic Server. Default: 1 day (24 hours).

To prevent WebLogic Server from terminating a conversation, set the max-age to zero days, zero minutes, or zero seconds. Conversations for which the max-age is set to zero days-min-sec are not terminated by WebLogic Server; rather they complete according to their conversation lifecycle.

To Specify the jws:conversation-lifetime Annotation

1. In WebLogic Workshop, switch to the Source View if necessary.
2. Click the JPD file class declaration. The Property Editor displays the conversation-lifetime property, which includes the default settings for max-idle-time and max-age.
3. Click the relevant field in the Property Editor to change the settings for max-idle-time and max-age. The annotation is written into the JPD source code, immediately preceding the class declaration. For example, in a scenario in which the max-age is specified as 5 days, the following annotation is created in the JPD file:

    ::
    * @jws:conversation-lifetime max-age="5 day"
    */:

## How Do I: Manage Conversations When Using a JPD Proxy?

You can use the JpdProxySession interface to set and get the conversation ID used when a business process is invoked using a JPD proxy. To learn how, see About Conversation Management in Calling Business Processes. The JpdProxySession is in the WebLogic Integration Javadoc, which is available at the following URL:

http://e-docs.bea.com/wli/docs81/javadoc/com/bea/wli/bpm/proxy/JpdProxySession.html

Related Topics

Overview Conversations

Designing Conversational Web Services

@jws:conversation-lifetime Annotation

Calling Business Processes