Optimization Server - Run Python Engine Task using a Collector

This task runs the Python engine task using a DOM collector in the Optimization server.

    @Bean
    public ScriptedTaskDescription pythonEngineCollectorTask() {
        ScriptedTaskDescription task = new ScriptedTaskDescription("PythonEngineCollectorTask", "Optimization server - Run Python Engine task using collector");
        task.setDescription("Run the Python engine task using collector in the Optimization server");

        VariableAccessExpression scenario = VariableAccessExpression.of(SCENARIO);

        task.getScript()
            .addStatement(AskInputStatement.of(scenario.getVariableName(), true, JobInputType.scenarioId(WRITABLE)))
            .addStatement(ExecuteOptimizationServerTaskStatement
                .forTaskId(StringExpression.of("PythonEngineCollectorTask"))
                .withInput(INPUT_COLLECTOR, ScenarioDataExpression.of(scenario))
                .withOutputScenario(OUTPUT_COLLECTOR, scenario)
            );
        return task;
    }