Dalet Flex documentation has moved!
This page is no longer actively maintained. For the latest documentation, please visit us at our new support portal: https://support.dalet.com
One of the most powerful aspects of the Flex platform is the ability to be able to write scripts to perform custom processing. For example, you could make an external HTTP REST call, inserting the results as asset metadata values. Within scripts, Flex provides an SDK that allows you to manipulate configuration and objects in a standard and well-defined manner.
There are 2 ways to write scripts within Flex:
Groovy scripts are added to supported actions, via their configuration. Note that Flex currently supports Groovy v2.5.
The following is an example script, which could be executed in a JEF Script action, which creates a new media placeholder asset:
def execute() {
def assetService = flexSdkClient.getAssetService()
NewAssetPlaceholder asset = NewAssetPlaceholder.builder()
.type("media-asset")
.name("demo asset 1")
.build()
assetService.createAsset(asset)
}
External scripts are compiled code packaged in to JARs, and hosted via a standard URL (e.g. HTTP, file). These allow customers to write re-usable and testable binaries (see External Scripts for more information).
The following actions provide support for scripting:
Actions
| Type | New Action | Legacy Action | Purpose |
|---|---|---|---|
| Decision   | JEF Script Decision | Groovy Scripted Decision Action | Controls workflow simple branch execution via the return value of a groovy script |
| JEF Script Multi-Decision | Groovy Scripted Multi-Decision Action | Controls workflow complex branch execution via the return value of a groovy script | |
| Message | JEF HTTP Message | Scripted HTTP Message | Sends an HTTP message, allowing the request and/or response to be processed via groovy script |
| Script | JEF Script | Groovy Script Action | Executes either internal or external scripts |
| Wait | JEF Wait For Named Signal | Groovy Scripted Wait For Named Signal Action    | Pauses workflow execution until a signal is received. Groovy script can be used to control whether the action should wait for the signal |
| JEF Wait For Script | Groovy Scripted Wait Action | Pauses workflow execution until a groovy script returns true, or times out |
Timed Actions
| New Action | Legacy Action | Purpose |
|---|---|---|
| JEF HTTP Message | Timed HTTP Message | Sends an HTTP message on a schedule, allowing the response to be processed via groovy script |
| JEF Script | Timed Groovy Script | Executes internal or external groovy scripts on a schedule |
The actions execute via the flex-jobasyncexecutor-service, and as such, any scripting interactions with Flex occur via its REST APIs.
The following pages are useful guides to help accelerate the writing of Flex scripts: