griddynamics / OpenGenesis

22 stars 10 forks source link

DSL improvements: introduce sections in step declaration #738

Open bugzmanov opened 11 years ago

bugzmanov commented 11 years ago

Background: currently step declaration is messed up with: input values, export to context, flow specific details. Export to context looks especially bad.

Proposal:

            provisionVms {
                phase = "provision"
                roleName = "erlangNode"
                hardwareId = "1"
                imageId = "5825"
                quantity = 2
                retryCount = 3
                exportTo = ["vms": "erlangServers"]
            }

change to

            provisionVms {
                execution: 
                   phase = "provision"
                   retryCount = 3
                input:    
                   roleName = "erlangNode"
                   hardwareId = "1"
                   imageId = "5825"
                   quantity = 2
                export:
                    vms as "erlangServers"
            }

Note: in case of step having onlu input parameters it should be possible to declare step without sections

More complex sample

rsvato commented 11 years ago

Actually, these sections are just labels, so you can use it without any modification, because they are skipped by Groovy parser. Export section is a little tricker. How about:

export: vms to $context.erlangServers

?

as changed to 'to' to not interfere with cast operation?