Implementing adapter procedures
Implement a procedure in the adapter XML file, using an appropriate signature and any return value.
We have declared a procedure in the adapter XML file, using a <procedure> tag.
Implement the procedure in the adapter JavaScript file. The signature of the JavaScript function that implements the procedure has the following format:
function funcName (param1, param2, ...),
Where:
- funcName is the name of function which the procedure implements. This name must be the same as the value specified in the name attribute of the <procedure> element in the adapter XML file.
- param1 and param2 are the function parameters. The parameters can be scalars (strings, integers, and so on) or objects.
In the JavaScript code, we can use the MobileFirst server-side JavaScript API to access back-end applications, invoke other procedures, access user properties, and write log and debug lines.
We can return any value from your function, scalar or object.
- The Rhino container
MPF uses Rhino as the engine for running the JavaScript script used to implement adapter procedures.
Parent topic: Develop the server side of a MobileFirst application