Tips
The tips linked from this page are maintained in the Profound.js documentation and are written using Profound.js terminology, but each one applies to Profound API. Every example is built in a shared workspace named pjstips, and the examples assume an instance running at localhost:8081 - substitute your own host and port where needed.
Overview
This page indexes the worked examples in the PJS Tips series that apply to Profound API. Each entry describes what the tip demonstrates and when it is worth following, so you can tell whether it is the one you need before you open it.
Unlike the reference pages elsewhere in this section, these tips are complete walkthroughs. Each one builds a working file, with the full source included, that you can run and then adapt.
Start with Tip 1. It creates the pjstips workspace that every other tip saves its files into, and several tips call a service that was built in an earlier tip. Working through them in order is the most reliable path.
Tips That Apply to Profound API
Tip | What It Demonstrates | Use It When |
|---|---|---|
Creating the | Always, first - the remaining tips save their files into this workspace. | |
Marking a | You want to exercise a module's logic in a browser without building an API route around it first. Tips 3 through 6 call services created here. | |
Building a low-code module that uses the Consume REST Service plugin to POST to a service, then calling that module from RPG using the code generated on the IBM i Call Interface panel and the | You are exposing low-code logic to existing RPG programs, or bridging an RPG program to an outside REST service. | |
Diagnosing a deliberately broken low-code module by converting it to the Profound.js code the low-code steps generate, which also shows what a given plugin does behind the scenes. | The Designer debugger has not narrowed a problem down, or you want to see what a plugin actually generates. | |
Filling an entire request body from an input parameter object and reading an entire response into an output parameter object in the Consume REST Service plugin, by matching your parameter structures to the service's JSON instead of assigning field by field. | Your parameter structure already matches the service contract and you want to avoid a long run of field assignment steps. | |
Sending only the populated elements of a fixed-size RPG array to a REST service, and reporting back how many elements the service returned, using a separate element count parameter. | An RPG program passes or receives an array whose actual length varies at run time, which RPG cannot express directly. | |
Calling an RPG program that returns a data structure array plus an element count from a Profound API route, then using a Write Custom Node.js Code step to trim the unused elements so the route outputs only the records that were actually populated. | A Profound API route returns a multi-record result set that is sourced from an RPG program. |
Tips Specific to Profound.js
One tip in the series covers Profound.js application development rather than APIs, and is not listed above:
Tip 7 - Uses the
PJSMYIPandPJSCALLcommands to call a "regular" (not low-code) Profound.js module running on a PC from an IBM i green screen. This is a development workflow convenience rather than an API topic.
The load-all subfile walkthrough that was previously Tip 8 has been merged into Generating Profound.js Modules with JumpStart.
For the complete series, see PJS tips.
Related Pages
Consume REST Web Service - Reference for the plugin used in Tips 3, 5, and 6.
Call IBM i Program - Reference for the plugin used in Tip 8.
Write Custom Node.js Code - Reference for the plugin used in Tip 8.
Debugging & Troubleshooting Profound API - The other debugging options available, including the Designer debugger.
Low Code Modules - Module concepts and the IBM i call interface used in Tip 3.