Profound.js provides a number of simple ways to call any IBM i system API or any custom ILE service program procedure. This page describes the different ways this can be done.
By defining a callable function
If the service program is converted to Node.js in the future, no dependencies will be broken, and you can continue to call the functions in the same exact way.
By calling procedures directly or creating wrapper functions
Creating the wrapper is really easy thanks to strong data type support in Profound.js. It is simply a matter of defining the parameters and return values as fields with the appropriate IBM i data type.
A sample wrapper function looks like this:
You can then call the function using something like this:
In this example, the first parameter is passed by value and the second parameter is passed by reference.
If the procedure itself is converted to Node.js in the future, no dependencies will be broken, and you can continue to call the function in the same exact way.
By using pjs.callProcedure() for advanced scenarios
For other more advanced use cases, Profound.js also provides the pjs.callProcedure() API. With pjs.callProcedure(), you can work with parameters and return values at the buffer level and provide details such as operational parameter descriptors.