Orchestration
Task based execution in Stof.
Last updated
Was this helpful?
Task based execution in Stof.
Last updated
Was this helpful?
Because Stof is both a declarative document and a functional interface, we can combine those worlds, executing objects as tasks rather than just the specific functions they contain.
This solves a common dilemma: declarative simplicity fails when specific flexibility and extensibility are needed. For example, maybe you have a declarative data connector but need to add just a line of logic to change something. Now, you can do it right in line with the declarative data.
Object execution is controlled with a single #[run] attribute that can be placed on the fields of sub-objects and functions.
The value of the attribute (number) determines the order of execution. While functions and objects are sorted together, the default ordering dictates that sub-objects are executed before functions.
Because attributes can be placed on prototype functions, these are also considered during execution. This can be extremely helpful for transforming and working with external/imported data, as that data can be assigned a type and executed accordingly.