/// <summary>
        /// 是否是实例的所有者
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="userId">The user id.</param>
        /// <returns>
        ///     <c>true</c> if the specified instance is owner; otherwise, <c>false</c>.
        /// </returns>
        public virtual bool IsOwner(WorkflowInstance instance, string userId)
        {
            IUserIdentity userIdentity = WorkflowRuntime.Current.GetService <IIdentityService>().GetUserIdentity(userId);

            return(userIdentity.GetUserUnitCode().Trim() == instance.Properties["UnitCode"].Trim());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除指定工作流
 /// </summary>
 /// <param name="instance"></param>
 protected abstract void DeleteWorkflowInstance(WorkflowInstance instance);