This section is intended for more experienced TIBCO EBX® users and provides high-level information on common tasks related to the EBX® Script IDE. For additional documentation resources:
The Administration Guide > EBX® Script section of the documentation provides details about the EBX® Script Language (ESL).
The Administration Guide > EBX® Script IDE > Tutorials section provides more detailed informations on some basic use cases that are designed for less experienced users.
Prior to writing a function in the EBX® Script IDE, you must first create a data model field using the function type. After field creation, the script is available to edit in the Script IDE.
To add a function type field to your data model:
Create a new data model field and set the Kind of element to Function.
Use the Data type field to specify the desired data type. The data type selected will automatically be reflected in the script in the IDE.
Save and optionally publish your data model. Note that once the field is saved, the script outline is automatically created and available to work with in the IDE. However, you cannot publish the script until the data model publication is up to date. So it might be a good idea to publish the data model at this time.
If the EBX® Script IDE perspective is not open:
Click the
icon at the top right of the EBX® toolbar and select Script IDE.
In the Dock on the left, under SCRIPTING, select Data model.
Expand the data model where the function was added, write, and publish your script.
The creation of workflow script tasks can be done directly in the Script IDE. Once a workflow script is published, it is available to use in a workflow model.
To create a workflow script:
If the EBX® Script IDE perspective is not open:
Click the
icon at the top right of the EBX® toolbar and select Script IDE.
In the Dock on the left, under SCRIPTING, select Workflow.
Create a new script.
Add required information and parameters:
Enter a script name, label, and optional description.
Add parameters that are used as input/output to access EBX® components, such as dataspaces, datasets, tables, and records.
After writing the script, select the PUBLISH button at the bottom of the Script tab.
The script is now available to select in a workflow model task by doing the following:
Select Script from the Step type menu, and click Next.
For the Script set the Input mode to Script and use the Script name menu to select the workflow script.
Prior to writing the logic for a trigger in the EBX® Script IDE, you must first add a trigger to a data model. Once you create the trigger in the data model, it is automatically available in the EBX® Script IDE.
To add a trigger to a table in your data model:
Open the data model and select the Advanced properties tab of the desired data model element.
Add and configure a trigger that uses the [Built-in] EBX Script component.
Save and then optionally publish your data model. Note that once the table is saved after adding the trigger, the trigger's outline is automatically created and available to work with. However, you cannot publish the script until the data model publication is up to date. So it might be a good idea to publish the data model at this time.
If the EBX® Script IDE perspective is not open:
Click the
icon at the top right of the EBX® toolbar and select Script IDE.
In the Dock on the left, under SCRIPTING, select Data model.
Expand the data model where the trigger was added, write, and publish your script.
A scripted REST service is the combination of a REST endpoint and the scripted logic that executes when the endpoint is accessed.
To create a scripted REST service in the Script IDE:
If the EBX® Script IDE perspective is not open:
Click the
icon at the top right of the EBX® toolbar and select Script IDE.
In the Dock on the left, under SCRIPTING, select REST service.
Use one of the following methods to create your REST endpoints:
Define the endpoint manually using the API and DATA TYPES tabs.
When creating the initial REST service, select UPLOAD FILE to import the REST API definition in a YAML or JSON file that complies with the OpenAPI specification.
Use the SCRIPT tab to write the programmatic logic for the service.
When creating a function, its name must match the Operation id of the endpoint that will call the function.
Once published, use the TEST API option to use the IDE's built-in tester.
Each script and API in the IDE includes a history of all its revisions. Each revision is created when the script is saved.
To view changes to a script:
If the EBX® Script IDE perspective is not open, click the
icon at the top right of the EBX® toolbar and select Script IDE.
Chose the script type in the Dock on the left.
Select either SCRIPT HISTORY or API HISTORY tab at the top of the workspace.
Use the Revisions column to browse changes and copy/paste or make edits to the current revision column.
Use the buttons at the bottom of the tab to save, compile, and publish the script.
When you include logging in a script, you can access log output in the following location: Administration > Scripting management > Script logs > Logs.