Code must be executed in the Business Operation process, I can't offload it to another process.
- Log in to post comments
Code must be executed in the Business Operation process, I can't offload it to another process.
Looks like, that you have some data generated, which you should care about, but with some delay.
Yes.
how about creating some custom adaptor,
How would this adapter be triggered every X seconds?
Alternatively, you could create a function that writes the alerts to an internal table, and then poll that table every x minutes to generate a single detailed alert message?
Sounds promising. I don't know - just wanted to use alerts as that seemed like a tool for a job but maybe a custom solution would be better.
Welcome back, Sean!
What do you want your $list to look like?
If you want the end result to be like this:
$lb("das", "is", "wp", "dsa", "nmk")try this code (assumes dir is shorter that 3 641 144 chars):
ClassMethod test(dir = "test.txt")
{
set file = ##class(%Stream.FileCharacter).%New()
set file.LineTerminator = $c(1)
do file.LinkToFile(dir)
set str = file.Read($$$MaxStringLength)
kill file
set separator = $c(13,10)
do {
set newstr = str
set str = $replace(str, separator _ separator, separator)
} while newstr'=str
set:$e(str, 1, $l(separator))=separator str=$e(str, 1 + $l(separator), *)
set:$e(str, *-$l(separator)+1, *)=separator str=$e(str, 1, *-$l(separator))
set list = $lfs(str, separator)
quit list
}This is a naive implementation assuming you don't care about the speed.
Faster solution would go through file line by line.
Thanks for your question -- we will communicate with you via DM.
You have to include a slash before EmergencyId :
It depends on OS. In Linux there's no slash. Windows is with slash.
You need to:
After that you'll be able to start your new production.
There are two parts to it.
1. Create a trigger after INSERT/UPDATE/DELETE. Triggers can work for both sql and object access:
Trigger NewTrigger1 [ Event = INSERT/UPDATE/DELETE, Foreach = row/object, Language = objectscript, Time = AFTER ]
{
set ^dbg={fieldname*N}
}2. In the trigger code send an SMS. You can either use an API (a lot of them available) or talk to a GSM modem.
First you need to create corresponding classed. You can do that by either importing the XSD or manually.
Here's a manual approach:
Class test.mensajeWS Extends (%RegisteredObject, %XML.Adaptor) {
Parameter NAMESPACE = "https://wslexnet.webservices.lexnet/3.22";
Property respuestaEnvioMensaje As respuestaEnvioMensaje;
}
Class test.respuestaEnvioMensaje Extends (%RegisteredObject, %XML.Adaptor) {
Property idEnvio As %Integer;
Property tamBloque As %Integer;
Property bytesMIME As %VarString;
}After that in your BS convert incoming XML string like this:
set reader = ##class(%XML.Reader).%New()
set sc = reader.OpenString(pRequest.EnviarIniciadoresGeneralOut)
quit:$$$ISERR(sc) sc
do reader.Correlate("mensajeWS","test.mensajeWS")
do reader.Next(.mensajeWSObj,.sc)
quit:$$$ISERR(sc) sc
// Process mensajeWSObjGreat article.
Some comments on formatting:
button.On the article itself my only issue is you create 5 methods per class:
That's a lot of code even for 4 classes, but what about a case where there are 10 classes? 50? 100? Generally I would recommend writing 5 methods which would process objects of any allowed class (see RESTForms2).
I think the preferred way is to use $SYSTEM.OBJ.Export (or even better - VCS) instead of direct global manipulation to export code.
Set in the BP/BPL classes:
Parameter SKIPMESSAGEHISTORY = 1;it would improve journaling.
Update to a more recent version.
The BP (and the entire production) is down for the entire modification/compilation/update.
The issue is that for existing instances ResponseHandlers should be updated after BP compilation to point to the new values.
For the case where only a new OnResponse method is added the workaround is executing these update queries:
UPDATE process.Context__ResponseHandlers
SET "_ResponseHandlers" = 'OnResponseXYZ'
WHERE "_ResponseHandlers" = 'OnResponseABC'Where ABC is an old method name, XYZ is a new method name.
In a case of several new methods they should be executed from the largest number first.
Process-wide call:
do DISABLE^%NOJRNDo you have a Swagger? If so you can generate a client using Open API Client Gen community project by @Lorenzo.Scalese.
Unable to reproduce. Here's my test routine:
ByRef
kill a
set a = 1
set a(1) = 2
do Test(.a)
zw a
Test(a)
set a(1) = a(1) + 1
set a(2) = -1And here's an invocation result:
>d ^ByRef
a=1
a(1)=3
a(2)=-1as you can see a new subscript has been added successfully.
ByRef is flavor text.
Change httpd.conf in <iris>\httpd\conf and restart iris (or at least the web server).
Are you using Apache2 (private web server is Apache2)?
What's your AllowEncodedSlashes value?
You need both AllowEncodedSlashes = true and encoding the parameter for this to work.
Datatype classes are used to define object properties, they allow to:
Docs.
RESTForms, duh.
Here's an example:
Class User.Assert Extends Ens.BusinessProcess [ ClassType = persistent, Language = objectscript ]
{
Method OnRequest(pRequest As Ens.Request, Output pResponse As Ens.Response) As %Status
{
Set pResponse = ##class(Ens.Response).%New()
$$$LOGINFO("$$$ASSERT(1)")
$$$ASSERT(1) // skipped
$$$LOGINFO("$$$LOGASSERT(1)")
$$$LOGASSERT(1)
$$$LOGINFO("$$$ASSERT(0)")
$$$ASSERT(0)
$$$LOGINFO("$$$LOGASSERT(0)")
$$$LOGASSERT(0)
Quit $$$OK
}
}This looks more like a WRC issue, but I'd wager a guess that the first and second query use different indices.
To be more specific the second query does not use some index due to the need to traverse all RPE.Veterinario rows due to the vet.numConselho > 0 condition.
To solve this issue try to rebuild all indices for these 3 tables.
Add:
set request.FollowRedirect = $$$YESbefore sending a GET request.