private IEnumerable <VariableValue> GetVariableValuesFrom(CollectRequest collectRequest, IDocumentSession session)
        {
            List <VariableValue> variableValues = new List <VariableValue>();

            VariableType[]    variables         = collectRequest.GetOvalVariables(session).ToArray();
            VariableEvaluator variableEvaluator = new VariableEvaluator(variables, collectRequest.GetSystemCharacteristics(session), collectRequest.GetExternalVariables());

            foreach (VariableType variable in collectRequest.GetOvalVariables(session))
            {
                IEnumerable <string>     valuesOfVariable  = variableEvaluator.EvaluateVariable(variable.id);
                IEnumerable <ObjectType> objectsByVariable = collectRequest.GetObjectTypesByVariableId(session, variable.id);
                variableValues.AddRange(this.CreateVariableValuesFrom(objectsByVariable, variable.id, valuesOfVariable));

                IEnumerable <StateType> statesByVariable = collectRequest.GetStateTypeByVariableId(session, variable.id);
                variableValues.AddRange(this.CreateVariableValuesFrom(statesByVariable, variable.id, valuesOfVariable));
            }
            return(variableValues);
        }
        /// <summary>
        /// Executes the collect for the one probe.
        /// </summary>
        /// <param name="collectRequest">The request collect.</param>
        /// <param name="probe">The probe.</param>
        /// <param name="collectExecution">the object that represents the execution of a collect</param>
        /// <returns></returns>
        private ProbeExecution ExecuteCollect(IDocumentSession session, SelectedProbe probe, CollectRequest collectRequest, VariablesEvaluated variables,
                                              IEnumerable <StateType> states, ExecutionLogBuilder executionLog)
        {
            ProbeResult probeResult = null;

            executionLog.StartCollectOf(probe.Capability.OvalObject);

            var initialTimeStamp = DateTime.Now;

            this.SetStartInstrumentationLog(executionLog, initialTimeStamp, probe.Capability.OvalObject);

            probeResult = probe.Execute(connectionContext, Target, variables, collectRequest.GetSystemCharacteristics(session), states);

            this.SetEndInstrumentationLog(executionLog, initialTimeStamp, probe.Capability.OvalObject);

            this.MergeExecutionLogs(executionLog, probe, probeResult);
            return(this.CreateTheProbeExecution(probeResult, probe));
        }