Enrico Parisi · Dec 30, 2024 go to post

In your sample code AltOrEmpty property contains a not null value of Mandatory property or $c(0), so:

set testInstance = ##class(TestIndex).AlternateMandatoryOpen(2,$c(0),.st)
Enrico Parisi · Dec 30, 2024 go to post

Hi @Evgeny Shvarov,

I fully agree with the answer above from @Herman Slagman so I won't repeat what he wrote.

You asked me:

Which of them is not useful/silly?

As already reported in my previous post in February in other tread, many rules contains errors, I don't think I should repost the same comments, so please have a look to my previous post for details of some of the errors in the rules. Please note that the errors I comment/report is not a complete list of all errors in the rules, just some random I had time and will to report, there are more than that.

As for the not useful/silly rules I gave you two additional examples on top of what @Herman Slagman already wrote. Again, there are more than this few reported.

Class has too many properties
A long property list can indicate that a new structure should be created to wrap the numerous properties or that the class is doing too many things.
Maximum allowed number of properties (inclusive)
Default Value: 10

A class with more than 10 properties is considered a Quality issue? Really?
Most of complex real life projects have classes with more, sometime much more, than 10 properties, simply because real life "things" are complex and often have many possible attributes.
Just as an example, there are so many classes among IRIS "system" classes (part of the various frameworks) that have much more than 10 properties and this for very good and valid reasons.

Class has too many methods
This rule checks that a given class has a number of methods which is less than, or equal to, a configurable threshold. A class with too many methods is often an indication that this class needs to be refactored into several, smaller classes.
Maximum number of methods allowed for a class
Default Value: 10

Same as in number of properties. Useless to repeat.

So, ObjectScript Quality tool has many rules with errors and some rule is....well....debatable.


I fully agree on your statement "It’s difficult to introduce rules that will satisfy everyone" and that's the very reason why in my previous post in other thread I avoided mentioning "debatable" rules and only reported errors in the rules. Now you asked, so I had to comment on that too.

The issues (plain errors) reported in February has never been fixed/considered, that's why me and @Herman Slagman said that nothing has changed since February.
This gives the impression that nobody cares of the quality and maintenance of ObjectScript Quality Tool.

As for the invite to develop our rules I'm sorry but I don't have time, knowledge and will to do so, my contribution was to report errors and, if anybody cares (so far it doesn't seem so) to fix them, I can report more errors and "debatable" rules.

My concern in your endorsement of ObjectScript Quality tool is that some new IRIS user may think this rules are valid good practice and guidelines for coding in ObjectScript when, in fact, many rules are not at all.

I'm not sure if "no tool is better than a bad tool" as Herman wrote, but the risk of misleading people is very high, I think that at least a disclaimer and warning to people looking at it is advisable.

Enrico Parisi · Dec 28, 2024 go to post

Hi @Herman Slagman, I totally agree with you, we have already discussed the issues and errors of "ObjectScript Quality Tool" rules in this post where I commented some of the errors in the ruses and there are indeed many more errors and, as you mentioned, some rule is debatable (or silly, as you said) to say the least.

Since that post and the errors I reported there nothing has changed, the rules are still there, wrong and unchanged.

What's the sense of having a "ObjectScript Quality Tool" with....such a poor quality itself?

To @Evgeny Shvarov, you say:

It’s difficult to introduce rules that will satisfy everyone.

Do you think that contradictory rules and rules with errors (plain errors) can satisfy anyone?!

what prevents you from introducing your own rules?

Time and probably I think it wouldn't be fun.

Let’s discuss....

We have started a discussion in the post linked above, I have reported some of the errors in the rules, nothing has been done/fixed. This gives the impression that "ObjectScript Quality Tool" is a dead project.
 

Enrico Parisi · Dec 21, 2024 go to post

Hi @Eduard Lebedyuk , I was testing various options for configuring Apache (RHEL in my case), so I read the documentation (unbelievable, isn't it? 😂) and performed a number of tests, the I found this article  in the community and....I was kind of surprised because you suggest using CSP On/Off within a <VirtualHost> directive block.

I was surprised because the I excluded using <VirtualHost> directive block since the documentation suggests not using it (emphasis mine):

Note:

Although the Web Gateway supports the use of virtual host names in application access profiles, issuing Apache configuration directives to invoke the Web Gateway (that is, CSPFileTypes and CSP On/Off) within a <VirtualHost> directive block is not supported and will yield an error. In other words, you cannot enable the Web Gateway for the desired Virtual Hosts alone; you must enable the Web Gateway within the web server’s global configuration.

My my first thought was, well, this is a case where the documentation is wrong, sometimes it has happened.

At that point I was puzzled, so I tried using <VirtualHost> and, to my surprise, it worked!

Then I tried to validate my Apache config using "apachectl configtest" and:

[root@localhost conf]# apachectl configtest
[Sat Dec 21 17:22:39.632408 2024] [:warn] [pid 151005:tid 151005] Apache Configuration: CSP directive 'csp' detected in VirtualHost, only supported at default server level
[Sat Dec 21 17:22:39.632471 2024] [:warn] [pid 151005:tid 151005] Apache Configuration: CSP directive 'csp' detected in VirtualHost, only supported at default server level
[Sat Dec 21 17:22:39.632480 2024] [:warn] [pid 151005:tid 151005] Apache Configuration: CSP directive 'csp' detected in VirtualHost, only supported at default server level
Syntax OK

Not only is documented that using CSP On/Off within a <VirtualHost>, there is also some code implemented in CSPa24.so IRIS module to check for this and provide a warning message that says this is not supported.

Personally I'll avoid using CSP On/Off within a <VirtualHost> (at least) in production systems, unless some more info is found on this.

Enrico Parisi · Dec 16, 2024 go to post

Out of curiosity, are these jobs listed form SQL using:

call Ens.Job_Enumerate()

and/or:

all Ens_Util.Statistics_EnumerateJobStatus('<YourBpNameHere>')

Enrico Parisi · Dec 13, 2024 go to post

Is return supposed to return a boolean (0/1) or the non empty value of check1?

I'm asking because you write "will return false even for non-empty strings (due to conversion to integers for string prefixes)".

In general to check for not empty string (check1'="") is used.

If you need to return a boolean depending of empty/not empty, then you can use:

return (check1'="") 

Enrico Parisi · Dec 12, 2024 go to post

If/when you set KeepIntegrity to True, then ALL messages and message headers belonging to a session containing ANY message with status Created or Queued or Delivered or Suspended or Deferred are NOT deleted/purged, same goes for the headers (Ens.MessageHeader).

Since your is a test environment, it's (very?) likely having "messed" sessions that are not purged using KeepIntegrity  = True.
Sometimes even production systems do have sessions that are not purged using KeepIntegrity  = True.

While setting using KeepIntegrity  = True is "best practice" and prevent purging "uncompleted sessions", I suggest to run a purge with KeepIntegrity  = False with a (much?) longer DaysToKeep parameter, unless you do need/want to keep uncompleted sessions and messages for.....ever and ever.

For example, if you purge with KeepIntegrity  = True and DaysToKeep=30, you may run a second purge with KeepIntegrity  = false and DaysToKeep=90 (or longer) to purge really old messages belonging to "uncompleted" sessions.

Enrico Parisi · Dec 12, 2024 go to post

When you purge that namespace with 30 day retention period, what value of "Purge only completed sessions" (was Keep Integrity in older versions) do you use?

Have you ever run the purge without including message bodies?

Enrico Parisi · Dec 11, 2024 go to post

CONNECTION is a class parameter, to search all class parameters named CONNECTION with a specific value:

select parent from %Dictionary.CompiledParameter
where name = 'CONNECTION' and _Default='<your connection value to search>'

Enrico Parisi · Dec 11, 2024 go to post

Code adapted with your details:

Set objHttpRequest = ##class(%Net.HttpRequest).%New()
Set objHttpRequest.ContentType = "application/fhir+json"Set objHttpRequest.Server = "localhost"Set objHttpRequest.Port = "52773"Set pRequest = {"asd":"asd"}
Do objHttpRequest.EntityBody.Write(pRequest.%ToJSON())
If objHttpRequest.Send("POST", "/aktest/test") {
    Set objHttpResponse = objHttpRequest.HttpResponse
    If$IsObject(objHttpResponse.Data) {
        Set objStream = objHttpResponse.Data
        Set json = ""While ('objStream.AtEnd) {
            Set json = json _ objStream.ReadLine()
        }
    } Else {
        Set json = objHttpResponse.Data
    }
    Set httpStatus = objHttpResponse.StatusCode
    Write"Status: ", httpStatus, !
    Write"Response: ", json, !
}
Enrico Parisi · Dec 11, 2024 go to post

I do not understand your question, can you please explain what you need to achieve?

%Net.HttpRequest class is used to create an HTTP request that is sent to the counterpart/endpoint and a response message is then received from the counterpart. How can you possibly generate a response that, by definition, has to be received from a remote system?

Clearly I'm missing something.

Enrico Parisi · Dec 10, 2024 go to post

You may try with:

set tQuery="{ CALL dbo.SavePatientDetails (?) }"Set tParams=1Set tParams(1)=xmlContent
Set tParams(1,"SqlType")=$$$SqlVarchar; or 12 if macro does not resolveSet tSC = ..Adapter.ExecuteProcedureParmArray(.tResultSnapshots, .tOutputParms, tQuery,,.tParams)

For details see the SQL adapters documentation on Using Parameters.
 

Enrico Parisi · Dec 10, 2024 go to post

Does it works if you use NVARCHAR(8000)?

My guess is that IRIS does not understand "MAX", if so...maybe there is a possible solution.

P.S.: what version of IRIS?

Enrico Parisi · Dec 9, 2024 go to post

the ExecuteUpdate method expects the parameters to be passed in as an array

Actually, no, it expects  parameters as single/literal values.

The method ExecuteUpdateParmArray() expects parameters to be passed in as an array

Enrico Parisi · Dec 6, 2024 go to post

I'm no expert on foreign tables, but maybe you can try:

select * from INFORMATION_SCHEMA.FOREIGN_TABLES

This should provide a list of defined foreign tables and the Foreign Server it uses.

I'm not sure how to get Foreign Server that have no tables defined.

Enrico Parisi · Dec 3, 2024 go to post

You can, this way:

Property Entry As list Of Entry(XMLPROJECTION = "ELEMENT");

Note that the tag is the name of the list property, not the list item.

Enrico Parisi · Dec 2, 2024 go to post

In your "SQL Gateway Connection" definition verify the configuration of "Do not use delimited identifiers by default"

Enrico Parisi · Dec 1, 2024 go to post

What platform (Operating System) are you using for IRIS?

I think NTLM authentication is not available in IRIS for Linux.

Enrico Parisi · Dec 1, 2024 go to post

To debug your issue I suggest to enable SOAP logging setting this two global node:

Set ^ISCSOAP("LogFile")="/path/to/yourlog/filename.log"
Set ^ISCSOAP("Log")="ios"

Values for ^ISCSOAP("Log") are:
"i" — Log inbound messages
"o" — Log outbound messages
"s" — Log security information.

Then call your SOAP service and check the log file for hints on the actual issue.

When finished debugging remember to turn it off with Set ^ISCSOAP("Log")="" or Kill ^ISCSOAP("Log")

In error handling code, when using SOAP and a <ZSOAP> error in triggered, the actual error status is contained in %objlasterror variable, so:

Set displayString = ex.DisplayString()
If displayString [ "<ZSOAP>" {
    Set displayString=$system.Status.GetErrorText(%objlasterror)
}

It's all documented, I cannot post documentation links because the documentation site it's not working for me at the moment.

Enrico Parisi · Nov 28, 2024 go to post

According to the documentation, it's not possible exporting an object.

Edit: however, as pointed out by @Herman Slagman in the next post, it's indeed possible, I'm going to provide feedback to documentation team.

You can manually create the XML document using %XML.Writer, like:

set writer=##class(%XML.Writer).%New()
	set writer.Indent=1set writer.NoXMLDeclaration=1set status=writer.OutputToDevice()
	set status=writer.StartDocument()
	set status=writer.RootElement("XMLTest")
	set status=writer.Element("Id")	
	set status=writer.WriteAttribute("Attribute","D1949EE1-7D03-4666-9548-D1A949E10327")
	set status=writer.EndElement()
	set status=writer.EndRootElement()
	set status=writer.EndDocument()

The output of the above code is:

<XMLTest><IdAttribute="D1949EE1-7D03-4666-9548-D1A949E10327"/></XMLTest>

Having said that, what's your issue with the closing tag? Semantically there is no difference, any system should be able to handle both cases (with or without closing tag).

Enrico Parisi · Nov 28, 2024 go to post

My guess is that your %var local variable array is in conflict with the code executed by the embedded sql.

As you may know % local variables have global scope, therefore should be used with caution, particularly when calling "other code", like embedded sql in your case.

If a global scope % variable is needed, is advisable to follow the documentation on Local Variable Naming Convention:

Variable names starting with the % character are known as “percent variables” and have different scoping rules. In your code, for a local percent variable, start the name with %Z or %z; other names are reserved for system use.

I suggest to change your variable to %zvar or similar, if you do not need global scoping, remove the leading %.

Enrico Parisi · Nov 21, 2024 go to post

The time Veeam create a snapshot should be measured in seconds, not minutes!

If your server does not use/need any application guest processing (Oracle etc.), then in Veeam you can be disabled in "Application-Aware Processing Options" in the Backup Job configuration for your Suse IRIS server , "Disable application processing":

As @Timo Lindenschmid pointed out, you may consider backing up the secondary server.

In case you want to backup the primary, make sure to set mirror QoS appropriately.

Enrico Parisi · Nov 21, 2024 go to post

Ciao Pietro,

difficult to tell without looking at the code.

Looking at the response my guess (bet?😉) is that your code  has some error processing and if "somewhere" an error status is returned, then the error processing is triggered and is returning the response you see, including headers etc.

Enrico Parisi · Nov 20, 2024 go to post

In the documentation site (every page?) there is a "Feedback" blue button on the right of the page, click on it...

Enrico Parisi · Nov 15, 2024 go to post

Julian is correct, your code is inserting line breaks, remove the lines:

If 'pInput.AtEnd {
        Set tSC = tStream.Write($C(10))
        $$$TRACE("Adding terminator.")
    }