go to post Tommy Heyding · Aug 5, 2024 Hi, you can use this method to convert an ObjectScript $LIST to a Python list. I'm not sure if this works with %DynamicArray. If not you could try to convert the %DynamicArray to a $LIST first. set plist = ##class(%SYS.Python).ToList(clist) https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
go to post Tommy Heyding · Jul 10, 2024 Hi Guillaume, thank you for the post and the straightforward recommendations. I have been using embedded Python for a while and have found that the hybrid between ObjectScript and python code is not always easy to maintain and refactor.That's why I have now consistently outsourced the python code to .py files and imported my modules via ##class(%SYS.Python).Import("mymodule") after reading your post. So far I'm very happy with how things are going, except I've had problems when applying the pythonic naming conventions for method names. def validate_header(): caused errors when I tried to call it this way: $$$ThrowOnError(mymodule.validate_header()) I had to rename the method to def validateHeader(): which isn't particularly bad, but I thought I'd mention it here in case anyone is stuck in a similar situation
go to post Tommy Heyding · Jun 5, 2024 And here is the code if you are using a Installer manifest 😉 Helps us while working with containers. <Namespace Name="${NamespaceSub}" Code="${NamespaceSub}_CODE" Data="${NamespaceSub}_DATA" Create="yes" Ensemble="1"> ... <Invoke Class="HBT.Util.WebApp" Method="DisableNewRuleEditor" CheckStatus="1"></Invoke> </Namespace> Class HBT.Util.WebApp { ClassMethod DisableNewRuleEditor() As %Status { #Dim tSC As %Status #Dim tSE As %Exception.StatusException Try { Zn "%SYS" &SQL(UPDATE Security.Applications SET Enabled = 0 WHERE ID = '/ui/interop/rule-editor') Set tSC = $$$OK } Catch tSE { Set tSC = tSE.AsStatus() Quit } Quit tSC } }
go to post Tommy Heyding · Jan 16, 2023 You can use your transformations within a Message Router (= Business Process). You need to define a rule set for this router and within this rule set you can add "send" actions with a "transform" property which will point to your transformation. Some old documentation, but it should describe how it works: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...
go to post Tommy Heyding · Jul 5, 2022 Hi Eduard, thanks a lot for the explanation. I just started to learn how the SDK for Python works and maybe you can help me with the following question. I'm trying to access my Production Object via the Class Method "ProductionItems" to store a list of the items: https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic.... According to the docs the method requires two Output arguments that I would pass by reference using ObjectScript. How can I do this within python? Thanks, Tommy