private void SetUpReport()
        {
            var report = new ReportDerived(Guid.NewGuid(), _agency.Id, Guid.NewGuid(), Guid.NewGuid(), ModuleType.Incident, false);

            _reportId         = report.Id;
            _workflowInstance = WorkflowInstanceFactory.Create(report, _workflow.Id, new Sequence());
            _workflowInstance.DurableInstanceId = Guid.NewGuid();
        }
Ejemplo n.º 2
0
        public override IWorkflowInstance NewWorkflowInstance(IWorkflowTemplate template, string formType, string formId)
        {
            var instance = WorkflowInstanceFactory.Create(template, new Form(formType, formId), CurrentUser,
                                                          new WorkflowExecutionContext()
            {
                Approver = CurrentUser
            });

            return(instance);
        }
Ejemplo n.º 3
0
        private void SetUpReport()
        {
            var reportList = new List <Report>();

            _report = new ReportDerived(_identity.Id, QueueUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, false);
            var workflow = _agency.CreateWorkflow("Report Workflow", null);

            WorkflowInstanceFactory.Create(_report, workflow.Id, new Sequence());
            reportList.Add(_report);
            _reportsUnitOfWork.Setup(mock => mock.GetEntityQuery <Report>(It.IsAny <TrackingMode>()))
            .Returns(reportList.AsQueryable);
        }
Ejemplo n.º 4
0
        private void SetUpWorkflowInstance()
        {
            _report = new ReportDerived(_identityId, QueueUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, false);
            var workflowInstance = WorkflowInstanceFactory.Create(_report, _workflow.Id, new Sequence());

            _report.WorkflowInstance.ReportState = ReportState.InProgress;
            _report.WorkflowInstance.Sequence    = 1;
            var workflowInstanceLog = new WorkflowInstanceLog(workflowInstance, _identityId);

            workflowInstance.WorkflowInstanceLogs.Add(workflowInstanceLog);
            _reportsUnitOfWork.Setup(mock => mock.FindAndInclude <WorkflowInstance>(It.IsAny <Guid>(), TrackingMode.Automatic, ThrowIf.NotFound, instance => instance.WorkflowInstanceLogs, instance => instance.WorkflowInstanceUsers, instance => instance.WorkflowInstanceRoles))
            .Returns(workflowInstance);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a new Workflow Instance from the Workflow of a Template.
        /// </summary>
        protected WorkflowInstance CreateWorkflowInstanceFromTemplate(Report report, Template template)
        {
            // Get the Xaml from the Workflow associated to the Template
            var workflowXaml = GetWorkflowXaml(template);

            // Create a New Workflow Activity from the Xaml
            var workflowActivity = ActivityFactory.CreateActivity(workflowXaml);

            // Create a Sequence around the Workflow Activity.
            var workflowSequence = ActivityFactory.CreateSequence(workflowActivity);

            // Create a New Workflow Instance around the activity.
            var workflowInstance = WorkflowInstanceFactory.Create(report, template.Workflow.Id, workflowSequence);

            // Return the New Workflow Instance.
            return(workflowInstance);
        }
Ejemplo n.º 6
0
        public void WorkflowInstanceService_Run()
        {
            Exception        expectedException       = null;
            Workflow         workflowdetails         = GetWorkflow();
            WorkflowInstance workflowInstanceDeatils = WorkflowInstanceFactory.Create(new ReportNew(), workflowdetails.Id, new Sequence());

            Assert.IsNotNull(workflowInstanceDeatils);
            var workflowInstanceService = GetDependency <IWorkflowInstanceService>();

            Assert.IsInstanceOfType(workflowInstanceService, typeof(IWorkflowInstanceService));
            try
            {
                workflowInstanceService.Run(workflowInstanceDeatils, workflowInstanceDeatils.Report.Id);
            }
            catch (Exception exception)
            {
                expectedException = exception;
            }

            Assert.IsNull(expectedException);
        }