Generate API
After we have defined the Java API or REST API and verified the feature in AlchemyJ Studio, we can generate the API into a Java project.
If you want AlchemyJ to generate the Jar package, select Jar as the source type in the API Generation tab of Properties dialog box before clicking Generate API. If you want AlchemyJ to generate the War package, then select War. If it is a REST API, enable the Start Server after API generation and the REST API service will be automatically started as mentioned in Step 4.
Go to the AlchemyJ toolbar, click Generate API then select the package to build.
When the compilation finishes, you should see a Java project that has been generated. The default output folder is the build folder where the workbook is in. As shown in the below screen shot, a Jar package has been created. Now, you have got the business logic in Java Language!
For REST API, the service will be started in your local machine and you can call the service for your defined function directly.
Take the Create Customer as an example, the input is an object and the HTTP method is POST. We use Postman to launch the URL and send the request body as shown below. The creation SQL defined in the business logic will be executed and the status will be returned.The record is now added to the table.