Hi @Scott Roth 

The /api/mgmnt endpoint was previously used to retrieve OpenAPI 2.0 (Swagger) information for the web application. Therefore, if the web application class (%CSP.REST) is created using the traditional approach (manually created), use.

/api/mgmnt/v1/:namespace/spec/TableLookup

to get the openapi 2.0 information.

Get all  REST apps

 /api/mgmnt/v1/:namespace/restapps 

Hi @Evgeny Shvarov 

Class queries (%SQLQuery) are designed specifically for SELECT operations (retrieving data) rather than for data modification (INSERT, UPDATE, DELETE). This is because the class compiler translates the query definition into ObjectScript code that implements Cursor Logic, which consists of three distinct segments:

  • The Execute Logic: Prepares the SQL statement and opens a cursor to manage the result set.
  • The Fetch Logic: Performs the actual 'read' from the database globals to retrieve rows one by one.
  • The Close Logic: Cleans up memory and closes the cursor once the data is exhausted.

Because this framework and its constraints, it does not support INSERT, UPDATE, or DELETE.

Hi @Evgeny Shvarov 

To get specific details like the line number, class, and function name during an exception, you can use the traceback module to extract the "execution frame" from the error.

By incorporating this logic into your code, we can generate a structured error message in IRIS format. However the PYTHON EXCEPTION has stack information but not detailed error information

ClassMethod pyClsError() [ Language = python ]
{
	
import traceback
import iris

class MathOperations:
    def divide_numbers(self):
        try:
            print(1/0)
        except Exception as e:
            tb = e.__traceback__
            stack = traceback.extract_tb(tb)[-1]
            
            name = f"<{type(e).__name__.upper()}>"
            cls = self.__class__.__name__
            loc = stack[2]
            lineNo = stack[1]
            data = f"{loc}+{lineNo}^{cls}"
            errobj=iris.cls("%Exception.General")._New(name,2603,data)
            a=errobj.Log()
            print("Caught exception: " + str(e))
            


obj = MathOperations()
obj.divide_numbers()
}
ClassMethod pyFuncError() [ Language = python ]
{
	
import traceback
import os
import iris

try:
    print(1/0) 
except Exception as e:
    tb = e.__traceback__
    last_frame = traceback.extract_tb(tb)[-1]
    
    # 2. Extract specific parts
    error_name = f"<{type(e).__name__.upper()}>" # e.g., <NAMEERROR>
    line_no = last_frame.lineno               # e.g., 6
    func_name = last_frame.name               # e.g., <module> or my_func
    filename = os.path.basename(last_frame.filename).replace('.py', '') 
    
    iris_error = f"{func_name}+{line_no}^{filename}"
    errobj=iris.cls("%Exception.General")._New(error_name,2603,iris_error)
    a=errobj.Log()
}

Application Error Log

You can determine whether the value is an object by using $IsObject(value) before processing it.
Alternatively, you can rely on the third argument of %GetNext(,,.type), which tells you the datatype of the value.

Example code

set iter = identifiers.%GetIterator()
while iter.%GetNext(.key, .value, .type) {
    if $IsObject(value) {
        set text = value.%Get("text")
    }
}
set iter = identifiers.%GetIterator()
while iter.%GetNext(.key, .value, .type) {
    if type = "object" {
        set text = value.%Get(key) ;for example value.%Get("text")
    }
    if type = "array" {
        set text = value.%Get(index)  ; for example: value.%Get(0)
    }
}

Hi @Marcelo Witt 

AutoParallel and Adaptive Mode are enabled by default in InterSystems IRIS SQL query optimizer. Because of this, IRIS will automatically determine when parallel query execution is beneficial. Therefore, you usually don’t need to manually specify %PARALLEL unless you want to force parallelism or override the optimizer’s decision.

  • When AdaptiveMode is enabled, automatic parallel processing is applied to all SELECT queries, hinting them with %PARALLEL. However, not all queries may use parallel processing as the SQL Optimizer may decide otherwise.
  • When we are trying to utilize this %PARALLEL feature, we must consider AutoParallelThreshold as well (default value is 3200) and there is no use with this parameter in case AutoParallel is disabled.

This is a really interesting idea, and I think it raises an important point: the InterSystems ecosystem has grown big enough that community tools are now essential, not just “nice extras.” Even though most of these tools are maintained by individuals, creating a foundation could potentially make their management more efficient by providing structure, funding, and shared resources to support maintainers and help ensure long-term sustainability.

Hi @Lucrezia Puntorieri 
Yes you can create a method and classmethod programmatically.

Set clsmethodObj = ##class(%Dictionary.MethodDefinition).%New()
Set clsmethodObj.Name="TestClsMethod"
Set clsmethodObj.ClassMethod=1
Do clsmethodObj.Implementation.WriteLine($C(9)_"Set ^test=""Test"" ")
Do clsmethodObj.Implementation.WriteLine($C(9)_"Quit ^test ")

Set methodObj = ##class(%Dictionary.MethodDefinition).%New()
Set methodObj.Name="TestMethod"
Set methodObj.ClassMethod=0
Do methodObj.Implementation.WriteLine($C(9)_"For I=1:1:10 { S ^test(i)=i} ")
Do methodObj.Implementation.WriteLine($C(9)_"Quit ^test ")

Do clsObj.Methods.Insert(clsmethodObj)
Do clsObj.Methods.Insert(methodObj)

Hi Jack

IRIS does not provide built-in functionality to generate classes directly from a JSON Schema, unlike the support available for XML Schema (XSD). However, you can programmatically create and compile classes at runtime using the %Dictionary.ClassDefinition API.

Here is the sample code to generate a class.

ClassMethod CreateClass()
{	
	Set clsObj = ##class(%Dictionary.ClassDefinition).%New()
	Set clsObj.Name="Test.NewClass"
	Set clsObj.Super="%RegisteredObject,%JSON.Adaptor"
	Set clsObj.Description="Class created via code"
	Set clsObj.DdlAllowed = 1
	Set clsObj.Inheritance="left"
	
	Set propObj = ##class(%Dictionary.PropertyDefinition).%New()
	Set propObj.Name="Name"
	Set propObj.Type="%String"
	Set propObj.SqlColumnNumber=2
	Do propObj.Parameters.SetAt(70,"MAXLEN")
	
	Set indexObj = ##class(%Dictionary.IndexDefinition).%New()
	Set indexObj.Name="NameIdx"
	Set indexObj.Properties="Name"
	Do clsObj.Properties.Insert(propObj)
	Do clsObj.Indices.Insert( indexObj)
	Set st=  clsObj.%Save()
	D $SYSTEM.OBJ.Compile("Test.NewClass","ckb")
	If $$$ISERR(st) w $SYSTEM.OBJ.DisplayError(st)
}