public class CRMProcessSmsRunBean extends CRMProcessRunBean {
@EJB private CRMBOExsetSmsWebServiceProviderBean exsetProviderBean;
@EJB private smsMessageRunDefinitionXMLUtilBean messageRunDefinitionXMLUtilBean;
...
public void executeInfocasMessageProcessexecuteMessageProcess(CRMDOProcessRunLog processRun) throws Exception {
CRMDOProcessRunDefinition processRunDefinition = processRun.getProcessRunDefinition();
smsMessageRunDefintion messageRunDefinition= new smsMessageRunDefintion();
messageRunDefinition.setProcessRunDefinition(processRunDefinition);
messageRunDefinition = messageRunDefinitionXMLUtilBean.loadProcessingRunDefinition(messageRunDefinition);
CRMDOProvProvider provProvider = exsetProviderBean.loadEffective();
provProvider = exsetProviderBean.setObjectsFromXML(provProvider);
processRun.setStatus(ProcessRunLogStatus.IN_PROGRESS);
processRun.setStartDate(getCurrentDate());
processRunLogBean.save(processRun);
Boolean processComplete = new Boolean(false);
JDBCConnection connection= null;
try
{
//At this point is implemented the threats mechanism like in Implement a Multithreaded Process section
catch (Exception e)
{
saveEntityLogRecord(
processRun,
"",
"",
ProcessRunLogEntityStatus.FAILED,
e.getClass().getSimpleName(),
ExceptionUtil.getStackTrace(e));
processRun.setEndDate(getCurrentDate());
processRun.setStatus(ProcessRunLogStatus.FAILED);
processRunLogBean.save(processRun);
processRun = saveNextProcessRun(processRun);
if(connection!=null)
connection.close();
}
if (processComplete)
{
processRun.setStatus(ProcessRunLogStatus.COMPLETED);
processRun.setEndDate(getCurrentDate());
processRun = saveNextProcessRun(processRun);
processRunLogBean.save(processRun);
}
}
...
} |