go to post Enrico Parisi · Jan 10 To my knowledge there is no Action to log an entry in the Interoperability Event Log, but it can be achieved using a custom function. What you can do is implementing a function as documented in Defining Custom Utility Functions. Something like: Class MyPackage.CustomFunctions Extends Ens.Rule.FunctionSet { /// Log an INFO type message in the Iteroperability Event Log ClassMethod LogInfo(Message as %String) As %String { $$$LOGINFO(Message) Quit Message } } Then in your Rule add a Debug action that call/use the function: Then, in the Business Process where the Rule is used, add the "d" flag to the RuleLogging settings: Thisway you will have your message logged in the event log AND in the rule log.
go to post Enrico Parisi · Jan 8 As I suspected, in the DownloadFiles method the variable "fileName" is not (yet) defined when you use it.In addition, in your catch method you have a Write command that "Write" invalid javascript code. I'd suggest to change the catch code with: } Catch ex { Set sc = ex.AsStatus() &js<..QuoteJS("Exception: "_ex.DisplayString());>} This way if an objectscript error you get an alert with the error details. Then, change all reference to the "fileName" variable and use "fileList" instead before the line: For i=1:1:$LISTLENGTH(fileArray) This prevents <UNDEFINED> errors when referencing "fileName" variable.
go to post Enrico Parisi · Jan 8 IMO a better option would be to create a subclass of %Net.SMTP and copy and modify the GetResponse() method code uncommenting that line. Then use this class instead of %Net.SMTP. This way you don't need "to mess" system classes, change system database configuration (RW in IRISLIB) and then you have full control of the code. Something like: Class My.Net.SMTP Extends %Net.SMTP { /// Get response to mail command. Use timeout as specified by RFC1123. Method GetResponse(timeout As %Integer, ByRef responseArray As %String) As %String [ Internal, Private ] { #define SMTPTRACE #ifdef SMTPTRACE #define TraceInit try { kill ^SmtpTrace } catch { set killsave=$zu(68,28,0) kill ^SmtpTrace do $zu(68,28,killsave) } #define TraceNext(%line) set ^SmtpTrace($increment(^SmtpTrace))=%line_"<<"_$zb #else #define TraceInit #define TraceNext(%line) #endif #define WriteText(%text) $$$TraceNext(">>"_%text) write %text #define WriteLine(%text) $$$WriteText(%text),! kill responseArray set line="" do { read line:timeout else do ..SetStatus($$$ERROR($$$SMTPTimeout)) set line="" set responseArray($increment(responseArray))=line $$$TraceNext(line) } while $extract(line,4)="-" quit line } }
go to post Enrico Parisi · Jan 8 Hi Dan, it seems you have a javascript syntax error, in the code you posted previusly, are you sure the variable fileName is defined? Can you share the relevant code in the DownloadFiles() method?
go to post Enrico Parisi · Jan 7 Very difficult to tell with the little info provided! It seems the error somewhere in in the network I/O between IRIS and xDBC client. Where do you get this error from?Can the error be reproduced? If yes, how?
go to post Enrico Parisi · Jan 6 As @Chandrasekar Angaiah pointed out you need to create a new class that extends EnsLib.SQL.InboundAdapter and then you use the new class instead of EnsLib.SQL.InboundAdapter. Within that new class override OnInit(), something like: Class My.SQL.InboundAdapter Extends EnsLib.SQL.InboundAdapter { Method OnInit() As %Status { Set sc=##super() If $$$ISOK(sc) Set ..%Row.MaxRowsToGet=-1 Quit sc } }
go to post Enrico Parisi · Jan 5 Ciao Fabrizio, access to the HealthShare Management portal section (also known as HS Navigation app) can be granted using the %HSAdmin_NavAppConfigurationManagement resource or the %HS_NavigationApp role. Once your user has that role or resource it can access the HS Navigation app page. Within that page there are many"functionality" and they have their own permissions/resources associated that the user must have to perform the functionality. So, with only access to HS Navigation app (and no other role/resource) you see an empty page. It's not clear what functionality you need/want to enable and if you need read/write permissions. Long story short, I suggest to create a new role, during creation copy from %HS_Administrator role and then remove resources you don't need (there maybe many you don't need/want) and the modify R/W permissions for the resource.
go to post Enrico Parisi · Jan 5 Ciao Fabrizio, in your machine edit the hosts file and add the FQDN of your HS server so it can be resolved and then use the FQDN in the browser instead of the IP address.
go to post Enrico Parisi · Jan 3 Remember, what you write in/from that method is javascript. I think the simplest solution for debugging is using javascript alert(), another option can be injecting your debug info into page html/dom using javascript (this depend on page structure).For simple alert() you can: Set sc = sftp.Get(remoteFile, localFile, "0666") If $$$ISERR(sc) { &js< alert(#(..QuoteJS("Error downloading file: "_fileName_" -> "_$system.Status.GetErrorText(sc)))#);> } else { &js< alert(#(..QuoteJS("File Successfully Downloaded"_fileName))#);> }
go to post Enrico Parisi · Jan 3 Does the DownloadFiles() method has any Write command, possibly with the string "downloading"? ( as in SyntaxError: Unexpected identifier 'downloading') My guess is that you have such a Write command that is interpreted/executed as Javascript.....hence the error.
go to post Enrico Parisi · Jan 3 Hi @Andreas Schneider, you can create a SQLGateway connection using ObjectScript code, if you create it using SQL then, as you discovered, you have an issue with the password because using ObjectScript the password is "processed" before saving it. If you want/need a pure SQL solution without (directly) coding/using ObjectScript you can define and use a Stored Procedure (that use ObjectScript 😉) to change the password, something like: CREATE PROCEDURE Community_SqlGw.SetPassword(ConnectionName VARCHAR(50), NewPassword VARCHAR(50)) RETURNS BIT LANGUAGE OBJECTSCRIPT { New gw,sc Set gw=##class(%SQLConnection).NameIndexOpen(ConnectionName) If gw="" Quit 0 Set gw.pwd=NewPassword Set sc=gw.%Save() Quit (sc=1) } Then, after creating the GW Connection, change the password: select Community_SqlGw.SetPassword('MyGwConnectionName','MyGwPassword')
go to post Enrico Parisi · Dec 30, 2024 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)
go to post Enrico Parisi · Dec 30, 2024 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 propertiesA 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 methodsThis 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 classDefault 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.
go to post Enrico Parisi · Dec 28, 2024 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.
go to post Enrico Parisi · Dec 21, 2024 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.
go to post Enrico Parisi · Dec 16, 2024 Out of curiosity, are these jobs listed form SQL using: call Ens.Job_Enumerate() and/or: all Ens_Util.Statistics_EnumerateJobStatus('<YourBpNameHere>')
go to post Enrico Parisi · Dec 13, 2024 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'="")
go to post Enrico Parisi · Dec 12, 2024 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.