Define Java API Class
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.
- 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|
- 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.
|Function Point||Name||Class||Data Address||Example Value|
|Get Customer||name||String||GetCustomer!C12||CHAN TAI MAN|
- In the Related Worksheets Section, add the function point name and the related worksheet name.
|Function Point||Worksheet Name|
- Done! All the settings are shown below.