1. Since BPEL process is exposed as web service, generate a web service proxy of your BPEL process from the wsdl.
2. For additional abstraction, create a separate class w/c will call your web proxy.
3. Package all these classes into a single jar file.
4. Connect to your rule repository and load the dictionary you will use.
5. On the Definitions tab, select the java fact and click create.
6. Specify the location of the jar file and click add.
7. Select the class you will use and click import.
![](http://3.bp.blogspot.com/_AORBRQbLC5g/SOl3EutFG7I/AAAAAAAAAAo/NFmUIf0Ge9g/s320/importclass.jpg)
8. Create RLFunction w/c will invoke the proxy.
![](http://2.bp.blogspot.com/_AORBRQbLC5g/SOl3RP1mUWI/AAAAAAAAAAw/0lOJbx9paEg/s320/RLFUnction.jpg)
Here is the class which will invoke my OrderBooking web service proxy:
package orderbookingwebproxy;
import javax.xml.rpc.ServiceFactory;
import orderbooking.proxy.types.com.globalcompany.ns.sales.ContactType;
import orderbooking.proxy.types.com.globalcompany.ns.sales.OrderInfoType;
import orderbooking.proxy.types.com.globalcompany.ns.sales.OrderItemsType;
import orderbooking.proxy.types.com.globalcompany.ns.sales.SupplierInfoType;
import orderbooking.proxy.types.com.globalcompany.ns.sales.USAddress;
import orderbooking.proxy.types.org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI;
import orderbooking.proxy.types.org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType;
public class InvokeOrderBooking {
private orderbooking.proxy.OrderBooking_PortType _port;
public InvokeOrderBooking() throws Exception {
ServiceFactory factory = ServiceFactory.newInstance();
_port = ((orderbooking.proxy.OrderBooking_Service)
factory.loadService(orderbooking.proxy.OrderBooking_Service.class)).getOrderBookingPort();
}
public void initiate(String custID, String ID, USAddress shipTo, USAddress billTo,
ContactType userContact, OrderItemsType orderItems,
SupplierInfoType supplierInfo, OrderInfoType orderInfo,
EndpointReferenceType replyTo, AttributedURI messageID) throws Exception {
_port.initiate(custID, ID, shipTo, billTo, userContact, orderItems,
supplierInfo, orderInfo, replyTo, messageID);
}
public void invoke(String custID, String ID, USAddress shipTo, USAddress billTo,
ContactType userContact, OrderItemsType orderItems,
SupplierInfoType supplierInfo, OrderInfoType orderInfo,
EndpointReferenceType replyTo, AttributedURI messageID) throws Exception {
initiate(custID, ID, shipTo, billTo, userContact, orderItems,
supplierInfo, orderInfo, replyTo, messageID); // invoke the proxy
}
}