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.
- 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 Operation Type is mandatory since the function requires to access DB.
|Function Point||Method Name||Return Class||Return Data Address||DB Operation Type|
|Get Customer||getCustomerByName||Object||GetCustomer!B15:E18||Non Transaction|
- 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 all the effective ranges used in this API.
|Worksheet Effective Range|