Package de.xima.fc.workflow.converter
Class WorkflowPersistHelper
java.lang.Object
de.xima.fc.workflow.converter.WorkflowPersistHelper
Helper methods for serializing / deserializing a workflow version.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- 
Method SummaryModifier and TypeMethodDescriptionstatic Stringstatic FlowchartSnapshotcreateFlowchartSnapshot(Mandant client, Locale locale, WorkflowVersion workflowVersion) Creates a flowchart snapshot that represents the given workflow version.static FlowchartSnapshotcreateFlowchartSnapshot(ProcessModel processModel, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, List<WorkflowStateModel> stateList) Creates a flowchart snapshot that represents the given process and state list.static voidcreateNewBackup(IEntityContext ec, Mandant client, Locale locale, WorkflowVersion workflowVersion) Creates and persist a new backup for the given workflow version.static FlowchartSnapshotloadSnapshotForBackup(IEntityContext ec, WorkflowVersionBackup backup) static FlowchartSnapshotloadSnapshotForPersisted(Mandant client, Locale locale, long workflowVersionId) Loads the given workflow version from the database and creates a snapshot for that version.
- 
Method Details- 
createCustomBackupDataJsonpublic static String createCustomBackupDataJson(List<WorkflowStateModel> states) throws FastJsonException - Parameters:
- states- Workflow states for the custom backup data.
- Returns:
- The custom data for the FlowchartBase.getBackupCustomDataProvider()
- Throws:
- FastJsonException- When the data could not be serialized into JSON.
 
- 
createFlowchartSnapshotpublic static FlowchartSnapshot createFlowchartSnapshot(Mandant client, Locale locale, WorkflowVersion workflowVersion) throws FastJsonException Creates a flowchart snapshot that represents the given workflow version. This snapshot can be used to load the workflow state later on.- Parameters:
- client- Current client of the version being edited.
- locale- Current locale of the logged in user.
- workflowVersion- Workflow version for which to create a backup.
- Returns:
- A new snapshot with the data from the given workflow version.
- Throws:
- FastJsonException- When the workflow version could not be serialized.
 
- 
createFlowchartSnapshotpublic static FlowchartSnapshot createFlowchartSnapshot(ProcessModel processModel, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, List<WorkflowStateModel> stateList) throws FastJsonExceptionCreates a flowchart snapshot that represents the given process and state list. This snapshot can be used to load the workflow state later on.- Parameters:
- processModel- Process model for the flowchart.
- customParamsMap- Map with the model data for the flowchart elements.
- stateList- List of workflow states to save.
- Returns:
- A new snapshot with the data from the given workflow version.
- Throws:
- FastJsonException- When the workflow version could not be serialized.
 
- 
createNewBackuppublic static void createNewBackup(IEntityContext ec, Mandant client, Locale locale, WorkflowVersion workflowVersion) throws FastJsonException Creates and persist a new backup for the given workflow version.- Parameters:
- ec- Current entity context for accessing the database.
- client- Current client of the version being edited.
- locale- Current locale of the logged in user.
- workflowVersion- Workflow version for which to create a backup.
- Throws:
- FastJsonException- When the workflow version could not be serialized.
 
- 
loadSnapshotForBackuppublic static FlowchartSnapshot loadSnapshotForBackup(IEntityContext ec, WorkflowVersionBackup backup) throws FastJsonException - Parameters:
- ec- Current entity context for accessing the database.
- backup- Backup to process
- Returns:
- The snapshot corresponding to the given backup, nullwhen not found.
- Throws:
- FastJsonException- When the persist JSON could not be deserialized.
 
- 
loadSnapshotForPersistedpublic static FlowchartSnapshot loadSnapshotForPersisted(Mandant client, Locale locale, long workflowVersionId) throws FastJsonException Loads the given workflow version from the database and creates a snapshot for that version.- Parameters:
- client- Current client of the designer.
- locale- Current locale of the designer.
- workflowVersionId- ID of the workflow version to load.
- Returns:
- A newly created snapshot with the data of the given workflow version.
- Throws:
- FastJsonException- When the JSON for the flowchart snapshot could not be created.
 
 
-