+

Search Tips   |   Advanced Search

 

Use a work area to manage local work

 

Be sure that your client has a reference to the UserWorkArea interface, as described in the topic Accessing the UserWorkArea partition or a reference to a user defined partition as defined in Accessing a user defined work area partition. The following steps use the UserWorkArea partition as an illustration. However a user defined partition can be used in the exact same way.

 

Overview

In a business application that uses work areas, server objects typically retrieve the work area properties and use them to guide local work.

 

Procedure

  1. Retrieving the name of the active work area This step determines whether the calling thread is associated with a work area.

  2. Overriding work area properties. Server objects can override client work area properties by creating their own, nested work area.

  3. Retrieving properties from a work area

  4. retrieveAllKeys method

  5. Querying the mode of a work area property

  6. Deleting a work area property

  7. Completing a work area

 

Example

The server side of the Example: Using work areas in the SimpleSample application accepts remote invocations from clients. With each remote call, the server also gets a work area from the client if the client has created one. The work area is propagated transparently. None of the remote methods includes the work area on its argument list.

In the example application, the server objects use the work area interface for demonstration purposes only. For example, the SimpleSampleBean intentionally attempts to write directly to an imported work area, which creates the NotOriginator exception. Likewise, the bean intentionally attempts to mask the read only SimpleSampleCompany, which triggers the PropertyReadOnly exception. The SimpleSampleBean also nests a work area and successfully overrides the priority property before invoking the SimpleSampleBackendBean. A true business application would extract the work area properties and use them to guide the local work. The SimpleSampleBean mimics this by writing a message that function is denied when a request emanates from a sales environment.



Retrieving the name of the active work area

Overriding work area properties

Retrieving work area properties

retrieveAllKeys method

Querying the mode of a work area property

Deleting a work area property

 

Related concepts


Nested work areas