...
To create a multithreaded process, you need to create two process classes extending com.crm.process.CRMProcessRunBean implementing at least one method each. The first one (main) will be used to create and run new threads and the second one will implement the business logic executed by a thread.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
public class CRMProcessBillAccountextends CRMProcess { ... @EJB private CRMProcessLog processLog; ... public void billAccount(String accrecID, CRMDOProcessRunLog processRun, Boolean logSuccess, Boolean logFailed) throws Exception { try { //put the code to bill the account here ... ... } catch(Exception e) { processLog.createEntityLogRecord(processRun.getId(), accrecID, "ACCOUNTSRECEIVABLE", ProcessRunLogEntityStatus.FAILED.toString(), e.getClass().getSimpleName(),//log the error details here ... ... ExceptionUtil.getStackTrace(e),logFailed,logSuccess);//Rollback the changes getSessionContext().setRollbackOnly(); } } ... } |