We will use Get Customer as a sample to define the Java API Class.
Go to the ##JavaApiClass worksheet. AlchemyJ Workbook can support multiple Java API Class worksheets. If you have not created the ##JavaApiClass worksheet yet, you can refer to AlchemyJ Studio for more details.
In the Basic Settings section, key in the values as shown below for the basic settings. This defines the class name and the package that it should be in.
Item
Value
Sub-package name
com.alchemydemo.customer
Class name
CustomerService
Next, we define the function getCustomerByName that this class will provide. In the Functions section (for output & declaration of function), key in the values as shown below. The below setting defines the function output as an Object. The structure of this object will be defined in a Data Relationship Schema that refers to GetCustomer!B15:E18. DB Source ID is mandatory since the function requires to access DB.
Function Point
Method Name
Return Class
Return Data Address
Data Source ID
Get Customer
getCustomerByName
Object
GetCustomer!B15:E18
primary
Data Relationship Schema Address for Get Customer
Our model expects the customer name at GetCustomer!C12. Therefore, in the Function Input Parameters section, we define an input parameter called name for Function Point Get Customer. Name should be a string so its parameter class is String. Set Data Address to GetCustomer!C12 so that when the method is invoked, it will set the input value to GetCustomer!C12 at run-time.