Class SnapshotService
- create a copy of the origin workitem instance
- compute a snapshot $uniqueId based on the origin workitem suffixed with a timestamp
- change the type of the snapshot-workitem with the prefix 'snapshot-'
- If an old snapshot already exists, Files are compared to the current $ files and, if necessary, stored in the Snapshot applied
- remove the file content form the origin-workitem
- store the snapshot uniqeId into the origin-workitem as a reference ($snapshotID)
- remove deprecated snapshots
7009e427-7078-4492-af78-0a1145a736df-[SNAPSHOT TIMESTAMP]
During the snapshot creation the snapshot-uniquId is stored into the origin workitem.
The SnapshotService implements the CDI Observer pattern provided from the DocumentService.
Model entries are not part of the snapshot concept
Note: The SnapshotService replaces the BlobWorkitems mechanism which was earlier part of the DMSPlugin from the imixs-marty project. The SnapshotService provides a migration mechanism for old BlobWorkitems. The old BlobWorkitems will not be deleted. If the DMSPlugin is still active and documents from the type 'workitemlob' will be saved, the SnapshotService throws a SnapshotException.
SnapshotService
Since version 2.0 a Imixs Archive Service can be connected to a
Imixs-Workflow instance. If the environment variable
'ARCHIVE_SERVICE_ENDPONT' is set, than the snapshot service creates a
EventLog entry each time a snapshot was generated. The Archive SyncService
scans for the EventLog entries in an asynchronous way and pulls the snaphots
directly into the Archive (Cassandra).
BackupService
Since version 2.4 an optional BackupService can be connected to a
Imixs-Workflow instance. If the environment variable 'BACKUP_SERVICE_ENDPONT'
is set, than the snapshot service creates a EventLog entry each time a
snapshot was generated. The BackupService scans for these EventLog entries in
an asynchronous way and stores the snaphots into a backup space
- Version:
- 2.0
- Author:
- rsoika
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.imixs.workflow.ItemCollection>findAllSnapshots(String uniqueid) This method returns all existing Snapshot-workitems for a given $UNIQUEID.org.imixs.workflow.ItemCollectionfindSnapshot(org.imixs.workflow.ItemCollection workitem) This method loads the snapshot for a given origin workItem .org.imixs.workflow.FileDatagetWorkItemFile(String uniqueid, String file) This method returns the fileData from a snapshot by a given origin workItem uniqueid.voidonDelete(org.imixs.workflow.engine.DocumentEvent documentEvent) All existing snapshot-workitems will be deleted when the workitem is removed.voidonSave(org.imixs.workflow.engine.DocumentEvent documentEvent) The snapshot-workitem is created immediately after the workitem was processed and before the workitem is saved.
-
Field Details
-
REGEX_URL_PATTERN
- See Also:
-
SNAPSHOTID
- See Also:
-
TYPE_PRAFIX
- See Also:
-
NOSNAPSHOT
- See Also:
-
SKIPSNAPSHOT
- See Also:
-
ITEM_FILEDATA_FILE_NAMES
- See Also:
-
ITEM_FILEDATA_FILE_COUNT
- See Also:
-
ITEM_SNAPSHOT_OVERWRITEFILECONTENT
- See Also:
-
ITEM_BACKUPRESTORE
- See Also:
-
PROPERTY_SNAPSHOT_WORKITEMLOB_SUPPORT
- See Also:
-
PROPERTY_SNAPSHOT_HISTORY
- See Also:
-
PROPERTY_SNAPSHOT_OVERWRITEFILECONTENT
- See Also:
-
ARCHIVE_SERVICE_ENDPOINT
- See Also:
-
ARCHIVE_SERVICE_INTERVAL
- See Also:
-
ARCHIVE_SERVICE_DEADLOCK
- See Also:
-
ARCHIVE_SERVICE_USER
- See Also:
-
ARCHIVE_SERVICE_PASSWORD
- See Also:
-
ARCHIVE_SERVICE_AUTHMETHOD
- See Also:
-
BACKUP_SERVICE_ENDPOINT
- See Also:
-
EVENTLOG_TOPIC_ADD
- See Also:
-
EVENTLOG_TOPIC_REMOVE
- See Also:
-
EVENTLOG_TOPIC_BACKUP
- See Also:
-
ITEM_MD5_CHECKSUM
- See Also:
-
-
Constructor Details
-
SnapshotService
public SnapshotService()
-
-
Method Details
-
onSave
public void onSave(@Observes org.imixs.workflow.engine.DocumentEvent documentEvent) The snapshot-workitem is created immediately after the workitem was processed and before the workitem is saved. -
onDelete
public void onDelete(@Observes org.imixs.workflow.engine.DocumentEvent documentEvent) All existing snapshot-workitems will be deleted when the workitem is removed. -
findAllSnapshots
This method returns all existing Snapshot-workitems for a given $UNIQUEID. The method queries the possible snapshot id-range for a given $UniqueId sorted by creation date descending.- Parameters:
uniqueid-- Returns:
-
findSnapshot
public org.imixs.workflow.ItemCollection findSnapshot(org.imixs.workflow.ItemCollection workitem) This method loads the snapshot for a given origin workItem .- Parameters:
workitem-- Returns:
- ItemCollection - snapshot object if found
-
getWorkItemFile
This method returns the fileData from a snapshot by a given origin workItem uniqueid.- Parameters:
uniqueid-file- - file name- Returns:
- FileData object for the given filename.
-