You can use the Other pane in the Logic tab to add control structures and custom script to listed events.
You can drag and configure the following GEL actions for each added event.
Control Structures: Used to add expression constructs. The supported actions are:
If-Then and If-Then-Else: Used to add an IF-THEN and IF-THEN-ELSE constructs. For the IF block, you must add a condition, as discussed in Adding Conditions.
While loop: Used to add a WHILE loop. For the WHILE block, you must add a condition, as discussed in Adding Conditions.
For loop: Used to add a FOR loop.
Depending on your requirement, you can also create nested actions using the above control structures.
Return value: Used to return the specified value.
Custom: Used to add customized Java (or JavaScript). The supported actions are:
Custom script (one line): Used to add a single line of code.
Custom script (multi-line): Used to add multiple lines of Java (or JavaScript) code.
You can also use the AutoComplete functionality to automatically add script functions. To activate AutoComplete, type jst. (for a BPM process) or bean. (for a Web application) in the respective box.
Query APIs for DataSet and TempTable: You can use this feature to execute an API support query like:
jst.insertRow("<dataslot_name>", "<table name>", map); which creates another map to adds a record.
jst.deleteRow("<dataslot_name>", "<table name>", map); which deletes multiple records that match values specified in the table.
If any of the column in the map does not have a matching value with the corresponding column for a row in the table, that row will not be deleted.
The dataslot can either be a TempTable or a ProdataSet.
Indexing items with square brackets (ex: “Customers[0]/Name”) does not work with ProDataSets and the query based on the attribute value, ex: “OrderItem[ProductId=1]” always returns the first match though there is more than one match with a ProductId=1.