Пример #1
0
        public void Bind(Simulation.Simulation simulation, Workflow.WorkflowProvider workflowProvider, string uuid)
        {
            UUID = uuid;
            var participant = simulation.GetParticipantById(uuid);
            if (participant != null && participant is HumanAvatar)
            {
                Role = ((HumanAvatar)participant).ActingName;
            }
            IsInitialised = simulation.IsInitialised();
            if (IsInitialised && workflowProvider != null && workflowProvider.IsConnected)
            {
                AvailableRoles = workflowProvider.AllParticipants
                        .Select(p => p.Value.FirstName + " " + p.Value.LastName).ToList();
                AvailableSpecifications = workflowProvider.AllSpecifications.Select(s => s.Value).ToList();
                RunningCases = workflowProvider.StartedCases.Select(c => new CaseModel
                {
                    SpecificationName = c.SpecificationName,
                    CaseNumber = c.CaseId,
                    State = CaseModelStateEnum.Running

                }).ToList();
                if (RunningCases.Count() == 0)
                    IsRunningCases = false;
                else
                    IsRunningCases = true;
            }
        }