How Do I: Call Business Processes?

Business Processes can expose their functionality to clients in several ways, including through WSDL files, Process Controls, Service Broker Controls, and JPD Proxies.

You can only use Process controls and Service Broker controls between WebLogic Workshop components: Web services (JWS), business processes (JPD), or pageflows (JPF).

The Process control allows a Web service, business process, or pageflow to send requests to, and receive callbacks from, a business process. Process control invocations are Java Remote Method Invocation (RMI) calls. The target business process must be hosted on the same WebLogic Server domain as the caller. The Process control is typically used to call a subprocess from a parent business process. Transaction contexts are propagated from the parent processes to the subprocesses over the Process control calls. In other words, the target business process runs in the same transaction as the caller.

The Service Broker control allows a business process or Web service to invoke and receive callbacks from another service using one of several protocols; the most commonly used protocol is SOAP over HTTP. (To learn about the protocols, see Using Dynamic Binding.) The target service must expose a WSDL interface; it can be a business process, Web service, or remote (non-Workshop) Web service. Because the transport used is HTTP or JMS, the transaction contexts are not propagated over the Service Broker control calls. Typically, the Service Broker control calls are to remote services.

To call business processes from non-Workshop clients, use a JPD Proxy. You can use a JPD Proxy to communicate with a business process from any Java code. When you invoke a business process using a JPD Proxy, the calls are Java RMI calls. Transaction contexts are propagated from the client to the business process over the JPD Proxy calls. In other words, if the client has a transaction context, the target business process runs in the same transaction as the client. JPD Proxies are typically used by non-Workshop J2EE clients or standalone Java clients to invoke business processes.

Depending on the nature of the client and where it is with respect to the target business processes, clients call the business processes in different ways. The following sections describe the scenarios:

Workshop Client Invokes a Business Process in a Different Domain

If the client is a Workshop client (a Web service, a business process, or a pageflow) and the target business process is in a different domain than the client, use a Service Broker control. In this case, create a Service Broker control from the target business process and call the business process using that control. To learn how to create and use Service Broker controls, see Service Broker Control.

You can also use a JPD Proxy in this case. To learn how, see How Do I: Use a JPD Proxy to a Call Business Process?

Workshop Client Invokes a Business Process in the Same Workshop Application

If the client is a Workshop client (a Web service, a business process, or a pageflow) and the target business process is in the same WebLogic Workshop application, we recommend that you use a Process control. That is, create a Process control from the target business process and call the business process using that control. To learn how to create and use Process controls, see Process Control.

You can also use a Service Broker control in this case. To learn how, see Service Broker Control.

Workshop Client Invokes a Business Process in a Different Workshop Application, in the Same Domain

To learn how to create and use process and Service Broker controls, see Process Control and Service Broker Control.

A Non-Workshop Java Client (EJB, servlet or JSP) Invokes a Business Process

If the client is a standalone Java program, a non-workshop J2EE client (EJB, servlet, or JSP), use a JPD Proxy to call the target business process. To learn how, see How Do I: Use a JPD Proxy to a Call Business Process?

Because JPD Proxy calls are RMI calls, the client and the target business process must be in the same organization.

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.

Related Topics

Starting Your Business Process

Interacting With Clients

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

Previous Document Next Document