![]() | Snapshots |
Snapshots save the current state of the Vishnu-Tree. These Snapshots can be viewed in another Vishnu-instance as part of its Jobs, as if they belonged directly to it.
You can make Vishnu write Snapshots by configuring it as in the following JobDescription.xml:
<?xml version="1.0" encoding="utf-8"?> <JobDescription> <LogicalName>Check TreeEventTrigger Snapshot</LogicalName> <LogicalExpression>IS flipflop</LogicalExpression> <JobSnapshotTrigger> <Reference>AnyLogicalResultChanged|Exception</Reference> <Parameters>Check TreeEventTrigger Snapshot</Parameters> </JobSnapshotTrigger> <Checkers type="array"> <Checker> <LogicalName>flipflop</LogicalName> <PhysicalPath>TrueFalseExceptionChecker.dll</PhysicalPath> <Parameters>Null:True:False:Exception</Parameters> <Trigger> <PhysicalPath>TimerTrigger.dll</PhysicalPath> <Parameters>S:10</Parameters> </Trigger> </Checker> </Checkers> </JobDescription>
In the JobSnapshotTrigger section of this example, it is specified that a Snapshot should always be written when in the "Check TreeEventTrigger Snapshot"-node or somewhere in its subnodes
the logical state changes (red to green or vice versa): "AnyLogicalResultChanged"
an unforeseen event (usually an error) occurs: "Exception".
The vertical line "|" separates individual arguments and always means OR.
![]() |
---|
Snapshots are always saved under the name "JobSnapshot.xml" in a subdirectory with the same name as the Job-directory of the generating Job and NOT! with the LogicalName of the Job. In our example, this is "...\CheckTreeEventTriggerSnapshot\JobSnapshot.xml" and not, for example "...\Check TreeEventTrigger Snapshot\JobSnapshot.xml". You can find out exactly where Vishnu writes and searches for Snapshots in the chapter "Where Vishnu creates and searches for snapshots". |
![]() |
---|
JobSnapshotTriggers are TreeEventTriggers. These allow an additional time specification as the last argument after the events, e.g. AnyLogicalResultChanged|Exception|S:30. In our JobSnapshotTrigger, this addition would ensure that a Snapshot would be written every 30 seconds, regardless of the other events. |
The following example displays a snapshot from the above example job "Check TreeEventTrigger Snapshot" in another job:
<?xml version="1.0" encoding="utf-8"?> <JobDescription> <LogicalName>ShowRefCheckTreeEventTriggerSnapshot</LogicalName> <LogicalExpression>IS CheckTreeEventTriggerSnapshot</LogicalExpression> <Snapshots type="array"> <Snapshot> <LogicalName>CheckTreeEventTriggerSnapshot</LogicalName> <Trigger> <PhysicalPath>FileWatcherTrigger.dll</PhysicalPath> </Trigger> </Snapshot> </Snapshots> </JobDescription>
Snapshots of other Jobs to be loaded are defined in the Snapshots section. In this example, the LogicalName of the referenced Snapshot must be exactly the name of the directory in which the snapshot was stored by the creating job.
![]() |
---|
You can also load snapshots under a freely chosen LogicalName. In this case, however, you must also specify the PhysicalPath parameter with the original name of the job directory of the writing job. |
When defining a Snapshot to be loaded, a FileWatcherTrigger is usually assigned to it. However, you could also use other triggers. FileWatcherTriggers do not trigger at fixed time intervals, but rather exactly when the observed file (here ...\JobSnapshot.xml) changes.
![]() |
---|
The FileWatcherTrigger assigned to a Snapshot monitors the JobSnapshot.xml of the owning Snapshot by default. If you want to change this, you have to provide the FileWatcherTrigger with your own parameters. How this works is described in the chapter Vishnu actors in the Trigger subsection. |
Vishnu writes and searches Snapshots starting from a root directory common to all snapshot directories, the "SnapshotDirectory". The SnapshotDirectory is usually relative to the current Job-Directory and is set to "...\Snapshots" by default. SnapshotDirectory is a Vishnu-parameter and can be set as described on Configuration and parameters.
![]() |
---|
As mentioned above, when you set a specific SnapshotDirectory, it is always relative to the current Job-directory. The only exception is if you set the SnapshotDirectory with an absolute path. |