Wait Notify Service

The Wait Notify service joins two or more asynchronous subprocesses. You can synchronize several processes that were originally subprocesses that do not have to have the same wfd_name.

The following table provides an overview of the Wait Notify service:

Category Description
System name WaitNotifyCompleteService
Graphical Process Modeler (GPM) category None
Description Provides the ability to join two or more asynchronous subprocesses. It enables you to synchronize on several processes that were originally run asynchronously. The subprocesses do not have to have the same wfd_name.
Business usage This is an internal only service. It enables another service to wait until a specified set of business processes have completed before going on to the next step of the original process.
Usage example Used in conjunction with an enhancement to the EDI Deenvelope service to allow a process to wait for all interchanges to be deenveloped before proceeding.
Preconfigured? Yes
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services This service will work with other services that initiate business processes at java coding level.
Application requirements None
Initiates business processes? Does not initiate any other business processes, but it does notify the original business process that all pre-selected business processes have completed.
Invocation Does not run in a business process. It can run only by a service that includes custom java code that triggers this functionality.
Business process context considerations The original business process has to implement a trigger and writes a record in the workflow_data table where the WaitNotifyCompleteService can check if all selected business processes are done. If so, the service will notify the original business process, which will continue processing. An error in a subprocess will be propagated to the original business process.
Returned status values Returned status values:

Success – Run without error.

Advanced:
  • Sibling still running – Other bootstrapping subprocess still running, so continue parent business process is not done yet.
  • Continue parent wf id= – This is the last subprocess, and it continued parent business process.
Restrictions The Wait Notify service must be used with a custom service that sets the following fields in the service before starting the subprocesses. Trigger:
iwfc.setOrigWFCID(invoking service wfc) 
iwfc.addContentElement(“PARENT_SERVICE_NAME”+ invoking service wfc, wfc.getServiceName) 
iwfc.addContentElement(“PARENT_WF_ID”,bootstrapping wf id)
After all subprocesses are started, the service has to call the following:
WorkFlowData wfData=new WorkFlowData(Connection); 
WorkFlowDataTable wfData = new WorkFlowDataTable(conn);  
 wfData.setDataString(number of sub wfs kicked off successfully)); 
 wfData.setDataName(wfc.getWorkFlowContextId()); 
 wfData.setDataKey(wfc.getServiceName() + wfc.getWorkFlowContextId()); 
 wfData.setWorkFlowInstanceId(wfc.getWorkFlowId()); 
Note: The Wait Notify service is called by the system automatically if the fields in the table, Output from Business Process to Service, are set before it calls InitialWorkFlowContext(iwfc).start().
Persistence level Full
Testing considerations None

Output from Business Process to Service

The following table describes the fields that must be included in the custom service code to use the Wait Notify service:

Parameter Name(BPML Element Value) Description
PARENT_SERVICE_NAME(iwfc.addContentElement) Business process context of the service that starts this service. Required.
PARENT_WF_ID(iwfc.addContentElement) ID of the business process that starts this service. Required.