Class WorkflowBackupHelper
- java.lang.Object
-
- de.xima.fc.workflow.designer.helper.WorkflowBackupHelper
-
public final class WorkflowBackupHelper extends Object
Helper methods for working with workflow version backups.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description WorkflowBackupHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WorkflowBackupModel
createBackupModel(IEntityContext ec, WorkflowVersion workflowVersion)
Creates the backup model with all current backups available for the given workflow version.static String
createPersistJson(WorkflowModelBean modelBean)
Creates the persist JSON of the workflow that can be loaded later on.static UnpackedFlowchartSnapshot
unpackSnapshot(IBaseWorkflowEnvironmentData env, FlowchartSnapshot snapshot, WorkflowVersion workflowVersion)
Unpacks the contents of the snapshots and merges workflow states with persistent states (when a state cannot be deleted).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.
-
-
-
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.
-
unpackSnapshot
public static UnpackedFlowchartSnapshot unpackSnapshot(IBaseWorkflowEnvironmentData env, FlowchartSnapshot snapshot, WorkflowVersion workflowVersion) throws FastJsonException
Unpacks the contents of the snapshots and merges workflow states with persistent states (when a state cannot be deleted).- Parameters:
env
- Current environment data.snapshot
- Snapshot to unpack.workflowVersion
- Persistent workflow version against which to compare.- Returns:
- The unpacked snapshot.
- Throws:
FastJsonException
- When the JSON could not be deserialized.
-
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.
-
-