public void ExecuteScript(JobExecutionParams executionParams)
        {
            var engineContext = GetEngineContext(executionParams);
            var engine        = new AutomationEngineInstance(engineContext);

            engine.ExecuteScriptSync();
        }
Esempio n. 2
0
        private void RunServerTask(object sender)
        {
            AutomationEngineInstance currentScriptEngine = (AutomationEngineInstance)sender;
            var childTaskPath = v_taskPath.ConvertUserVariableToString(currentScriptEngine);

            string parentTaskPath = currentScriptEngine.FileName;

            //create variable list
            InitializeVariableLists(currentScriptEngine);

            var newEngine = new AutomationEngineInstance((Logger)Log.Logger);

            newEngine.VariableList           = _variableList;
            newEngine.AppInstances           = currentScriptEngine.AppInstances;
            newEngine.IsServerChildExecution = true;

            Log.Information("Executing Child Task: " + Path.GetFileName(childTaskPath));
            newEngine.ExecuteScriptSync(childTaskPath, currentScriptEngine.GetProjectPath());

            UpdateCurrentEngineContext(currentScriptEngine, newEngine);

            Log.Information("Resuming Parent Task: " + Path.GetFileName(parentTaskPath));
        }