public interface RemoteFunctionQueryErrorHandler
AbstractRemoteFunctionQuery
and allows to inspect and react on the
AbstractRemoteFunctionQueryResult
.
Example:
You may implement and register your own RemoteFunctionQueryErrorHandler
for the invocation of BAPIs. You want
to introduce special treament for a certain error message of the invoked BAPI. In your own
RemoteFunctionQueryErrorHandler
you gain access to the query result and can react accordingly.
Note: The query execution logic of AbstractRemoteFunctionQuery
using a CommitStrategy
that
includes a commit in the remote system (CommitStrategy.COMMIT_SYNC
, CommitStrategy.COMMIT_ASYNC
)
invokes a rollback in the remote system if the used RemoteFunctionQueryErrorHandler
throws a
RemoteFunctionException
. Otherwise, no rollback is invoked the remote system.
Modifier and Type | Method and Description |
---|---|
<QueryT extends AbstractRemoteFunctionQuery<QueryT,QueryResultT>,QueryResultT extends AbstractRemoteFunctionQueryResult<QueryT,QueryResultT>> |
handleQueryResult(QueryResultT queryResult)
Allows to inspect the query result after the query execution and react accordingly.
|
@Nonnull <QueryT extends AbstractRemoteFunctionQuery<QueryT,QueryResultT>,QueryResultT extends AbstractRemoteFunctionQueryResult<QueryT,QueryResultT>> Optional<RemoteFunctionException> handleQueryResult(@Nonnull QueryResultT queryResult)
RemoteFunctionException
or one subclass
encapsulated in an Optional
. Otherwise, return an empty Optional
.
In case of an error situation, the query exceution logic triggers a rollback in the remote system if a
CommitStrategy
including commit behaviour is used.QueryT
- The type of the queryQueryResultT
- the type of the query resultqueryResult
- The query result to inspectOptional
containing a RemoteFunctionException
or being empty.Copyright © 2019 SAP SE. All rights reserved.