May
21
Starting a long running business process using EJB API
Posted by | Posted in WebSphere, Websphere Process Server / Integration Developer | Posted on 21-05-2008
Tagged Under : business process, WebSphere, WebSphere Integration Developer, WebSphere Process Server, WID, WPS
Starting a long running business process using EJB API in WebSphere Process Server
We can start a long running business process in WebSphere process server either by using Web service API or by using EJB API. To start a process using EJB API, the only parameter we need is the process name. The code for the same is given below.
javax.naming.InitialContext context = new javax.naming.InitialContext();
Object result = context.lookup("com/ibm/bpe/api/BusinessFlowManagerHome");
BusinessFlowManagerHome processHome = (BusinessFlowManagerHome) PortableRemoteObject.narrow(result,BusinessFlowManagerHome.class);
BusinessFlowManager process = processHome.create();
ProcessTemplateData templateData = process.getProcessTemplate(<processName>);
String inputTypeName = templateData.getInputMessageTypeName();
String processId = templateData.getID().toString();
ClientObjectWrapper inputCOW = process.createMessage(templateData.getID(), inputTypeName);
DataObject inputDO = (DataObject) inputCOW.getObject();
DataObject data = inputDO.createDataObject("requestData");
data.setString("name", "Albin");
data.setString("city", "Bangalore");
data.setString("zip", "123456");
PIID pid = process.initiate(templateData.getName(),processName+"-"+System.currentTimeMillis(), inputCOW);
System.out.println("Process started with PID : "+pid);



Hi Albin,
when I am using the above code for starting a business process using EJB API, I am getting an exception on following line
……
DataObject inputDO = (DataObject) inputCOW.getObject();
…….
The exception is package with URI “” is not found
I have included the jar of my library, which include all the WSDLs and XSDs.
I have also included the bpeapi.jar and bpe137650.jar
Am I missing some other steps.
Plz help me out…