Do you have ^EnsPortal("DisableInactivityTimeout","Portal")=1 in each namespace that's running a production? It's not mapped from another namespace.

Have you tried %K(Server) as the output format prefix?

HICG>set tm="20210401072630+0000"
HICG>w ##class(Ens.Util.FunctionSet).ConvertDateTime(tm,"%q%z","%K(Server)%q%z")
This of course assumes your server is in your locale/time zone.

This might get you closer to what you want, perhaps called from OnProcessMessage() in the service:

ClassMethod QueueGetOldest(pQueueName As %String, Output pStatus As %Status) As %String
    If ##class(Ens.Queue).GetCount(pQueueName) > 0
        Set tStmt = ##class(%SQL.Statement).%New()                                          
        set qSC = tStmt.%PrepareClassQuery("Ens.Queue","EnumerateItem")
        Set tRS = tStmt.%Execute(pQueueName,"")                        
        Do tRS.%Next()                                                
        Set tHdrid = tRS.%Get("MessageId")
        Set tMsghdr = ##class(Ens.MessageHeader).%OpenId(tHdrid)
        Set pStatus = $$$OK
        Return tMsghdr.TimeCreated
    Set pStatus = $$$ERROR($$$GeneralError,"Not found")
    Return ""

It returns the time created of the oldest entry in the queue, or the empty string if the queue is empty or doesn't exist.

You could create a variant that would accept a duration argument and return true/false if the duration between the current time and the time of the oldest entry exceeds that.

Hi Scott,

You can get the repetition count for a field with the GetValueAt() method:

Set tRepCount = msg.GetValueAt("OBX(3):5(*)")

You can then iterate over the repetitions in a FOR loop:

For tRep = 1:1:tRepCount
    If msg.GetValueAt("OBX(3):5("_tRep_")") = tMatchVal
        // Do stuff

You sure can. You can find the documentation for adding settings to business hosts here.

You'll need to install the CSP gateway component on the Apache server, but not IRIS itself.

As is 

USER> w $system.Util.InstallDirectory()_"lib"

There's also a LibPath entry in IRIS.cpf, but I'm not sure it's the same. But you can get it:

%SYS> do ##class(Config.config).Get(.props)
%SYS> write props("LibPath")

Unfortunately on the IRIS server I'm working with it's empty ...

Here's a method that, once created and compiled, will appear in your dropdown list of functions in the rule editor:

Class User.Util.DateTime Extends Ens.Rule.FunctionSet

ClassMethod DaysPrior(pDays As %Integer) As %String
    Return $ZDATE($H - pDays,8)


You'd use it in your rule like this:

Caveat: The birthdate is assumed to be valid and 8 characters in length. If there's a possibility that you would get an invalid or missing date, the ">" comparison will not be valid.

GetAdapterSettingValue() may give you what you want. The Type parameter isn't needed.

Set archiveFilePath=##class(Ens.Director).GetAdapterSettingValue("ReadPDFFileService","ArchivePath",.status)

There's a corresponding GetHostSettingValue() method for non-adapter settings that works similarly.

Both seem to supply the System Default Setting when the setting is unvalued in the production.