Skip to main content

Ens.Message.Search

persistent class Ens.Message.Search extends %Library.Persistent, Ens.Message.SearchBase

SQL Table Name: Ens_Message.Search

This class handles the searching of Ens.MessageHeader.

Property Inventory

Method Inventory

Parameters

parameter MESSAGECLASS = Ens.MessageHeader;
Message class to search

Properties

property LastRunTime as Ens.DataType.UTC;
When this search was last run
Property methods: LastRunTimeDisplayToLogical(), LastRunTimeGet(), LastRunTimeGetStored(), LastRunTimeIsValid(), LastRunTimeLogicalToDisplay(), LastRunTimeLogicalToOdbc(), LastRunTimeNormalize(), LastRunTimeOdbcToLogical(), LastRunTimeSet(), LastRunTimeStorageToLogical(), LastRunTimetimeCmp(), LastRunTimetimeDiff(), LastRunTimetimeLocal(), LastRunTimetimeLocaltoUTC(), LastRunTimetimeUTC(), LastRunTimetimeUTCH(), LastRunTimetimeUTCHtoUTC(), LastRunTimetimeUTCtoLocal(), LastRunTimetimeUTCtoUTCH()
property PreviewCount as %Integer (MINVAL = 0) [ InitialExpression = 0 ];
Number of rows to preview; less than TopCount
If 0, no preview will be provided; otherwise, partial results may be available before the full results are available.
Property methods: PreviewCountDisplayToLogical(), PreviewCountGet(), PreviewCountGetStored(), PreviewCountIsValid(), PreviewCountLogicalToDisplay(), PreviewCountNormalize(), PreviewCountSet()
property ResendCount as %Integer (MINVAL = 0) [ InitialExpression = 0 ];
Number of messages that have been resent
Property methods: ResendCountDisplayToLogical(), ResendCountGet(), ResendCountGetStored(), ResendCountIsValid(), ResendCountLogicalToDisplay(), ResendCountNormalize(), ResendCountSet()
property ResultColumns as %List;
A $List that contains column names
Property methods: ResultColumnsGet(), ResultColumnsGetStored(), ResultColumnsIsValid(), ResultColumnsLogicalToOdbc(), ResultColumnsOdbcToLogical(), ResultColumnsSet()
property Results as list of %String);
Query results as a list of $List, when available
Property methods: ResultsBuildValueArray(), ResultsCollectionToDisplay(), ResultsCollectionToOdbc(), ResultsDisplayToCollection(), ResultsDisplayToLogical(), ResultsGet(), ResultsGetObject(), ResultsGetObjectId(), ResultsGetStored(), ResultsGetSwizzled(), ResultsIsValid(), ResultsLogicalToDisplay(), ResultsLogicalToOdbc(), ResultsNormalize(), ResultsOdbcToCollection(), ResultsSet(), ResultsSetObject(), ResultsSetObjectId()
property ResultsComplete as %Boolean;
Set to 1 by worker job when the main search is complete
Property methods: ResultsCompleteDisplayToLogical(), ResultsCompleteGet(), ResultsCompleteGetStored(), ResultsCompleteIsValid(), ResultsCompleteLogicalToDisplay(), ResultsCompleteNormalize(), ResultsCompleteSet()
property SelectMode as %Integer;
The SelectMode to use for the search
Property methods: SelectModeDisplayToLogical(), SelectModeGet(), SelectModeGetStored(), SelectModeIsValid(), SelectModeLogicalToDisplay(), SelectModeNormalize(), SelectModeSet()
property TopCount as %Integer (MINVAL = 0) [ InitialExpression = 0 ];
Max number of rows
If 0, get all rows
Property methods: TopCountDisplayToLogical(), TopCountGet(), TopCountGetStored(), TopCountIsValid(), TopCountLogicalToDisplay(), TopCountNormalize(), TopCountSet()

Methods

method %OnNew(criteria As %DynamicObject = {{}}, orderAsc As %Boolean = 0, topCount As %Integer = 1000, previewCount As %Integer = 0, selectMode As %Integer = $System.SQL.Util.GetOption("SelectMode")) as %Status
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

method Cancel(delete As %Boolean = 0) as %Status
Cancels the running search
method CancelResend() as %Status
Cancels the ongoing resends
classmethod CompileCriteria(criteria As %DynamicObject, orderAsc As %Boolean = 0, ByRef topCount As %Integer = 0, Output sql As %String, Output params As %Integer) as %Status
Converts the specified criteria into a SQL query sql and parameters params. Set orderAsc to true if the results should be in ascending order; descending otherwise. Specify topCount to generate a SQL query with TOP.
classmethod GetHistory(limit As %Integer = 0) as %DynamicArray
Gets the limit most recent searches if limit is greater than 0; gets all otherwise.
method GetResendResults(Output resendSc As %Status, Output results As %Integer) as %Boolean
Returns whether the resend is complete. If the resend is complete, resendSc will be set to the status returned by the resend worker, and results will be an array with the top-level node being the number of messages resent and sub-nodes with resent message IDs being the subscripts.
method GetResults(offset As %Integer = 0, limit As %Integer = 0, Output atEnd As %Boolean, Output sc As %Status) as %DynamicArray
Gets the query results after running a search. Set offset to a positive integer if that number of rows should be skipped. Set limit to a positive integer to set a maximum number of rows to return. atEnd will be set to 1 if the end of the result set has been reached. If no rows are returned and atEnd is set to 0, the query is still running. If no rows are returned while atEnd is set to 1, the query is complete and the result set has 0 rows.
method ResendAsync(resubmit As %Boolean = 0, headOfQueue As %Boolean = 0, limit As %Integer = 0, continue As %Boolean = 0) as %Status
Resends all the messages in the search results asynchronously, if the search is complete. Set limit to a positive integer to limit the maximum number of messages to resend. Set continue to 1 to start resending from where left off, if a resend was previously cancelled.
method Run() as %Status
Kicks off the search that will run async
classmethod runSearch(searchId As %Integer, sql As %String, ByRef params As %Integer = 0, selectMode As %Integer = 0, preview As %Boolean = 0) as %Status
Work unit run in Work Queue

Indexes

index (IDKEY on ) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()
index (UsrIdx on Username);
Index methods: UsrIdxExists()

Inherited Members

Inherited Properties

Inherited Methods

Storage

Storage Model: Storage (Ens.Message.Search)

^Ens.Message.SearchD(ID,"Criteria")
=
Criteria

Storage Model: Storage (Ens.Message.Search)

^Ens.Message.SearchD(ID,"Results",n)
=
Results(n)

Storage Model: Storage (Ens.Message.Search)

^Ens.Message.SearchD(ID)
=
%%CLASSNAME
TopCount
OrderAsc
SelectMode
WorkQueueToken
ResultsComplete
ResultColumns
LastRunTime
ResendWorkQueueToken
ResendCount
PreviewCount
Username
FeedbackOpens in a new tab