@Target(value=METHOD) @Retention(value=RUNTIME) public @interface ChangeSet
The ChangeSet annotation attached to a public method specifies
that the method implements the ChangeSet in a Batch request.
A method to which this annotation is attached must provide the following:
ChangeSetHandler
The following sample code shows how you can apply this annotation to a method:
@ChangeSet (serviceName = "EPMSampleService")
public void processChangeSet(ChangeSetHandler changeSetHandler) {
try {
//Add your initialization logic to save the current state of data
//...
//Iterate over the data modification operations in the ChangeSet
while (changeSetHandler.hasNextRequest()) {
//Retrieve the request, process it and add the response for each operation
Request request = changeSetHandler.nextRequest();
Response response = changeSetHandler.handleRequest(request);
changeSetHandler.addResponse(response);
}
//Add your logic to commit the changes
//...
} catch (Exception e) {
//Add your logic to rollback the changes
//...
}
}
By applying the ChangeSet annotation, the processChangeSet method gets invoked whenever there is a
batch request with ChangeSet on EPMSampleService.| Modifier and Type | Optional Element and Description |
|---|---|
String |
serviceName |
public abstract String serviceName
Copyright © 2020 SAP. All Rights Reserved.