Exemple #1
0
 public EventsController(Arma3EventContext context, IAuthorizationService auth, PersistService persist, IApiTacMaps tacMaps, IMapInfosService mapInfos, IConfiguration config)
 {
     _context  = context;
     _auth     = auth;
     _persist  = persist;
     _tacMaps  = tacMaps;
     _mapInfos = mapInfos;
     _config   = config;
 }
        /// <summary>
        /// Gets the instance.
        /// </summary>
        /// <param name="applicationName">Name of the application.</param>
        /// <param name="eaId">The ea id.</param>
        /// <param name="attachMore">if set to <c>true</c> [attach more].</param>
        /// <returns></returns>
        public List <StateMachineWorkflowInstance> GetInstance(string applicationName, int eaId, bool attachMore)
        {
            string[] names = GetService <IWorkFlowDefinePersistService>().GetAllWorkflowDefineName(applicationName);
            List <StateMachineWorkflowInstance> instances = new List <StateMachineWorkflowInstance>();

            foreach (string workflowName in names)
            {
                instances.AddRange(PersistService.GetWorkflowInstance(workflowName, eaId, attachMore));
            }
            return(instances);
        }
        /// <summary>
        /// Gets the root.
        /// </summary>
        /// <param name="applicationName">Name of the application.</param>
        /// <param name="eaId">The ea id.</param>
        /// <param name="attachMore">是否加载工作流附属的对象如,Activity列表</param>
        /// <returns></returns>
        public StateMachineWorkflowInstance GetRoot(string applicationName, int eaId, bool attachMore)
        {
            string[] names = DefineService.GetAllWorkflowDefineName(applicationName);
            List <StateMachineWorkflowInstance> instances = new List <StateMachineWorkflowInstance>();

            foreach (string name in names)
            {
                instances.AddRange(PersistService.GetWorkflowInstance(name, eaId, attachMore));
            }
            if (instances.Count == 0)
            {
                throw new ArgumentException(string.Format("Cann't find the root instance! eaid=\"{0}\"", eaId));
            }
            foreach (StateMachineWorkflowInstance instance in instances)
            {
                if (instance.ParentId == Guid.Empty)
                {
                    return(instance);
                }
            }
            return(null);
        }
 /// <summary>
 /// Deletes the instance.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public void DeleteInstance(WorkflowInstance instance)
 {
     PersistService.DeleteWorkflowInstance(instance);
 }
 /// <summary>
 /// 获取某状态下的工作流实例
 /// </summary>
 /// <param name="workflowName">Name of the workflow.</param>
 /// <param name="stateNames">状态名称</param>
 /// <returns></returns>
 public List <StateMachineWorkflowInstance> GetListByState(string workflowName, string[] stateNames)
 {
     return(PersistService.GetWorkflowInstance(workflowName, stateNames, typeof(StateMachineWorkflowInstance)));
 }
 /// <summary>
 /// 获取当前用户所在单位的某状态的工作流实例
 /// </summary>
 /// <param name="workflowName">Name of the workflow.</param>
 /// <param name="stateNames">状态名称</param>
 /// <param name="unitCode">The unit code.</param>
 /// <returns></returns>
 public List <StateMachineWorkflowInstance> GetUnitList(string workflowName, string[] stateNames, string unitCode)
 {
     return(PersistService.GetWorkflowInstance(workflowName, stateNames, unitCode));
 }
        /// <summary>
        /// Gets the instance.
        /// </summary>
        /// <param name="workflowName">Name of the workflow.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <param name="stateNames">The state names.</param>
        /// <param name="unitCode">The unit code.</param>
        /// <returns></returns>
        public List <StateMachineWorkflowInstance> GetInstance(string workflowName, DateTime startDate, DateTime endDate, string[] stateNames, string unitCode)
        {
            List <StateMachineWorkflowInstance> instances = PersistService.GetWorkflowInstance(workflowName, startDate, endDate, stateNames, unitCode);

            return(instances);
        }
 /// <summary>
 /// 根据Id获取工作流实例
 /// </summary>
 /// <param name="id">实例的Id</param>
 /// <returns></returns>
 public WorkflowInstance GetInstance(Guid id)
 {
     return(PersistService.GetWorkflowInstance(id, true));
 }
Exemple #9
0
 public AdminReviewPersistController(Arma3EventContext context, IConfiguration config, PersistService persist)
 {
     _context = context;
     _config  = config;
     _persist = persist;
 }