I create automation methods, instances, state machines, etc as part of my CloudForms-related job duties. The only workflow I know of is to use the automate section to create my classes, and instances then use the built-in editor to create my code. The testing step involves triggering the code somehow (button, service creation, vm provision, or API call) and waiting while the entire automation routine executes. Once my code is reached, it inevitably fails the first few times so I must repeat the long and tedious cycle.
My question is, is there a way of simulating/creating a full automation context within a rails console session? I’m aware of setting up a basic $evm context:
$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
This is great but I’m looking more for simulating a full blown $evm.root object complete with miq_request, miq_request_task, service_request_task, or whatever else I might be trying to work with (my question stems from not having a complete understanding for how this all gets populated during an automation request). I’m essentially looking for a better workflow for writing my automation code without having to manually trigger something within the UI and wait for the entire state machine(s) to execute before my code is hit. Is anyone aware if this is possible? If so, how? I will gladly draft some sort of documentation here once I have the answer(s).
Thanks in advance!