Class WorkflowBackupHelper


  • public final class WorkflowBackupHelper
    extends Object
    Helper methods for working with workflow version backups.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • WorkflowBackupHelper

        public WorkflowBackupHelper()
    • Method Detail

      • createBackupModel

        public static WorkflowBackupModel createBackupModel​(IEntityContext ec,
                                                            WorkflowVersion workflowVersion)
        Creates the backup model with all current backups available for the given workflow version.
        Parameters:
        ec - Current entity context for accessing the database.
        workflowVersion - Workflow version for which to create the backup model.
        Returns:
        A new backup model with no selected backup and all backups from the given version.
      • createPersistJson

        public static String createPersistJson​(WorkflowModelBean modelBean)
                                        throws FastJsonException
        Creates the persist JSON of the workflow that can be loaded later on.
        Parameters:
        modelBean - Model bean with the current workflow state.
        Returns:
        The newly created persist JSON reflecting the workflow state.
        Throws:
        FastJsonException - When the persist JSON could not be created due to a JSON serialization error.
      • updateBackupModel

        public static void updateBackupModel​(IEntityContext ec,
                                             WorkflowVersion workflowVersion,
                                             WorkflowBackupModel backupModel)
        Updates the given backup model with the data from the workflow version, including the list of available backups and the maximum backup count.
        Parameters:
        ec - Current entity context for accessing the database.
        workflowVersion - Workflow version for which to update the backups.
        backupModel - Backup model to update.