
You design and implement a post-processing class to handle information retrieved from scheduled processes once they have been initiated.
initiatedProcess() IGPScheduledInitiationPostProcessingInterface
Apart from that, the class implementation is custom and must be tailored to your application requirements. For example, once you have retrieved process details, you can map them to your own objects or process them in an application-specific way.
To be able to use the post-processing class, you must have:
IGPScheduledInitiationPostProcessingInterface
The class may be located in a different development component (DC). Make sure you specify its name and location when creating the process schedule.
initiatedProcess()
Retrieve the process initiation context and perform all relevant operations or mappings.
These are methods that you call from your application to retrieve information after it has been processed by the post-processing class.
In the example, the initiated process is designed to send notifications if they are due.
The callback method of the post-processing class retrieves the initiation context of the process once it has been started. It also sets a notification flag to indicate that a notification was sent out.
isNotificationSentOut()
| Post-Processing Class Implementation |
|---|
packagecom.sap.test.caf.test.eu.gp.api.schedinst.postproc; importjava.util.Locale; importjavax.naming.InitialContext; importjavax.naming.NamingException; importcom.sap.caf.eu.gp.model.svc.IGPService; importcom.sap.caf.eu.gp.scheduling.api.IGPInitiationContext; importcom.sap.caf.eu.gp.scheduling.api.IGPScheduledInitiationPostProcessingInterface; publicclassScheduledInitiationCallbackimplementsIGPScheduledInitiationPostProcessingInterface {// notification sent flag publicstaticbooleannotificationSentOut =false; // implement the initiatedProcess() method publicvoidinitiatedProcess(IGPInitiationContext initiationcontext) { IGPService gpService =null; try{// get initial process context InitialContext ctxt =newInitialContext(); gpService = (IGPService) ctxt.lookup( IGPService.JNDI_REGISTRY_NAME ); }catch(NamingException e) {} // indicate that notification is sent out notificationSentOut =true; } // a custom method that checks if notification is sent out publicstaticbooleanisNotificationSentOut() {returnnotificationSentOut; } } |
isNotificationSentOut()
| Calling a Post-Processing Class Method from an Application |
|---|
importcom.sap.test.caf.test.eu.gp.api.schedinst.postproc.ScheduledInitiationCallback; // check if notification is sent or not booleansentOut = ScheduledInitiationCallback.isNotificationSentOut(); |