· Jun 10, 2022

Do messages created within objectscript processes get picked up by production purges.

Hi all.

I have a transform that I am calling from within an objectscript process, and I need to pass it a few values. I have in the past done this using the aux property, however I have got away with only needing to pass in a single value, so I have not had to worry about passing in anything other than a string container.

My initial thoughts were to create a custom message class with the properties I require and then pass this in as the aux value to the Transform, however I'm really unsure if this message class would then get picked up by my productions purges and I'd like to avoid filling up my environment with millions of messages I'm using to just pass 5-6 values to a transform.

Is it as simple as extending Ens.Request, or do I need to add an OnDelete Method? If the latter, any examples of how these are written are much appreciated.

Product version: IRIS 2019.1
Discussion (2)1
Log in or sign up to continue

DTLs work in-proc rather than in-queue so you can avoid the creation of new messages altogether.

To be specific let's say you have a DTL:

<transform sourceClass='Ens.StringRequest' targetClass='Ens.StringResponse' create='new' language='objectscript' >
<assign value='source.StringValue' property='target.StringValue' action='set' />

It would be compiled into this (simplified for clarity):

Transform(source,target,aux="") {
	Set (tSC,tSCTrans,tSCGet)=1
	Set target = ##class(Ens.StringResponse).%New()
	Do:$S($D(%Ensemble("DoTrace")):%Ensemble("DoTrace"),1:##class(Ens.Util.Trace).DoTrace()) ##class(Ens.Util.Trace).WriteTrace("xform",$classname(),"Transform","transform from source "_source_$S(source.%Extends("%Persistent"):"/"_source.%Id(),1:"")_" to target "_target_$S(target.%Extends("%Persistent"):"/"_target.%Id(),1:"")_"")
	Try { Set zVALz=source.StringValue, zVALz=$S($IsObject(zVALz):zVALz.%ConstructClone(), 1:zVALz) }
	Catch ex { If (..#IGNOREMISSINGSOURCE&&($$GetOneStatusText^%apiOBJ(ex.AsStatus())["<INVALID OREF>")) { Set tIgnore=1 } Else { Set tSC=ex.AsStatus() } }
	If 'tIgnore { Set target.StringValue=zVALz }

As you see the only new message is response and request/aux are not saved anywhere.

The same holds true for BPL invocations. Assuming this process:

<process language='objectscript' request='Ens.StringRequest' response='Ens.StringResponse' height='2000' width='2000' >
<sequence xend='200' yend='350' >
<transform name='dtl' class='dtl.dtl' source='request' target='response' xpos='200' ypos='250' />

You'll have this S method:

Method S1(process As Ens.BusinessProcess, context As Ens.BP.Context, synctimedout As %Boolean, syncresponses As %ArrayOfObjects(ELEMENTTYPE="%Library.Persistent"), request As %Library.Persistent, response As %Library.Persistent) As %Status [ Language = objectscript, PublicList = (process, context) ]
 Set $ZT="Trap",status=$$$OK do {
 Set iscTemp=$G(response)
 Set status=$classmethod("dtl.dtl","Transform",request,.iscTemp,"")
 If $$$ISERR(status) Quit
 Set response=iscTemp
 Do process.ClearAllPendingResponses()
 Set ..%NextState="Stop"
 } while (0)
Exit Quit ..ManageState(status)
Trap Set $ZT="",status=..ManageStatus(status,"S1") Goto Exit

which does nothing except for calling a Transform method. No queueing is used throughout DTL usage.

So, there are several options.

1. Do not create a new message, but rather pass your existing message. DTLs do not modify source or aux messages.

2. Use a registered, rather than a persistent class to pass values - in that case it won't be saved at all.