How Do I: Use a JPD Proxy to a Call Business Process?

You can use a JPD Proxy to call any business process (synchronous and asynchronous, stateful, and stateless) from any Java client, including standalone Java applications, EJBs, JSPs and Servlets. Using a Java proxy for a business process requires different steps depending on whether the client application that uses the proxy is in the same JVM as the target business process.

This topic includes the following sections:

What is a JPD Proxy?

A JPD Proxy is an RMI client to a business process (JPD). An interface that matches a business process' client requests is associated with each business process. This interface is called the JPD public contract. Each method on the JPD public contract has the same signature as the corresponding client request. A JPD Proxy is a JAR that contains the compiled class file for the JPD contract. You can use the class file to access the JPD as though it were a local Java class. JPD Proxy calls are over Java RMI. JPD Proxy calls propagate the transaction context from the clients to the business processes.

You can download the JPD Proxy JAR file from the JPD Proxy link on the WebLogic Workshop Test Browser Overview page (see How Do I: Get a JPD Proxy for a Business Process?).

Warning: Business processes that include client callbacks send those callbacks to the client that started the process. JPD Proxies cannot receive callbacks from business processes. An error will occur in your business process if a client uses a JPD Proxy to start a business process that includes client callbacks; the business process fails at run time when it tries to send the callback to the client (the JPD Proxy) that started it.

The JpdProxy class is a factory class for proxies to a WebLogic Integration business process type. Clients call one of the create() methods on the class to get a proxy instance. The create() methods take the JPD contract class (java.lang.Class) as input.

An example JPD contract interface for a business process named RequestQuote.jpd is shown in the following listing.

Listing : Example JPD Contract Interface

package weblogic.wli.jpdproxy; 
import org.example.request.QuoteRequestDocument; 
public interface RequestQuote {
    public void quoteRequest(org.example.request.QuoteRequestDocument requestXML);
    public static final String SERVICE_URI =
    "/myApplication/requestquote/RequestQuote.jpd";
} 

Note the following characteristics in the preceding example contract interface:

Related Topics

Previous Document Next Document