예제 #1
0
        ///<summary>
        ///Must be overridden in the derived class, and when implemented, returns the tracking profile for the specified workflow instance.
        ///</summary>
        ///
        ///<returns>
        ///A <see cref="T:System.Workflow.Runtime.Tracking.TrackingProfile"></see>.
        ///</returns>
        ///
        ///<param name="workflowInstanceId">The <see cref="T:System.Guid"></see> of the workflow instance.</param>
        protected override TrackingProfile GetProfile(Guid workflowInstanceId)
        {
            TraceHelper.Trace();

            TrackingProfile trackingProfile;

            try
            {
                using (ITrackingServiceResourceAccessor resourceAccessor = CreateAccessor(resourceProvider))
                {
                    trackingProfile = resourceAccessor.GetTrackingProfile(workflowInstanceId);
                }
            }
            catch (Exception e)
            {
                string errorMessage = RM.Get_Error_TrackingServiceException(e.ToString());

                TraceHelper.Trace(errorMessage);

                TrackingException trackingException =
                    new TrackingException(errorMessage, e);

                base.RaiseServicesExceptionNotHandledEvent(
                    trackingException, workflowInstanceId);

                throw trackingException;
            }

            return(trackingProfile);
        }
예제 #2
0
        ///<summary>
        ///Must be overridden in the derived class, and when implemented, retrieves a new tracking profile for the specified workflow instance if the tracking profile has changed since it was last loaded.
        ///</summary>
        ///
        ///<returns>
        ///true if a new <see cref="T:System.Workflow.Runtime.Tracking.TrackingProfile"></see> should be loaded; otherwise, false. If true, the <see cref="T:System.Workflow.Runtime.Tracking.TrackingProfile"></see> is returned in profile.
        ///</returns>
        ///
        ///<param name="workflowType">The <see cref="T:System.Type"></see> of the workflow instance.</param>
        ///<param name="profile">When this method returns, contains the <see cref="T:System.Workflow.Runtime.Tracking.TrackingProfile"></see> to load. This parameter is passed un-initialized.</param>
        ///<param name="workflowInstanceId">The <see cref="T:System.Guid"></see> of the workflow instance.</param>
        protected override bool TryReloadProfile(Type workflowType, Guid workflowInstanceId, out TrackingProfile profile)
        {
            TraceHelper.Trace();

            try
            {
                using (ITrackingServiceResourceAccessor resourceAccessor = CreateAccessor(resourceProvider))
                {
                    return(resourceAccessor.TryReloadTrackingProfile(workflowType, workflowInstanceId, out profile));
                }
            }
            catch (Exception e)
            {
                string errorMessage = RM.Get_Error_TrackingServiceException(e.ToString());

                TraceHelper.Trace(errorMessage);

                TrackingException trackingException =
                    new TrackingException(errorMessage, e);

                base.RaiseServicesExceptionNotHandledEvent(
                    trackingException, Guid.Empty);

                throw trackingException;
            }
        }
예제 #3
0
        protected virtual IList <TrackingProfileChange> GetTrackingProfileChanges(ref DateTime lastCheck)
        {
            TraceHelper.Trace();

            IList <TrackingProfileChange> changes;

            try
            {
                using (ITrackingServiceResourceAccessor resourceAccessor = CreateAccessor(resourceProvider))
                {
                    changes = resourceAccessor.GetTrackingProfileChanges(ref lastCheck);
                }
            }
            catch (Exception e)
            {
                string errorMessage = RM.Get_Error_TrackingServiceException(e.ToString());

                TraceHelper.Trace(errorMessage);

                base.RaiseServicesExceptionNotHandledEvent(
                    new TrackingException(errorMessage, e),
                    Guid.Empty);

                changes = new List <TrackingProfileChange>();
            }

            return(changes);
        }