Skip to content
Reference > AmiScript API > Classes

DatamodelEditor

Definition

DatamodelEditor var = .... ;

Extends

Extended By

None

Description

AMI Web editor for DataModel runtime introspection

Method Summary

Owner Name Return Type Description
PanelEditor apply() Boolean Persist the editor working copy to the underlying object. Call validate() first.
PanelEditor close() Boolean Dismiss this editor's window and unregister it from the editor registry. Triggers the same lifecycle as the user clicking the window's close button.
DatamodelEditor executeNow() Map Trigger DataModel execution using its current request tableset. Non-blocking. Returns a pre-execute snapshot {triggered, alreadyRunning, evalsBefore, errorsBefore}; diff against getStatus() to detect completion.
PanelEditor getBinding() Map Return the editor's binding metadata as a map: {handle, editorType, contentType, ari, name, parentHandle, scope, capabilities:[...], readonly}. Use this to ask 'what kind of editor is this?' or 'can I setCode on it?' (check capabilities for 'set_code') without runtime-type-checking the editor instance.
Object getClassName() String Returns the string name of this object's class type.
DatamodelEditor getErrors() Map Return the DataModel editor's callback error snapshot.
PanelEditor getHandle() String Return this editor's stable session handle.
DatamodelEditor getOutputTableSchema(tableName) List Return column definitions [{name, type}] for one DataModel output table.
DatamodelEditor getOutputTables() List Return output table names from the DataModel response schema.
DatamodelEditor getOutputTables(timeoutMs) List Return output table names from the DataModel response schema. Blocks up to timeoutMs milliseconds if the DM has never executed; returns an empty list if the schema does not populate within the timeout. Overload of getOutputTables() which uses a 5000ms default.
DatamodelEditor getOutputTableset() List Snapshot the DataModel's most recent response as a list of {name, columns:[{name,type}], rows:[{col:val,...}]} maps. Mirrors what the AMI Web 'test run' view renders; lets agents inspect actual DM output rather than only the schema. Returns an empty list when the DM has not executed.
PanelEditor getRevision() Long Return the editor's monotonic working-copy revision.
DatamodelEditor getStatus() Map Return the DataModel editor runtime status, including output tables and callback errors.
PanelEditor hasChanged() Boolean Return true if the working copy differs from persisted state.
PanelEditor open() Boolean Open this editor in the UI, bringing it onto the user's screen if it is not already visible. Editing can be done without calling open().
PanelEditor revert() Boolean Discard unsaved working-copy changes and return to persisted state.
PanelEditor test() Map Execute the editor's payload in its runtime context without persisting. Returns {ok, revision, returnValue, output, errorMessage}. Only valid when capabilities contains 'test' -- other editor kinds return a not-supported result. Mirrors the editor_test admin/MCP shape.
Object toJson() String Returns a string of a json representation of this object.
PanelEditor validate() Map Validate the editor's working copy. Returns {ok, revision, diagnostics}. Does not surface validation errors as UI alerts -- callers inspect the returned diagnostics list instead.

Method Definitions


apply()

Boolean PanelEditor::apply()

Description

Persist the editor working copy to the underlying object. Call validate() first.


close()

Boolean PanelEditor::close()

Description

Dismiss this editor's window and unregister it from the editor registry. Triggers the same lifecycle as the user clicking the window's close button.


executeNow()

Map DatamodelEditor::executeNow()

Description

Trigger DataModel execution using its current request tableset. Non-blocking. Returns a pre-execute snapshot {triggered, alreadyRunning, evalsBefore, errorsBefore}; diff against getStatus() to detect completion.


getBinding()

Map PanelEditor::getBinding()

Description

Return the editor's binding metadata as a map: {handle, editorType, contentType, ari, name, parentHandle, scope, capabilities:[...], readonly}. Use this to ask 'what kind of editor is this?' or 'can I setCode on it?' (check capabilities for 'set_code') without runtime-type-checking the editor instance.


getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.


getErrors()

Map DatamodelEditor::getErrors()

Description

Return the DataModel editor's callback error snapshot.


getHandle()

String PanelEditor::getHandle()

Description

Return this editor's stable session handle.


getOutputTableSchema(tableName)

List DatamodelEditor::getOutputTableSchema(String tableName)

Description

Return column definitions [{name, type}] for one DataModel output table.

Parameter Definition

Name Type Description
tableName String 

getOutputTables()

List DatamodelEditor::getOutputTables()

Description

Return output table names from the DataModel response schema.


getOutputTables(timeoutMs)

List DatamodelEditor::getOutputTables(Long timeoutMs)

Description

Return output table names from the DataModel response schema. Blocks up to timeoutMs milliseconds if the DM has never executed; returns an empty list if the schema does not populate within the timeout. Overload of getOutputTables() which uses a 5000ms default.

Parameter Definition

Name Type Description
timeoutMs Long 

getOutputTableset()

List DatamodelEditor::getOutputTableset()

Description

Snapshot the DataModel's most recent response as a list of {name, columns:[{name,type}], rows:[{col:val,...}]} maps. Mirrors what the AMI Web 'test run' view renders; lets agents inspect actual DM output rather than only the schema. Returns an empty list when the DM has not executed.


getRevision()

Long PanelEditor::getRevision()

Description

Return the editor's monotonic working-copy revision.


getStatus()

Map DatamodelEditor::getStatus()

Description

Return the DataModel editor runtime status, including output tables and callback errors.


hasChanged()

Boolean PanelEditor::hasChanged()

Description

Return true if the working copy differs from persisted state.


open()

Boolean PanelEditor::open()

Description

Open this editor in the UI, bringing it onto the user's screen if it is not already visible. Editing can be done without calling open().


revert()

Boolean PanelEditor::revert()

Description

Discard unsaved working-copy changes and return to persisted state.


test()

Map PanelEditor::test()

Description

Execute the editor's payload in its runtime context without persisting. Returns {ok, revision, returnValue, output, errorMessage}. Only valid when capabilities contains 'test' -- other editor kinds return a not-supported result. Mirrors the editor_test admin/MCP shape.


toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.


validate()

Map PanelEditor::validate()

Description

Validate the editor's working copy. Returns {ok, revision, diagnostics}. Does not surface validation errors as UI alerts -- callers inspect the returned diagnostics list instead.