Open arturboronat opened 12 months ago
It may be worth drawing inspiration from known YAML configuration formats that also have to deal with duplication. For instance, this problem is common enough in Gitlab CI YAML files that they have come up with a number of mechanisms. See here:
https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html
It's worth keeping in mind that YAML already has functionality for some of this, e.g. anchors.
Activity templates could help manage complexity in activity configuration files.
Problem
As we create more examples for the platform, activity configuration files are becoming increasingly difficult to maintain, mostly due to duplication of configuration parameters.
For example, a typical activity definition for model trafos like YAMTL looks something like this the yaml code snippet below, where only the annotated parameters need to be updated:
Potential solution
A template is an activity abstraction that encapsulates the configuration of an activity type so that it can be parameterised, facilitating the reuse of the configuration logic across similar examples (template instances).
The idea is to define a template
yamtl-m2m-activity-template
with the configuration logic parameterised using parameter names where required as values of properties. Then, for each specific activity, the template can be instantiated using a specific value binding for each paramater. For example:declares that
yamtl-cd2db-activity
is an instance ofyamtl-m2m-activity-template
with the specified bindings. The instantiation logic in the platform should replicate the activity template configuration replacing parameters with their corresponding argument. Once all activity instantiations have been unfolded in memory, the platform can carry on as usual.A complete example of the configuration would look like this:
If this feature is added, the documentation should explain that:
Apart from adding one more level of reuse, activity templates reduce clutter significantly.