Exemplo n.º 1
0
        /// <summary>
        /// Closes the stream and ends the api session
        /// </summary>
        public void Close()
        {
            // cancel the renew login process
            _timer?.Dispose();

            // close the cache services
            EmployeeCache?.WriteCacheEntries();
            JobTitleCache?.WriteCacheEntries();
            DepartmentCache?.WriteCacheEntries();
            WorkflowCache?.WriteCacheEntries();
            EmployeeGroupCache?.WriteCacheEntries();
            EmployeeProfileCache?.WriteCacheEntries();

            Logger.Debug("Closed the Api Stream");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the default workflow template
        /// </summary>
        /// <returns></returns>
        public EntityId GetDefaultWorkflowTemplate()
        {
            const string DefaultTemplateName = "SystemDefault";

            // check the cache
            if (WorkflowCache.ContainsKey(DefaultTemplateName))
            {
                return(new EntityId(WorkflowCache.GetValue(DefaultTemplateName)));
            }

            // workflow does not exist in the cache. Get it from the service
            var workflowTemplateId = ApiService.GetDefaultWorkflowTemplateAsync(AuthToken).GetAwaiter().GetResult();

            if (workflowTemplateId != null)
            {
                WorkflowCache.Add(DefaultTemplateName, workflowTemplateId);
                return(new EntityId(workflowTemplateId));
            }

            return(null);
        }
Exemplo n.º 3
0
 public WorkflowStepChangedHandler(WorkflowCache cache)
 {
     this.cache = cache;
 }