User bio
404 bio not found
Member since Mar 11, 2020

output of $isobject(..ObjOrigem) is "1"

I tried to do the same test.


LISDEV>set obj={"Id":"myId"}

LISDEV>write $property(obj,"Id")  
LISDEV>write $method(obj,"IdGet")

WRITE $METHOD(obj,"IdGet")
<METHOD DOES NOT EXIST> *IdGet,%Library.DynamicObject
LISDEV>write $zv
IRIS for UNIX (Ubuntu Server 18.04 LTS for x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:20:34 EDT
LISDEV>write obj


@Julius Kavay, according to $zv , you are running IRIS 2021.1, I'm running IRIS 2022.1

Hello everyone !

I thank the help of all!

with everyone's help, it was possible to create a property with the same behavior as VALUE LIST from the parameters of a class. 

below is the test code:

First create the abstraction

 Class ing.shared.abstracts.AbstractEnum [ Abstract ]
ClassMethod BuildValueList() As %String
   Set valueList = ","_..GetValuesOfParametersString()
   Return valueList
ClassMethod BuildDisplayList() As %String
   Set displayList = ","_..GetParametersString()
   Return displayList

 ClassMethod GetValuesOfParameters()
   Set parametersList = ..GetParameters()
   Set valueList= $lb("")
   For i=1:1:$LISTLENGTH(parametersList){
      Set value = $PARAMETER($CLASSNAME(),$LIST(parametersList,i))
      Set $LIST(valueList,i) = value
   Return valueList
ClassMethod GetParameters() [ CodeMode = objectgenerator ]
   Set parametersClass=""
   For i=1:1:%class.Parameters.Count(){
      Set parametersClass=parametersClass_$LISTBUILD(%class.Parameters.GetAt(i).Name)
   Do %code.WriteLine($char(9)_"Return """_parametersClass_"""")

 ClassMethod GetParametersString() As %String
   Return $listtostring(..GetParameters())

 ClassMethod GetValuesOfParametersString() As %String
   Return $listtostring(..GetValuesOfParameters())

Second I created the class with the parameters, containing extension of the abstract class

 Class ing.dto.AbstractionItemSectorStatus Extends ing.shared.abstracts.AbstractEnum

Parameter Active = 1;

Parameter Inactive = 2;

Parameter Production = 3;

Parameter Upkeep = 4;


Create a datatype class referencing a parameter class in your property:

 Class ing.dataMap.DataTypeSectorStatusEnum Extends %Integer [ ClassType = datatype ]

 Parameter DISPLAYLIST = {##class(ing.dto.AbstractionItemSectorStatus).BuildDisplayList()};

 Parameter VALUELIST = {##class(ing.dto.AbstractionItemSectorStatus).BuildValueList()}; 


And finally create a  Persistent class:

 Class ing.dataMap.TblSector Extends %Persistent

Property Description  As %String;

 Property SectorStatus As DataTypeSectorStatusEnum;

This architecture can be useful for future code maintenance, creating or changing new abstract classes

Open Exchange applications:
davi massaru has not followed anybody yet.
Global Masters badges:
davi massaru has no Global Masters badges yet.