Esempio n. 1
0
        public void TestAddWorkflow()
        {
            var candidate = new Candidate {
                Id = Guid.NewGuid(), Status = CandidateStatus.AvailableNow
            };

            _candidatesCommand.CreateCandidate(candidate);

            var workflowId = Guid.NewGuid();

            _candidatesWorkflowCommand.AddStatusWorkflow(candidate.Id, workflowId);

            Assert.AreEqual(workflowId, _candidatesWorkflowCommand.GetStatusWorkflowId(candidate.Id));
            var without = _candidatesWorkflowQuery.GetCandidatesWithoutStatusWorkflow();

            Assert.AreEqual(0, without.Count);
        }
Esempio n. 2
0
        private void CreateWorkflow(Guid candidateId, CandidateStatus status, bool ignoreTimeoutOnce)
        {
            // Create new workflow instance.

            var parameters = new Dictionary <string, object>
            {
                { "CandidateId", candidateId },
                { "State", status.ToState() },
                { "IgnoreTimeoutOnce", ignoreTimeoutOnce },
            };

            var workflow = CreateWorkflow <Design.CandidateStatusWorkflow.Workflow>(parameters);

            // Record workflow instance in LinkMe database.

            _candidatesWorkflowCommand.AddStatusWorkflow(candidateId, workflow.InstanceId);

            // Start running the workflow.

            workflow.Start();
        }