EJB2Home

The EJB2Home activity connects to an EJB server for EJB 2.x, performs a JNDI lookup operation to obtain a reference to a home object, and obtains a reference to a remote object from the home object. You can use this activity to invoke any method defined by the home object.

You can also use this activity to invoke a method on the EJB home. After this activity is performed, you can use the EJB2Remote activity to invoke methods on the remote object without performing additional remote lookups.

It is optional to cache the home object and the stateless remote objects to reuse them across process instances. However, this improves the performance because further remote lookups are not necessary.

General

In the General tab, you can establish a connection to an EJB server, and specify the JNDI server for the EJB.

Field Module Property? Description
Name No The name to be displayed as the label for the activity in the process.
EJB Connection Yes An EJB Configuration shared resource defines a set of relationships and their participating entities.

Click to select an EJB Configuration shared resource.

If no matching EJB Configuration shared resource is found, click Create Shared Resource to create one. For more details, see Creating an EJB Connection Shared Resource.

JNDI Name Yes The name registered with the JNDI server for the EJB.
Home Interface Class No The name of the home interface for the EJB. The home interface extends javax.ejb.EJBHome.

Click to display the available classes for enterprise beans.

Home Interface Method No The method of the home interface to call. The list provides the methods contained in the selected interface class in the Home Interface Class field.

Description

In the Description tab, you can enter a short description for the EJB2Home activity.

Advanced

In the Advanced tab, you can specify the objects that whether you want to cache:

Field Module Property? Description
Cache Home Object No
Specifies whether the home object is to be cached for use by process instances.
  • If this check box is cleared, each process instance performs a JNDI lookup to obtain the home object reference.
  • If this check box is selected, process instances reuse the cached home object reference.

Choose to cache the home or remote object improves performance over time. However, the home or remote object might become stale. That is, the object changes on the EJB server, and the cached object no longer matches the object on the server.

If the EJB2Home activity encounters a stale home object in the cache, the activity attempts to re-create the home object. The Connection Retries field of the EJB Configuration shared resource specifies the number of retries that the EJB2Home activity performs before failing to re-create the home object. If the EJB2Home activity is successful in re-creating the home object, the activity succeeds and a new home object is placed in the cache. If the activity cannot re-create the home object after the maximum number of retries, the activity fails and takes the error transition.

Cache Stateless Remote Object No
Specifies whether the remote object is to be cached for use by process instances. The remote object is only cached for stateless session enterprise beans.
  • If this check box is cleared, each process instance obtains a new remote object reference.
  • If this check box is selected, process instances reuse the cached remote object reference.

If the process instance encounters a stale cached remote object, the object is removed from the cache, an error is returned, and the activity fails. However, subsequent process instances attempt to re-create the remote object.

Input

The following table lists the input element in the Input tab of the EJB2Home activity:

Input Item Data Type Description
MethodParameters Complex

An object containing the parameters required by the home interface method. This item is displayed only if the method selected in the General tab requires parameters.

Output

In the Output tab, you can find the search results.

The following table lists the output element in the Output tab of the EJB2Home activity:

Output Item Data Type Description
MethodReturnValue Complex

The value returned by the home interface method. This item is displayed only if the home interface method selected in the General tab returns a value.

Fault

In the Fault tab, you can find the error code and error message of the EJB2Home activity. See Error Codes for more detailed explanation of errors.

The following table lists error schema elements in the Fault tab of the EJB2Home activity:

Error Schema Element Data Type Description
errorCode String Displays the error code returned by the plug-in.
errorMessage String Displays the error message returned by the plug-in.
errorStackTrace String Displays the complete stack trace that causes the exception.
exceptionClassName String Displays the class name of the root exception that causes the exception.