Class WorkflowSnapshotConfiguration
java.lang.Object
io.axoniq.framework.workflow.configuration.WorkflowSnapshotConfiguration
The snapshot settings of the workflow engine, customized through
WorkflowConfigurer.snapshots(java.util.function.Function<io.axoniq.framework.workflow.configuration.WorkflowSnapshotConfiguration, io.axoniq.framework.workflow.configuration.WorkflowSnapshotConfiguration>).
Snapshots are disabled by default. Once enabled, the engine snapshots:
- The running-workflow list, as its
snapshot policydictates. There is one list, so there is one snapshot of it. - The state of each workflow instance, as its
snapshot policydictates. Every workflow instance has a snapshot of its own.
Example usage:
WorkflowConfigurer.create()
.snapshots(snapshots -> snapshots.enabled(true)
.runningWorkflows(SnapshotPolicy.afterEvents(500))
.workflowState(SnapshotPolicy.afterEvents(200)));
- Since:
- 5.4.2
- Author:
- Stefan Dragisic
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanenabled()Returns whether snapshots are taken.enabled(boolean enabled) Enables or disables snapshots.Returns theSnapshotPolicyof the running-workflow list.runningWorkflows(SnapshotPolicy runningWorkflows) Sets theSnapshotPolicyof the running-workflow list.Returns theSnapshotPolicyof the state of each workflow instance.workflowState(SnapshotPolicy workflowState) Sets theSnapshotPolicyof the state of each workflow instance.
-
Constructor Details
-
WorkflowSnapshotConfiguration
public WorkflowSnapshotConfiguration()
-
-
Method Details
-
enabled
Enables or disables snapshots. Defaults tofalse.- Parameters:
enabled- whether snapshots are taken- Returns:
- this configuration, for a fluent API
-
runningWorkflows
Sets theSnapshotPolicyof the running-workflow list. Defaults toafter 50 events.- Parameters:
runningWorkflows- theSnapshotPolicyof the running-workflow list- Returns:
- this configuration, for a fluent API
-
workflowState
Sets theSnapshotPolicyof the state of each workflow instance. Defaults toafter 50 events.- Parameters:
workflowState- theSnapshotPolicyof the state of each workflow instance- Returns:
- this configuration, for a fluent API
-
enabled
public boolean enabled()Returns whether snapshots are taken.- Returns:
trueif snapshots are taken,falseotherwise
-
runningWorkflows
Returns theSnapshotPolicyof the running-workflow list.- Returns:
- the
SnapshotPolicyof the running-workflow list
-
workflowState
Returns theSnapshotPolicyof the state of each workflow instance.- Returns:
- the
SnapshotPolicyof the state of each workflow instance
-