Thursday, September 1, 2011

PAPI and Web Service Integration

What is PAPI? PAPI is the API which allows external java code to communicate with the BPM Engine. OBPM also provides PAPI Web service for non-java clients.

PAPI api doc http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/papi_javadocs/index.html?fuego/papi/package-summary.html

To enable PAPI web service

image

image 

This allow external call BPM functions by web services. The PAPI Web Service WSDL could be found here

http://localhost:8585/papiws/PapiWebServiceEndpoint?wsdl 

The PAPI web service is a generic service. You can also create process-specific web service.

On the process, click menu “Process” >> “Process Web Service”

image

image

 

After start the engine, visit http://localhost:9000 (checkpoint for vpn is using port 9000, make sure you close that one before start the engine)

image 

 image

Click “here” will bring you to the WSDL and here is the url

http://localhost:9000/albpmServices/PAPI-WS-Exercise/ws/SampleProcessServiceListener?wsdl=true

 

The process inside obpm can also consume an external web service.

On one module, right click

image

Input the WSDL url: http://localhost:7001/cnscmservice_jaxws/CNSCMService?WSDL

clip_image002

obpm will generate the component based on the WSDL. Here is the sample code to use call the component

CNSCMService cnsCMService = new CNSCMService(); 
ChangeTicketComponents.CNSCMServiceWS.ChangeTicket changeTicket = new ChangeTicketComponents.CNSCMServiceWS.ChangeTicket();
changeTicket.id = 888;
changeTicket.createdDate = new Java.Util.Date();
cnsCMService.addChangeTicket(changeTicket : changeTicket, out @return : args["externalIdArg"]);

No comments:

Post a Comment