Try OpenEdge Now
skip to main content
Developing BPM Applications with Developer Studio
Working with Graphical Event Logic tool : Using the GEL tool in BPM projects : Using JSTools API
 

Using JSTools API

You can use the JSTools API pane in the Logic tab to add JSTools API methods to listed events.This pane is not available for Web applications.
You can drag and configure the JSTools API methods from each of the following categories:
*Getters: includes methods that return a value. You can use these methods:
*To assign a value to a dataslot (or variable) in data operations (see Adding data operations) instead of a value expression.
*In conditions (see Adding Conditions) to replace the user dataslot and constant expression boxes.
*Setters: includes methods that store a value. The supported methods are:
*setDueDate(): Used to specify the user-defined dataslot to store the due date value. Alternatively, you can replace the user dataslot box with any of the value expressions, as discussed in Adding value expressions.
*setInstruction(): Used to store the instructions entered as a constant value. Alternatively, you can replace the constant expression box with any of the value expressions, as discussed in Adding value expressions.
*setPerformer(): Used to store the performer entered as a constant value. Alternatively, you can replace the constant expression box with any of the value expressions, as discussed in Adding value expressions.
*setXPathValue(): Used to specify the user-defined dataslot to store the passed XPath constant value at the specified XPath location. Alternatively, you can replace the XPath and Value constant expression box with any of the value expressions, as discussed in Adding value expressions. setXpathValue can be used to set xpath value in LONGCHAR or TempTable/Dataset (Use SDO XPath for TempTable/DataSet).
*insertRow: This API accepts three arguments- DataSlotName, TableName, Java Map Object. Java Map Object has key-value pairs for the table’s ‘column name’ and their ‘values’. Values in the map can either be provided as java objects or as a string. The entry for Insert is as follows:
gel.insertRow(<DataslotName>, <TempTable Name>, map)
*delete Row: This API accepts three arguments- DataSlotName, TableName, Java Map Object. Java Map Objects have key-value pairs for the table’s ‘column name’ and their ‘values’. The entry for Delete is as follows:
gel.deleteRow(<DataslotName>, <TempTable Name>, map)
Users should add only those columns (in the map) for which a row with matching data has to be deleted. For example, if input map has four columns and if a row does not have matching data even for a single column out of the four, the row will not be deleted. If the input map has a wrong column name, none of the rows get deleted because every column name in the map should match with a column in the table and the data should match too. Values in the map can be provided either as a java object or a string.
*get(dataslot, xpath): This can be used to get xpath value in a longchar or TempTable/Dataset. (Use SDO XPath for TempTable/DataSet)
*Utility: provides the following utility methods:
*sendMail(): Used to send a mail. This utility allows you to specify the email address, subject, and message as constant values. Alternatively, you can replace the constant expression boxes with any of the value expressions, as discussed in Adding value expressions.
*writeLog(): Used to debug Java (or JavaScript) code. This utility allows you to specify the debug message as a constant value. Alternatively, you can replace the constant expression box with any of the value expressions, as discussed in Adding value expressions.
Note: You can also use the AutoComplete functionality to automatically add the above functions. To activate AutoComplete, type jst. (for a Business Process) or bean. (for a Web application) in the respective box.