Skip to main content


persistent class HS.HC.Util.Installer.Upgrade.BackgroundItem extends %Library.Persistent

SQL Table Name: HS_HC_Util_Installer_Upgrade.BackgroundItem

Persistent class stored specifically in HSSYS. Allows classmethods to be run in the background during normal system operation. Useful for long-running conversions/re-indexing etc that can run while system is up. For upgrade steps simply using the AddItem() api method can be sufficient as the queued BackgroundItem will be run from the OnSystemStartup() code that gets called immediately after upgrade steps are finished. For ClassMethods that are intended to be called as BackgroundItems ensure their first and only argument is like 'ClassMethod SomeConversion(ByRef pBackgroundItem As HS.HC.Util.Installer.Upgrade.BackgroundItem)' This pattern is intended to allow the method invoked by the BackgroundItem to make use of it's 'State' property to keep track of where it is, in case it needs to be resumed after interruption and you want it to pick up where it left off.

Property Inventory

Method Inventory


parameter DOMAIN = HS;


property ClassName as %String [ Required ];
Property methods: ClassNameDisplayToLogical(), ClassNameGet(), ClassNameGetStored(), ClassNameIsValid(), ClassNameLogicalToDisplay(), ClassNameLogicalToOdbc(), ClassNameNormalize(), ClassNameSet()
property MethodName as %String [ Required ];
Property methods: MethodNameDisplayToLogical(), MethodNameGet(), MethodNameGetStored(), MethodNameIsValid(), MethodNameLogicalToDisplay(), MethodNameLogicalToOdbc(), MethodNameNormalize(), MethodNameSet()
property Namespace as %String [ Required ];
Property methods: NamespaceDisplayToLogical(), NamespaceGet(), NamespaceGetStored(), NamespaceIsValid(), NamespaceLogicalToDisplay(), NamespaceLogicalToOdbc(), NamespaceNormalize(), NamespaceSet()
property Started as %Boolean [ InitialExpression = 0 ];
Property methods: StartedDisplayToLogical(), StartedGet(), StartedGetStored(), StartedIsValid(), StartedLogicalToDisplay(), StartedNormalize(), StartedSet()
property State as %DynamicObject;
Property methods: StateGet(), StateGetObject(), StateGetObjectId(), StateGetStored(), StateGetSwizzled(), StateIsValid(), StateNewObject(), StateSet(), StateSetObject(), StateSetObjectId(), StateUnSwizzle()


classmethod AddItem(pNamespace As %String, pClass As %String, pMethod As %String, ByRef pAdded As %Boolean = 0, pState As %DynamicObject = {{}}) as HS.HC.Util.Installer.Upgrade.BackgroundItem
@API Method to add a Background Job item Attempts to get a lock on the object and returns it to the caller if successful Added BackgroundItems() will be run next system startup via RunAll() in FIFO order
final classmethod IsLIB(pClassName As %String, pNamespace As %String, ByRef pStatus As %Status) as %Boolean
Checks if pClassName is defined in a HealthShare library database
classmethod RemoveItem(pNamespace As %String, pClass As %String, pMethod As %String) as %Boolean
@API Method to remove a Background Job item
classmethod RunAll()
@API Iterates over all Background Job items in the table and runs them in FIFO order.


index (IDKEY on ) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()
index (ItemIndex on Namespace,ClassName,MethodName) [Unique];
Index methods: ItemIndexCheck(), ItemIndexCheckUnique(), ItemIndexDelete(), ItemIndexExists(), ItemIndexOpen(), ItemIndexSQLCheckUnique(), ItemIndexSQLExists(), ItemIndexSQLFindPKeyByConstraint(), ItemIndexSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods


Storage Model: Storage (HS.HC.Util.Installer.Upgrade.BackgroundItem)


Storage Model: Storage (HS.HC.Util.Installer.Upgrade.BackgroundItem)

FeedbackOpens in a new tab