protected override void Execute(NativeActivityContext context)
        {
            base.Execute(context);

            var request = Reject.Get(context);

            RigOapChecklistVerifier rigOapVerifier = null;

            if (request.Inputs.TryGetValue("Verifier", out object verifierId))
            {
                rigOapVerifier = RigChecklist.VerifiedBy.FirstOrDefault(c => c.UserId == (int)verifierId);

                if (rigOapVerifier == null)
                {
                    return;
                }
            }

            UpdateTask(rigOapVerifier, RigChecklist.RigChecklistUniqueId, WorkflowStatus.Completed.ToString());

            rigOapVerifier.SignedOn = DateTime.UtcNow;

            rigOapVerifier.Status = WorkflowStatus.Rejected.ToString();

            rigOapVerifier.Comment = request.Reason;

            RigChecklist.Status = ChecklistStatus.Completed.ToString();

            RigChecklistService.Save(RigChecklist);
        }
        protected override void Execute(NativeActivityContext context)
        {
            base.Execute(context);

            var status = Status.Get(context);

            RigChecklist.Status = status;

            RigChecklistService.Save(RigChecklist);
        }
        protected override void Execute(NativeActivityContext context)
        {
            base.Execute(context);

            var ownerAssignmentRequest = Owner.Get(context);

            if (!ownerAssignmentRequest.Users.Any())
            {
                return;
            }

            RigChecklist.OwnerId = ownerAssignmentRequest.Users.First().Id;
            RigChecklistService.Save(RigChecklist);
        }
        protected override void Execute(NativeActivityContext context)
        {
            var rigChecklistId = RigOapChecklistId.Get(context);

            try
            {
                RigChecklistService = Container.GetInstance <IRigOapChecklistService>();
                IrmaTaskService     = Container.GetInstance <IIrmaTaskService>();
                peopleService       = Container.GetInstance <IPeopleService>();
            }
            catch (Exception ex)
            {
                //TODO :  Add error logging
            }

            RigChecklist = RigChecklistService.Get(rigChecklistId);
        }
Exemple #5
0
        protected override void Execute(NativeActivityContext context)
        {
            base.Execute(context);

            var request = Approval.Get(context);

            RigOapChecklistVerifier rigOapVerifier = null;

            if (request.Inputs.TryGetValue("Verifier", out object verifierId))
            {
                rigOapVerifier = RigChecklist.VerifiedBy.FirstOrDefault(c => c.isReviewer && c.UserId == (int)verifierId);
            }

            if (rigOapVerifier == null)
            {
                return;
            }

            rigOapVerifier.SignedOn = DateTime.UtcNow;

            rigOapVerifier.Status = WorkflowStatus.Completed.ToString();

            UpdateTask(rigOapVerifier, RigChecklist.RigChecklistUniqueId, WorkflowStatus.Completed.ToString());


            if (RigChecklist.VerifiedBy.Any(v => v.isReviewer && !v.Status.Equals(WorkflowStatus.Completed.ToString())))
            {
                var pendingReviewer = RigChecklist.VerifiedBy.OrderBy(v => v.Order).FirstOrDefault(v => v.isReviewer && !v.Status.Equals(WorkflowStatus.Completed.ToString()));

                if (pendingReviewer == null)
                {
                    throw new Exception("Verifier Order Status are invalid");
                }

                AddTask(pendingReviewer, RigChecklist.RigChecklistUniqueId, $"Waiting for {pendingReviewer.Role}, {pendingReviewer.User?.Name} to review", "Open");

                pendingReviewer.Status = WorkflowStatus.Pending.ToString();
            }
            else //All Reviewers and OIM Verified
            {
                RigChecklist.Status = ChecklistStatus.Completed.ToString();
                AllVerifiersApproved.Set(context, true);
            }

            RigChecklistService.Save(RigChecklist);
        }
        protected override void Execute(NativeActivityContext context)
        {
            base.Execute(context);

            var rigOapVerifier = RigChecklist.VerifiedBy.FirstOrDefault(c => !c.isReviewer && string.IsNullOrEmpty(c.Status));

            if (rigOapVerifier == null)
            {
                return;
            }

            AddTask(rigOapVerifier, RigChecklist.RigChecklistUniqueId, $"Waiting for {rigOapVerifier.Role}, {rigOapVerifier.User?.Name} to sign", "Open");


            rigOapVerifier.Status = WorkflowStatus.Pending.ToString();

            RigChecklistService.Save(RigChecklist);
        }
        protected override void Execute(NativeActivityContext context)
        {
            base.Execute(context);

            const string CompletedStatus = "Completed";
            const string PendingStatus   = "Pending";

            var verifier = Verifier.Get(context);

            var rigOapVerifier = RigChecklist.VerifiedBy.FirstOrDefault(c => c.UserId == verifier.Id);

            if (rigOapVerifier == null)
            {
                return;
            }

            rigOapVerifier.SignedOn = DateTime.UtcNow;

            rigOapVerifier.Status = CompletedStatus;

            if (RigChecklist.VerifiedBy.Any(v => !v.Status.Equals(CompletedStatus)))
            {
                var pendingVerifier = RigChecklist.VerifiedBy.FirstOrDefault(v => v.Order == (rigOapVerifier.Order + 1));

                if (pendingVerifier == null)
                {
                    throw new Exception("Verifier Order Status are invalid");
                }

                pendingVerifier.Status = PendingStatus;
                RigChecklistService.Save(RigChecklist);
                return;
            }

            RigChecklistService.Save(RigChecklist);

            AllVerifiersApproved.Set(context, true);
        }
        protected override void Execute(NativeActivityContext context)
        {
            base.Execute(context);

            RigChecklistService.Save(RigChecklist);
        }