Skip to content

GET_ALL_OBJS_WITH_ATTR_VAL ​

The command GET_ALL_OBJS_WITH_ATTR_VAL retrieves all instances (not relations!) which have a certain attribute value.

Syntax ​

leo-grammar
CC "Core" GET_ALL_OBJS_WITH_ATTR_VAL model:idValue classid:idValueattrid:idValueval:str


#-->RESULT ecode:intValue objids:list
CC "Core" GET_ALL_OBJS_WITH_ATTR_VAL model:idValue classid:idValueattrid:idValueval:str


#-->RESULT ecode:intValue objids:list

Parameters ​

  • modelid (idValue) - the parameter modelid specifies the model from which we want the instances.
  • classid (idValue) - the parameter classid specified the lookup class.
  • attrid (idValue) - the parameter attrid specifies the attribute we want to check.
  • val (strValue) - the parameter val specifies the search value.

Returns ​

  • ecode (intValue) - the result value ecode returns an errorcode. 0 means no error.
  • objids (listValue) - , the result value objids returns a space-separated list of all objs which match the parameters.

Details ​

See Also ​

Examples ​

asc
# get current model
SEND "GET_ACTIVE_MODEL" to:"Modeling" answer:modelid
SET mid:(VAL modelid)

CC "Core" GET_CLASS_ID classname:"Aktivität"
SET cid:(classid)

CC "Core" GET_ATTR_ID classid:(cid) attrname:"Bearbeiter"
SET aid:(attrid)

CC "Core" GET_ALL_OBJS_WITH_ATTR_VAL modelid:(mid) classid:(cid) attrid:(aid) val:"{\"Bearbeiter-2\" : \"Bearbeiter\"}"

CC "AdoScript" INFOBOX ("Found " + STR tokcnt (objids, " ") + " obj(s)")
# get current model
SEND "GET_ACTIVE_MODEL" to:"Modeling" answer:modelid
SET mid:(VAL modelid)

CC "Core" GET_CLASS_ID classname:"Aktivität"
SET cid:(classid)

CC "Core" GET_ATTR_ID classid:(cid) attrname:"Bearbeiter"
SET aid:(attrid)

CC "Core" GET_ALL_OBJS_WITH_ATTR_VAL modelid:(mid) classid:(cid) attrid:(aid) val:"{\"Bearbeiter-2\" : \"Bearbeiter\"}"

CC "AdoScript" INFOBOX ("Found " + STR tokcnt (objids, " ") + " obj(s)")
  • get active model's id
  • determine ID of class 'Aktivität'
  • determine ID of attribute 'Bearbeiter'
  • query all objs
  • show number of found objects

Versions and Changes ​

Available since ADOxx 1.3