After quite a while of inactivity, due partly to a frantic schedule and the addition of a new obsession in the form of my new mountain bike, I am back on the horse and very excited to start blogging again. A Big thanks to Steven Chan for profiling the Oracle EBD Developer on his blog, just the kick I needed to get going again.
I recently had the opportunity to present the 11i/2.6 Implement Oracle Workflow course at Oracle South
import oracle.apps.fnd.wf.bes.BusinessEvent;
import oracle.apps.fnd.wf.bes.BusinessEventException;
....
...
..
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if (pageContext.getParameter("Submit") != null)
{
// Get Transaction
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OADBTransactionImpl oadbTrx = (OADBTransactionImpl) am.getOADBTransaction();
// Create BE Object
String eventName = "companyabc.oracle.apps.xx.event.createrequest";
String eventKey = "1001-1";
BusinessEvent busEvent = new BusinessEvent(eventName, eventKey);
try
{
// Set Event Property
busEvent.setStringProperty("XX_TRX_TYPE", "NEW_REQUEST");
// Raise Event
busEvent.raise(oadbTrx.getAppsContext().getJDBCConnection());
}
catch (BusinessEventException exception)
{
// Set Message Tokens
MessageToken[] tokens =
{ new MessageToken("EVENT_EXCEPTION",
exception.toString())
};
OAException eventErrorMessage = new OAException("XX",
"XX_RAISE_EVENT_ERROR", tokens);
oadbTrx.rollback();
....
...
..
}
oadbTrx.commit();
....
...
..
}
}
}