Skip to content

Proposal: DSL for workflow extension

Svyatoslav Reyentenko edited this page Aug 28, 2013 · 1 revision

Now we have macros, but we can also have some sort of workflow extension. Following scenarios are possible:

Using step definitions from other workflow:

workflow("create") {
   steps {
      provisionVm {
         ....
      }
      ....
   }
}

workflow("scale-up") {
   variables {
      workflows.create.variables //add create variables
      variable("a")...
   }
   steps {
      workflows.create.provisionVm {
         //possible overrides
      }
   }
}

This can be done with AST transformations, or maybe with Scala at runtime.

Or

Extending workflow

workflow("create") {
   steps {
      provisionVm {
         ....
      }
      ....
   }
}

workflow("scale-up", "create") {  //second parameter to point at extended workflow
   variables {
      super.variables //add create variables
      variable("a")...
   }
   steps {
      super.provisionVm {
          //possible overriedes
      }
   }
}
Clone this wiki locally