Deferred Process Enactment

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.

Figure 1. Using DeferredProcessing startProcess
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:

  1. The name of the deferred process method being requested. This string value is configured by you in the DPProcess table. The exact configuration of the DPProcess table for deferred processing is dealt with in Configuration of Deferred Processing Table.
  2. The instance data ID of the WMInstanceData record that is populated with information that you deem necessary to be used by the deferred process.
  3. Optional The Error Handler that implements the TicketCallback interface that should be invoked if an error occurs. If the parameter is not provided the global error handler set through the property curam.custom.workflow.ticketcallback is called.