Monday, November 23, 2009

Configuring PAPI Client for Oracle BPM

External web applications can access (and execute) BPM instance data using PAPI or PAPI-WS (PAPI Webservice). To be able to use PAPI, you will need to
1. Set up the web application to talk to the Oracle BPM. This is done by pointing to the directory.xml file of your BPM install.
2. Getting hold of the jars that expose these APIs.

Details
1. directory.xml file is present under the /conf directory of your BPM install. This file contains the information about the admin user and BPM engine as well as directory databases, which is essential to access the instances and for authentication purposes respectively.

2. The required jars to build your custom PAPI client application are:
fuegopapi-client,jar, b1oracle.jar, b1base.jar and b1util.jar
Once you have the jars configured for your project, you can initialize the papi session using the code below:

import fuego.papi.*;

public ProcessServiceSession initializeOracleBPMPapi() {
Properties configuration = new Properties();
String bpmDirConfigName = “custom”
String bpmDirPath = “C:\\OraBPMwlHome\\conf\\directory.xml";
configuration.setProperty(ProcessService.DIRECTORY_ID, bpmDirConfigName);
configuration.setProperty(ProcessService.DIRECTORY_PROPERTIES_FILE, bpmDirPath);
ProcessServiceSession papisession = null;
try{
ProcessService processService = ProcessService.create(configuration);
String user = "userForBPM";
String passA = "passwordIsConfidential";
papisession = processService.createSession(user, pass, hostname);
return papisession;
}
catch (CommunicationException e) {
log.log(Level.SEVERE, "Error initializing PAPI", e);
}
catch (OperationException e) {
log.log(Level.SEVERE, "Error initializing PAPI", e);
}
}


Points to Note
1. bpmDirConfigName = “custom”. The value 'custom' comes from the directory.xml file. This is the custom configuration name that you would have given when creating the BPM configuration.





2. String user = "userForBPM"; The user should have access to log into Oracle BPM. The best practice would be to configure the Oracle BPM and your external web application to the same LDAP.

No comments:

Post a Comment