Deferred processes are enacted via the Deferred Processing Enactment Service.
Consider the situation where a BPO within your Cúram application needs to call a deferred process in order for it to do some other processing. The call must be made as shown in Deferred Process Enactment. Within the calling BPO you should populate a WMInstanceData record (see WMInstanceData, how to define this entity) with the information that you want to be accessible to the deferred process.
The class DeferredProcessing is available to you from the SDEJ.
import curam.util.AppException; import curam.core.fact.WMInstanceDataFactory; import curam.core.intf.WMInstanceData; import curam.core.struct.UsersDtls; import curam.core.struct.WMInstanceDataDtls; import curam.util.fact.DeferredProcessingFactory; import curam.util.intf.DeferredProcessing; import curam.util.resources.GeneralConstants; import curam.util.resources.KeySet; import curam.util.type.UniqueID; public class MyBPO extends curam.core.base.MyBPO { public void doOnlineOperation(int caseID, UsersDtls usersDtls) throws AppException { DeferredProcessing deferredProcessingObj = DeferredProcessingFactory.newInstance(); WMInstanceData wmInstanceDataObj= WMInstanceDataFactory.newInstance(); WMInstanceDataDtls wmInstanceDataDtls = new WMInstanceDataDtls(); // Create a new instance data record wmInstanceDataDtls.wmInstDataID = UniqueID.nextUniqueID(KeySet.kKeySetDefault); wmInstanceDataDtls.caseID = caseID; wmInstanceDataDtls.enteredByID = usersDtls.userName; wmInstanceDataDtls.enteredByName = usersDtls.firstName + GeneralConstants.kSpace + usersDtls.surname; wmInstanceDataObj.insert(wmInstanceDataDtls); deferredProcessingObj.startProcess( "DO_DEFERRED_OPERATION", wmInstanceDataDtls.wmInstDataID); }
Deferred Process Enactment shows a Cúram application BPO that calls a deferred process method. The key points to note, however, are that the WMInstanceData record is set up as part of the calling BPO implementation. The DeferredProcessing.startProcess() is then used to request the enactment of the deferred process method. The parameters of this method are: