Starting a long running business process using EJB API
* * * * * 1 votes
Published May 21st, 2008 in WebSphere, Websphere Process Server / Integration Developer
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);
Did you like this? If so, please about it, and subscribe to the blog RSS feed.If you enjoyed this post, make sure you subscribe to my RSS feed!



























Related Posts:
No Responses to “Starting a long running business process using EJB API”
Please Wait
Leave a Reply