A fetch defines
how the SAP
Agentry Server synchronizes
data for a target object collection. This object collection must
be a top-level collection within the module. A fetch is made up
of steps that retrieve the data for the collection from the back
end system. These steps are grouped into three categories within the
Fetch definition: Client Exchange Steps, Server Exchange Steps,
and Removal Steps. A fetch may also include properties to store
data captured from the user and validation rules for those property
values.
The
following diagram and steps depict what happens when the Agentry
Client must load or reload a fetch.
Data Flow - Fetch
- A Server
exchange steplet defined in a fetch calls the steplet doSteplet() method
to fetch objects for the user.
- The doSteplet() method calls the appropriate
method in the appropriate xxxStepHandler class.
- The xxxStepHandler method instantiates the
necessary appropriate xxxFetchBAPI object, passing
the User object and clientLastUpdate parameter
to it.
- The xxxFetchBAPI constructor retrieves the
JCo function object from the repository, using the connection on User.
- xxxFetchBAPI class sets BAPI import parameters IV_xxx and/or IS_xxx.
- xxxFetchBAPI constructor adds IT_xxx records
to BAPI import tables for search criteria or other input parameters.
- xxxStepHandler method calls processResults() method
from xxxFetchBAPI.
- xxxFetchBAPI processResults() calls execute() method
on BAPI and checks for exceptions.
- xxxFetchBAPI processResults() reads appropriate ET_xx_RETURNS table
for error messages.
- xxxFetchBAPI processResults() iterates over ET_xx_RETURNS table
and reads records from the table.
- For each record, xxxFetchBAPI processResults() calls
appropriate constructor in the appropriate SAPObject subtype.
- The SAPObject subtype constructor maps JCo
record column names to field names.
- xxxFetchBAPI processResults() collects these SAPObjects in
an array and passes it back to xxxStepHandler.
- xxxStephandler passes SAPObjects array
back to steplet doSteplet().
- Steplet doSteplet() stores SAPObjects array
in _returnData.
- Agentry application within the SAP Mobile Server parses _returnData and
sends object collection up to Client.