Class PrintJob

  • All Implemented Interfaces:
    Serializable

    public class PrintJob
    extends Object
    implements Serializable
    Model class for a print job. It contains all information needed to print a form, including the form version, the process, the user and the workflow state.

    Hint: All entities are stored as transient fields and only their IDs are stored as persistent fields. This is done because the print job is serialized and sent to other nodes in the cluster, where the entities are retrieved from the database again. This leads to a better performance and less memory usage, because the entities are not serialized and sent over the network. It also means, that any in-memory changes to the entities are not reflected in the result of the print job.

    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Detail

      • PrintJob

        public PrintJob​(Vorgang vorgang)
        Creates a new print job for the given process. The form version and status are retrieved from the process.

        Hint: Any in-memory changes to the entities may get lost during the print itself, because the print job could be serialized and shared with other nodes in the cluster.

        Parameters:
        vorgang - The process to print.
      • PrintJob

        public PrintJob​(FormVersion formVersion)
        Creates a new print job for the given form version. The process and status are not set.

        Hint: Any in-memory changes to the entities may get lost during the print itself, because the print job could be serialized and shared with other nodes in the cluster.

        Parameters:
        formVersion - The form version to print.
    • Method Detail

      • setVorgang

        public void setVorgang​(Vorgang vorgang)
        Sets the process for this print job.

        Hint: Any in-memory changes to the entities may get lost during the print itself, because the print job could be serialized and shared with other nodes in the cluster.

        Parameters:
        vorgang - the process to set
      • setFormVersion

        public void setFormVersion​(FormVersion formVersion)
        Sets the form version for this print job.

        Hint: Any in-memory changes to the entities may get lost during the print itself, because the print job could be serialized and shared with other nodes in the cluster.

        Parameters:
        formVersion - the form version to set
      • setWorkflowState

        public void setWorkflowState​(WorkflowState workflowState)
        Sets the workflow state for this print job.

        Hint: Any in-memory changes to the entities may get lost during the print itself, because the print job could be serialized and shared with other nodes in the cluster.

        Parameters:
        workflowState - The current state for the new workflow engine. The form is rendered with this state.
      • setStatus

        @Deprecated
        public void setStatus​(Status status)
        Deprecated.
        Use setWorkflowState(WorkflowState) and the new workflow engine.
        Sets the status for this print job.

        Hint: Any in-memory changes to the entities may get lost during the print itself, because the print job could be serialized and shared with other nodes in the cluster.

        Parameters:
        status - the status to set
      • needsReload

        public boolean needsReload()
      • markEntitiesLoaded

        public void markEntitiesLoaded()
      • isEntitiesLoaded

        public boolean isEntitiesLoaded()
      • getJobID

        public String getJobID()
      • getCreatedAt

        public long getCreatedAt()
      • getUser

        public IUser getUser()
      • getVorgang

        public Vorgang getVorgang()
      • getProcessID

        public Long getProcessID()
      • getFormVersionId

        public Long getFormVersionId()
      • getWorkflowStateId

        public Long getWorkflowStateId()
      • isUsesNewWorkflow

        public boolean isUsesNewWorkflow()
      • isHideRequiredHint

        public boolean isHideRequiredHint()
      • setJobID

        public void setJobID​(String jobID)
      • setUser

        public void setUser​(IUser user)
      • setUsesNewWorkflow

        public void setUsesNewWorkflow​(boolean usesNewWorkflow)
      • setHideRequiredHint

        public void setHideRequiredHint​(boolean hideRequiredHint)