Example #1
0
        /// <summary>
        /// Helper method used to build a <see cref="TrackingWorkflowInstance" />
        /// from the specified <see cref="IDataRecord" />.
        /// </summary>
        /// <param name="dataRecord">
        /// An <see cref="IDataRecord" />.
        /// </param>
        /// <returns>
        /// An instance of <see cref="TrackingWorkflowInstance" />.
        /// </returns>
        private TrackingWorkflowInstance buildTrackingWorkflowInstance(IDataRecord dataRecord, TrackingCommandName commandName)
        {
            String assemblyName = ValueReader.GetString(dataRecord,
                                                        _nameResolver.ResolveParameterName(commandName,
                                                                                           TrackingParameterName.AssemblyFullName));

            String typeName = ValueReader.GetString(dataRecord,
                                                    _nameResolver.ResolveParameterName(commandName,
                                                                                       TrackingParameterName.TypeFullName));

            return(new TrackingWorkflowInstance(
                       WorkflowInstanceHelper.DeserialiseActivity(ValueReader.GetString(
                                                                      dataRecord, _nameResolver.ResolveParameterName(commandName,
                                                                                                                     TrackingParameterName.ActivityXoml))),
                       ValueReader.GetGuid(dataRecord, _nameResolver.ResolveParameterName(
                                               commandName, TrackingParameterName.InstanceId)),
                       ValueReader.GetDateTime(dataRecord, _nameResolver.ResolveParameterName(
                                                   commandName, TrackingParameterName.InitialisedDateTime)),
                       ValueReader.GetValue(dataRecord, _nameResolver.ResolveParameterName(
                                                commandName, TrackingParameterName.WorkflowInstanceId)),
                       ValueReader.GetGuid(dataRecord, _nameResolver.ResolveParameterName(
                                               commandName, TrackingParameterName.CallerInstanceId)),
                       ValueReader.GetEnum <WorkflowStatus>(dataRecord,
                                                            _nameResolver.ResolveParameterName(commandName,
                                                                                               TrackingParameterName.WorkflowInstanceStatusId)),
                       Type.GetType(String.Format("{0}, {1}", assemblyName, typeName), false)));
        }