Skip to main content

SYS.DataCheck.Workflow

persistent class SYS.DataCheck.Workflow extends %Library.Persistent

SQL Table Name: SYS_DataCheck.Workflow

Workflow to be performed by running system. See System for overview. An instance of this class is referenced by each Destination object.

The workflow is a numbered list of phases. Each phase is an object of one of the following classes:
PhaseCheck, PhaseRecheckDiscrepancies, PhaseStop, or PhaseIdle.

Each phase object represents a set of actions that the system will take and includes properties to act as the functional parameters of the phase (as well as internal properties to manage internal state). When the Workflow object is created as part of the creation of a new DataCheck Destination object, it is set up with a default set of phases: 1 - Check, 2 - ReCheckDiscrepancies (with 10 iterations), and 3 - Stop.

The system proceeds through the phases in numerical order and on completion of the last phase, begins the fist phase anew. The Workflow object can be modified at any time while the system is running, and can be used to force the system to move to a new phase, or redefine the list of phases.

If DataCheck stops in the middle of processing (e.g. in the Check or RecheckDiscrepancy phase) there are options upon starting again to restart from phase #1 of the workflow anew rather than resume processing the current phase. The first phase, therefore, should be set up to be the logical beginning of the workflow. The options to restart from phase #1 take three forms: the Timeout property in this object, an argument to the Start method of the Destination object, and interactive dialog for starting in ^DATACHECK.

As an example, the following code snippet changes the workflow back to the default set of phases and sets the system to immediately go back to the first phase:

set workflow=##class(SYS.DataCheck.Workflow).%OpenId(name)
set sc=workflow.Phases.Clear() quit:$$$ISERR(sc) sc
set p=##class(SYS.DataCheck.PhaseCheck).%New()
set sc=workflow.Phases.Insert(p) quit:$$$ISERR(sc) sc
set p=##class(SYS.DataCheck.PhaseRecheckDiscrepancies).%New()
set p.Iterations=10
set sc=workflow.Phases.Insert(p) quit:$$$ISERR(sc) sc
set p=##class(SYS.DataCheck.PhaseStop).%New()
set sc=workflow.Phases.Insert(p) quit:$$$ISERR(sc) sc
set workflow.NewPhaseNumber=1 ; start at phase 1
set workflow.AbortCurrentPhase=1 ; stop working on the current phase
set sc=workflow.%Save()
quit sc

Property Inventory

Properties

property AbortCurrentPhase as %Boolean [ InitialExpression = 0 ];
If true, the system will abort the phase of the workflow that it is currently processing and move to the next phase immediately rather than allow this phase to complete any queries it is currently processing.
Property methods: AbortCurrentPhaseDisplayToLogical(), AbortCurrentPhaseGet(), AbortCurrentPhaseGetStored(), AbortCurrentPhaseIsValid(), AbortCurrentPhaseLogicalToDisplay(), AbortCurrentPhaseNormalize(), AbortCurrentPhaseSet()
property NewPhaseNumber as %Integer (MINVAL = 0);
User-specified new phase number. If not set (or set to zero) the system will move to the phase that follows its current phase when the current phase is complete. If set to a phase number the system will move to the specified phase when the current phase is complete.
Property methods: NewPhaseNumberDisplayToLogical(), NewPhaseNumberGet(), NewPhaseNumberGetStored(), NewPhaseNumberIsValid(), NewPhaseNumberLogicalToDisplay(), NewPhaseNumberNormalize(), NewPhaseNumberSet()
property Phases as list of Phase (CLASSNAME = 1);
Numbered list of phases
Property methods: PhasesBuildValueArray(), PhasesCollectionToDisplay(), PhasesCollectionToOdbc(), PhasesDisplayToCollection(), PhasesGet(), PhasesGetObject(), PhasesGetObjectId(), PhasesGetStored(), PhasesGetSwizzled(), PhasesIsValid(), PhasesOdbcToCollection(), PhasesSet(), PhasesSetObject(), PhasesSetObjectId()
property SystemName as SystemName [ Required ];
Name of the DataCheck Destination system that uses this object. Set upon creating the destination object and should not be changed.
Property methods: SystemNameDisplayToLogical(), SystemNameGet(), SystemNameGetStored(), SystemNameIsValid(), SystemNameLogicalToDisplay(), SystemNameLogicalToOdbc(), SystemNameNormalize(), SystemNameSet()
property Timeout as %Integer [ InitialExpression = 432000 ];
If the DataCheck system becomes stopped, disconnected, or paused (waiting for mirroring) in the middle of the check, then upon returning to the running state, the system would normally resume the workflow from where it left off. If the system does not return to the running state within some reasonable period, it may not be desireable to automatically resume the workflow. For example, if the systems were disconnected for several weeks in the middle of a check and then the check is resumed, the results are of questionable value, having been collected in part from two weeks prior and in part from the present time.

This property is the time, in seconds, within which DataCheck may resume a partially completed workflow phase. If this timeout is exceeded, it will restart from phase number one. A value of zero will always resume, never restart.

Default is five days (432000), on the assumption that a large amount of data is checked by this DataCheck configuration and the check may take a day or more to complete. A smaller value may be desired for configurations that complete a check in a shorter amount of time.

Property methods: TimeoutDisplayToLogical(), TimeoutGet(), TimeoutGetStored(), TimeoutIsValid(), TimeoutLogicalToDisplay(), TimeoutNormalize(), TimeoutSet()

Indexes

index (IdIndex on SystemName) [IdKey, Type = key];
Index methods: IdIndexCheck(), IdIndexDelete(), IdIndexExists(), IdIndexOpen(), IdIndexSQLCheckUnique(), IdIndexSQLExists(), IdIndexSQLFindPKeyByConstraint(), IdIndexSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods

Storage

Storage Model: Storage (SYS.DataCheck.Workflow)

^SYS.DataCheck.WorkflowD(ID)
=
%%CLASSNAME
Phases
NewPhaseNumber
AbortCurrentPhase
Version
Timeout
FeedbackOpens in a new tab