To perform additional manipulation or validation of data, you can call Java code during operation execution.
For example, you might need to convert Date
fields from a format used by back-end service, or you might want to have special handling for empty inputs to the service operation. Use the Additional Processing
inputs of the Service Operation builder to accomplish both tasks.
There are two points during execution where you can invoke processing:
Immediately before the called action is invokedPost-Execute
Immediately before the service operation results are returned.
In each case you can kick off processing by either firing an event or by calling an action. Here is how to use an event:
Call one of two events to initiate processing: operationnamePreExecute
. Each event takes two IXml arguments. PreExecute
event arguments are operationInputs
, which holds the inputs passed to your operation, and calledActionInputs
, holding the inputs to the action you are calling, after any transformations have been performed as specified in the Input Field Value
arguments are calledActionResults
, which holds the results from the action you call, and operationResults
, holding the results to your operation, after any transformations have been performed as specified in the Result Field Values
The SimpleServiceProvider sample model provides an example of additional pre-execute processing. It checks input fields for null and changes them to "%" to use as a wildcard in SQL statement.
Parent topic: Using data services: wpf7