Class WorkflowBackupHelper
java.lang.Object
de.xima.fc.workflow.designer.helper.WorkflowBackupHelper
Helper methods for working with workflow version backups.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkflowBackupModelcreateBackupModel(IEntityContext ec, WorkflowVersion workflowVersion) Creates the backup model with all current backups available for the given workflow version.static StringcreatePersistJson(ViewContextBean viewContextBean, WorkflowModelBean modelBean) Creates the persist JSON of the workflow that can be loaded later on.static UnpackedFlowchartSnapshotunpackSnapshot(IBaseEnvironmentData env, FlowchartSnapshot snapshot) Unpacks the contents of the snapshots.static UnpackedFlowchartSnapshotunpackSnapshot(IBaseEnvironmentData env, FlowchartSnapshot snapshot, WorkflowVersion workflowVersion) Unpacks the contents of the snapshots.static voidupdateBackupModel(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.
-
Constructor Details
-
WorkflowBackupHelper
public WorkflowBackupHelper()
-
-
Method Details
-
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(ViewContextBean viewContextBean, WorkflowModelBean modelBean) throws FastJsonException Creates the persist JSON of the workflow that can be loaded later on.- Parameters:
viewContextBean- View context bean with the current client scope.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(IBaseEnvironmentData env, FlowchartSnapshot snapshot) throws FastJsonException Unpacks the contents of the snapshots.- Parameters:
env- Current environment data.snapshot- Snapshot to unpack.- Returns:
- The unpacked snapshot.
- Throws:
FastJsonException- When the JSON could not be deserialized.
-
unpackSnapshot
public static UnpackedFlowchartSnapshot unpackSnapshot(IBaseEnvironmentData env, FlowchartSnapshot snapshot, WorkflowVersion workflowVersion) throws FastJsonException Unpacks the contents of the snapshots. If a workflow version is given, 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.
-