Many ways to do it, my way:
USER>Set input=25
USER>Set ln=10
USER>Set $Piece(Pad,"0",ln-$Length(input))="0"
USER>Set Padded=Pad_input
USER>Write
Pad="00000000"
Padded="0000000025"
input=25
ln=10- Log in to post comments
Many ways to do it, my way:
USER>Set input=25
USER>Set ln=10
USER>Set $Piece(Pad,"0",ln-$Length(input))="0"
USER>Set Padded=Pad_input
USER>Write
Pad="00000000"
Padded="0000000025"
input=25
ln=10What platform? Windows? Linux, what distro?
Instead of using array use list, possibly with XMLPROJECTION = "ELEMENT", something like:
Property Slide As list Of Q.Interface.Fragment.IMS.Slide(XMLPROJECTION = "ELEMENT");
This way you get what you need.
I've never done it but it should work, the correct syntax is MSH:4, not MSH-4.
We are not InterSystems support team, we are a Developer Community. 😊
You can download it from WRC (Worldwide Response Center) portal, the official InterSystems Support.
If your system is under support/maintenance you should have access to it.
If you your system is not covered by support/maintenance, you are not entitled to updates.
For testing purpose you may use/download IRIS Community Edition.
Following your enthusiasm I implemented a little test 😁
Class Community.Array.Base Extends (%RegisteredObject, %XML.Adaptor, %JSON.Adaptor)
{
Property Slide As list Of Community.Array.Slide(XMLPROJECTION = "ELEMENT");ClassMethod test()
{
Set Base=##class(Community.Array.Base).%New()
For i=1:1:3 {
Set Slide=##class(Community.Array.Slide).%New()
Set Slide.Name="Name"_i
Do Base.Slide.Insert(Slide)
}
Do Base.XMLExport(,",indent")
Write !,"JSON: ",!
Do Base.%JSONExport()
}
}
Class Community.Array.Slide Extends (%RegisteredObject, %XML.Adaptor, %JSON.Adaptor)
{
Property Name As%String;
}The output is:
USER>Do ##class(Community.Array.Base).test()
<Base>
<Slide>
<Name>Name1</Name>
</Slide>
<Slide>
<Name>Name2</Name>
</Slide>
<Slide>
<Name>Name3</Name>
</Slide>
</Base>
JSON:
{"Slide":[{"Name":"Name1"},{"Name":"Name2"},{"Name":"Name3"}]}
Is this what you need?
Hi John,
for JSON the correct property parameter is %JSONFIELDNAME, documented here.
Adding %JSONFIELDNAME = "TheName" to the Name property in my sample above, the JSON result is:
{"Slide":[{"TheName":"Name1"},{"TheName":"Name2"},{"TheName":"Name3"}]}
Where are you seeing "DTL response = <ID scope='Message'>3</ID>"?
What you see is the "representation", the "export" of your XML enabled class rendered by...whatever you are using to view/display it, the quotes are not part of the content.
How are you using/consuming your target (DTL response)? Some XML (SOAP? REST?) message? If so, I believe that you won't find single quotes when you will use it.
This is just guessing, because you don't provide any context/detail.
Can you provide more details?
It seems you are using an FTP Outbound adapter, but EnsLib.FTP.OutboundAdapter does not have a property/setting called "Filename".
General answer would be: set the Filename property in you Business Operation code, there you can set it to whatever value you need.
Ciao Marco,
it's difficult, virtually impossible, to tell where the problem is since your class A2Lib.FHIR.v400.Bundle is not part of IRIS.
If you cannot share your class, try to reproduce the problem in a smaller scale/class/xml and post it here.
You may start checking this previous post:
Unable to store (or rather retrieve) OREF in globals - Trying to create a Singleton Class.
This is the expected behavior as documented in Message Contents
Management Portal displays only the first 20000 characters of the message by default, this can be changed as documented in Changing the Character Limit for XML Messages in the Contents Tab
So, in your case for only EnsLib.HTTP.GenericMessage you can:
Set ^EnsPortal.Settings("All","MessageContents","OutputSizeLimit","EnsLib.HTTP.GenericMessage")=<whatever size you feel appropriate>
or for any class:
Set ^EnsPortal.Settings("All","MessageContents","OutputSizeLimit")=<whatever size you feel appropriate>
To send JSON with an HTTP POST request using InterSystems ObjectScript, you can use the %Net.HttpRequest class. Here is a sample code snippet demonstrating how to do this:
Create an HTTP request object.
Set the server URL and other necessary properties.
Write the JSON payload to the request’s entity body.
Send the POST request.
Here is an example:
Set Body={}
Set Body.Name="John Smith"Set Body.Address="ISC Dev community"Set Body.SomeProperty="Some content"Set Request = ##class(%Net.HttpRequest).%New()
Set Request.Server = "server"Set Request.Location = "location"Set Request.ContentType = "application/json"// Convert the object to JSON and write it to the request's entity bodyDo Body.%ToJSON(Request.EntityBody)
// Send the POST requestSet Status = Request.Post()In your production class you can implement the OnConfigChange() method.
From Class Reference:
This method is called when config changes to the Production or any item are saved from the portal
You need to check the Storage defined in your class, typically automatically generated when the class is first compiled.
For example I have created a ConfigUtils.ConfigSettingsTable class:
Class ConfigUtils.ConfigSettingsTable Extends%Persistent
{
Property Name As%String;
Storage Default
{
<Data name="ConfigSettingsTableDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Name</Value>
</Value>
</Data>
<DataLocation>^ConfigUtils.ConfigSetti1ADBD</DataLocation>
<DefaultData>ConfigSettingsTableDefaultData</DefaultData>
<IdLocation>^ConfigUtils.ConfigSetti1ADBD</IdLocation>
<IndexLocation>^ConfigUtils.ConfigSetti1ADBI</IndexLocation>
<StreamLocation>^ConfigUtils.ConfigSetti1ADBS</StreamLocation>
<Type>%Storage.Persistent</Type>
}
}
In this case the globals used by my class are:
^ConfigUtils.ConfigSetti1ADBD (Data)
^ConfigUtils.ConfigSetti1ADBI (Indices)
^ConfigUtils.ConfigSetti1ADBS (Streams)
Instead of the 3 single globals, you can map ^ConfigUtils.ConfigSetti1ADB*
Note that you MUST check the actual global(s) name(s) used by your class.
If your class extends another persistent class, then the storage is defined in the superclass that define the extent (the first persistent class in class hierarchy).
Note that, if needed, you can map your classes and global for ALL namespaces currently defined and defined in the future, please check Mapping to All Namespaces documentation on how to use %ALL namespace mapping.
What we are seeing is that IRIS.WorkQueue globals are being defined for these calls but then the IRIS.WorkQueue is not being cleaned up and taking up large amounts of Memory.
You mention IRIS.WorkQueue globals consuming/using memory, but globals don't consume memory, they reside on disk.
I never seen any IRIS.WorkQueue globals, can you provide some detail?
What component is creating/using these globals?
Is your issue with memory (RAM) or disk usage?
I (and not only me) don't consider it "best practice" but sometime is necessary and I admit I have done it a few times.
You can definitely call another BO from a BO, the only limitation is that you can only make a sync call.
Just use ..SendRequestSync() method, same as you would do in a BP.
VSCode with ObjectScript - tried to run simple MUMPS code and says not supported
Can you provide more details on what and how you tried? It should work, in fact, it does work!
True, only if you don't need/want a response from the called BO.
In these situations what I use is:
If ##class(Ens.Job).ShouldBeQuiescent() || ##class(Ens.Job).ShouldTerminate() {
; close shop!
Quit
}
The reason why it happen is explained in the Indirection (@) documentation:
Important:
All variables referenced in the substitution value are public variables, even when used in a procedure.
So, I'd write your method something like:
ClassMethod test() [ PublicList = arg ]
{
new arg
s arg = "asd"
s routine = "say^hello(arg)"
do @routine
}
From the other old post:
Characters with accents are encoded with two characters in Unicode while it's only one character in Latin1.
Unicode IRIS:
USER>w $zv
IRIS for Windows (x86-64) 2024.2 (Build 247U) Tue Jul 16 2024 09:52:30 EDT
USER>w $l("è")
1
USER>w $a("è")
232
USER>
232 is 0xE8, it correspond to è in both latin1 and Unicode.
Do not confuse Unicode with utf-8.
I miss how you are going to compare the two base64 json properties.
If you assume that the stream AND the base64 converted stream sizes are less than maximum string length, then I miss the point of converting to base64.
This works only if you assume that the stream size is less than the maximum string length.
Have you tried to leave the ResponseClass setting empty?
To check if MyVal is a valid positive number I'd use $ISVALIDNUM(MyVal,,0)
Can you please provide some details on what you are actually doing in your DTL?
I really don't think that an addon package is the solution.
I access, more or less regularly, around 20 IRIS different systems used by various customers and a number of local instances in my machines and VMs.
Do you really think that installing an add on package in all this systems is a "solution"?