Class SubmissionStatusService


  • public class SubmissionStatusService
    extends CayenneService
    Provides submission status service which is responsible for managing submission state changes.
    • Field Detail

      • SYSTEM_PROPERTY_LEGACY_ADDRESS_LOOKUP

        public static final String SYSTEM_PROPERTY_LEGACY_ADDRESS_LOOKUP
        Java system property that controls usage of the legacy address lookup code (Mastersoft)
        See Also:
        Constant Field Values
    • Constructor Detail

      • SubmissionStatusService

        public SubmissionStatusService()
    • Method Detail

      • updateStatus

        public SubmissionStatusService.StatusChange updateStatus​(Submission submission)
        Update the status of the submission and commits the changes. Note that this method contains database transactions.
        Parameters:
        submission - the submission
        Returns:
        the submission status change
        Since:
        4.0.0
      • updateStatus

        public SubmissionStatusService.StatusChange updateStatus​(Submission submission,
                                                                 Document document)
        Update the status of the submission and commits the changes. Note that this method contains database transactions.
        Parameters:
        submission - the submission (required)
        document - the document
        Returns:
        the submission status change
        Since:
        18.5.0
      • updateFormStatusManually

        public boolean updateFormStatusManually​(Submission submission,
                                                String formStatus)
        Update the submission form status manually by specifying the new form status. Supported status changes include [ Saved | Completed | Abandoned ]. Note that this method contains database transactions.
        Parameters:
        submission - the submission to update (must not have been marked as ineligible - see Submission.isAbandonmentTypeIneligible()
        formStatus - the new form status
        Returns:
        true if the submission form status was updated or false otherwise
        Since:
        3.6.0
      • updateAttachmentStatusManually

        public void updateAttachmentStatusManually​(Submission submission,
                                                   String attachmentStatus)
        Update the submission attachment status manually by specifying the new attachment status. Note that this method contains database transactions.
        Parameters:
        submission - the submission to update
        attachmentStatus - new attachment status
      • updateReceiptStatusManuallyToReady

        public void updateReceiptStatusManuallyToReady​(Submission submission)
        Update the submission receipt status manually to ready status, deleting any previously generated PDF receipt data. Note that this method contains database transactions.
        Parameters:
        submission - the submission to update (required)
        Since:
        4.2.0
      • updateFileUploadVirusStatusManually

        public void updateFileUploadVirusStatusManually​(FileUpload fileUpload,
                                                        String newVirusStatus)
        Update the attachment virus status manually by specifying the new status. Note that this method contains database transactions.
        Parameters:
        fileUpload - the file upload to update (required, must have a virus scan status of "Error")
        newVirusStatus - new virus status
        Since:
        4.0.1
      • updatePaymentStatusManually

        public void updatePaymentStatusManually​(Submission submission,
                                                String paymentStatus)
        Update the submission payment status manually by specifying the new payment status. Note that this method contains database transactions.
        Parameters:
        submission - the submission to update
        paymentStatus - new payment status
      • updateEmailVerificationStatusManually

        public void updateEmailVerificationStatusManually​(Submission submission,
                                                          String emailVerificationStatus)
        Update the submission email verification status manually by specifying the new status. Note that this method contains database transactions.
        Parameters:
        submission - the submission to update
        emailVerificationStatus - new email verification status
      • updateDeliveryStatusManually

        public void updateDeliveryStatusManually​(Submission submission,
                                                 String deliveryStatus)
        Update the submission delivery status manually by specifying the new delivery status. Rules: The new delivery status must be valid Note that this method contains database transactions.
        Parameters:
        submission - the submission to update
        deliveryStatus - new delivery status
      • reassignTaskSubmission

        public void reassignTaskSubmission​(Submission submission,
                                           UserAccount newAssignee,
                                           HttpServletRequest request)
        Reassign the task submission to the specified user account. The submission must be assigned to one or more form groups. The new assignee must be in the appropriate group(s) with save access. The current user must be the same as the new assignee, or must have permission to assign tasks to other users.
        Parameters:
        submission - the task submission (required)
        newAssignee - the user account to whom the task will be assigned (required)
        request - the HTTP servlet request (required)
        Since:
        4.1.0
      • canChangeDeliveryStatus

        public boolean canChangeDeliveryStatus​(Submission submission,
                                               String newDeliveryStatus)
        Check whether a submission can be manually updated to a given delivery status.
        Parameters:
        submission - the submission (required)
        newDeliveryStatus - the new delivery status
        Returns:
        true if the status change is permissible, false otherwise
        Since:
        18.11.0
      • unassignTaskSubmission

        public void unassignTaskSubmission​(Submission submission,
                                           HttpServletRequest request)
        Unassign the task submission, removing the user associated with it. The submission must be associated with one or more work groups and be assigned to the current user, or the user must have permission to unassign tasks from other users.
        Parameters:
        submission - the task submission (required)
        request - the HTTP servlet request (required)
        Since:
        4.1.0
      • resetTaskSubmission

        public boolean resetTaskSubmission​(Submission submission)
        Reset a task submission that has been abandoned or rejected by the user. The task will be reset to "Assigned" and the most recent assigned task data will be used.
        Parameters:
        submission - the submission (required, must be a task, form status must not be "Completed", "Expired" or "Assigned")
        Returns:
        true if the task submission was reset successfully
        Since:
        4.1.0
      • invokeSubmissionCompletedProcessor

        protected void invokeSubmissionCompletedProcessor​(ISubmissionCompletedProcessor completedProcessor,
                                                          Submission submission)
        Invoke the given Submission Completed Process against the given submission.
        Parameters:
        completedProcessor - the submission compled processor
        submission - the submission object
        Since:
        3.6.0
      • virusScanComplete

        protected boolean virusScanComplete​(Submission submission)
        Check whether the virus scan has been performed for all attachments associated with the submission.
        Parameters:
        submission - the submission
        Returns:
        true if virus scan has been done, otherwise false.