Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IModel

This interface exposes a single Mendix Model. This interface contains the parts of the Model that are exposed through the SDK.

Hierarchy

Implemented by

Index

Properties

Methods

Properties

id

id: string

Working copy id of the current opened model (read only)

metaModelVersion

metaModelVersion: Version

The Mendix meta model version related to the project.

mxVersionForModel

mxVersionForModel: Version

The Mendix product version the model was created with/in. Note: this does not have to equal the meta model version.

root

root: IProject

The actual contents of the model.

workingCopy

workingCopy: IWorkingCopy

The meta data of the model.

Methods

addModuleUnitInterfaces

  • addModuleUnitInterfaces(moduleJson: string | IAbstractUnitJson[]): IStructuralUnit
  • Adds the given module json to the project, which will make the module and its units read-only and unloadable. Returns the added module.

    Gives error if

    • The JSON isn't an array
    • The module package is not compatible with the same metamodel version as the project

    Parameters

    • moduleJson: string | IAbstractUnitJson[]

    Returns IStructuralUnit

allBuildingBlocks

  • allBuildingBlocks(): IBuildingBlock[]

allCodeActions

  • allCodeActions(): ICodeAction[]

allConstants

  • allConstants(): IConstant[]

allConsumedAppServices

  • allConsumedAppServices(): IConsumedAppService[]

allConsumedBusinessEventServices

  • allConsumedBusinessEventServices(): IConsumedBusinessEventService[]

allConsumedKafkaServices

  • allConsumedKafkaServices(): IConsumedKafkaService[]

allConsumedODataServices

  • allConsumedODataServices(): IConsumedODataService[]

allDataSets

  • allDataSets(): IDataSet[]

allDocumentTemplates

  • allDocumentTemplates(): IDocumentTemplate[]

allDocuments

  • allDocuments(): IDocument[]

allDomainModels

  • allDomainModels(): IDomainModel[]

allEnumerations

  • allEnumerations(): IEnumeration[]

allExportMappings

  • allExportMappings(): IExportMapping[]

allFolderBases

  • allFolderBases(): IFolderBase[]

allFolders

  • allFolders(): IFolder[]

allFormBases

  • allFormBases(): IFormBase[]

allImageCollections

  • allImageCollections(): IImageCollection[]

allImportMappings

  • allImportMappings(): IImportMapping[]

allImportedWebServices

  • allImportedWebServices(): IImportedWebService[]

allJavaActions

  • allJavaActions(): IJavaAction[]

allJavaScriptActions

  • allJavaScriptActions(): IJavaScriptAction[]

allJsonStructures

  • allJsonStructures(): IJsonStructure[]

allLayouts

  • allLayouts(): ILayout[]

allMappingDocuments

  • allMappingDocuments(): IMappingDocument[]

allMenuDocuments

  • allMenuDocuments(): IMenuDocument[]

allMessageDefinitionCollections

  • allMessageDefinitionCollections(): IMessageDefinitionCollection[]

allMicroflowBases

  • allMicroflowBases(): IMicroflowBase[]

allMicroflows

  • allMicroflows(): IMicroflow[]

allModuleDocuments

  • allModuleDocuments(): IModuleDocument[]

allModuleSecurities

  • allModuleSecurities(): IModuleSecurity[]

allModuleSettings

  • allModuleSettings(): IModuleSettings[]

allModules

  • allModules(): IModule[]

allMxSchemas

  • allMxSchemas(): IMxSchema[]

allNanoflows

  • allNanoflows(): INanoflow[]

allNativeLayouts

  • allNativeLayouts(): INativeLayout[]

allNativePages

  • allNativePages(): INativePage[]

allNavigationDocuments

  • allNavigationDocuments(): INavigationDocument[]

allPageTemplates

  • allPageTemplates(): IPageTemplate[]

allPages

  • allPages(): IPage[]

allProjectConversions

  • allProjectConversions(): IProjectConversion[]

allProjectDocuments

  • allProjectDocuments(): IProjectDocument[]

allProjectSecurities

  • allProjectSecurities(): IProjectSecurity[]

allProjectSettings

  • allProjectSettings(): IProjectSettings[]

allProjects

  • allProjects(): IProject[]

allPublishedAppServices

  • allPublishedAppServices(): IPublishedAppService[]

allPublishedBusinessEventServices

  • allPublishedBusinessEventServices(): IPublishedBusinessEventService[]

allPublishedKafkaServices

  • allPublishedKafkaServices(): IPublishedKafkaService[]

allPublishedODataServices

  • allPublishedODataServices(): IPublishedODataService[]

allPublishedRestServices

  • allPublishedRestServices(): IPublishedRestService[]

allPublishedServiceBases

  • allPublishedServiceBases(): IPublishedServiceBase[]

allPublishedWebServices

  • allPublishedWebServices(): IPublishedWebService[]

allQueues

  • allQueues(): IQueue[]

allRegularExpressions

  • allRegularExpressions(): IRegularExpression[]

allRemoteEntitySourceDocuments

  • allRemoteEntitySourceDocuments(): IRemoteEntitySourceDocument[]

allRules

  • allRules(): IRule[]

allScheduledEvents

  • allScheduledEvents(): IScheduledEvent[]

allServerSideMicroflows

  • allServerSideMicroflows(): IServerSideMicroflow[]

allSnippets

  • allSnippets(): ISnippet[]

allSystemTextCollections

  • allSystemTextCollections(): ISystemTextCollection[]

allTemplateFormBases

  • allTemplateFormBases(): ITemplateFormBase[]

allUnits

  • allUnits(): IAbstractUnit[]
  • Returns all units in the project, including modules, folders etc. To retrieve all "real" documents (pages, microflows etc.), use allDocuments().

    Returns IAbstractUnit[]

allWorkflows

  • allWorkflows(): IWorkflow[]

allXmlSchemas

  • allXmlSchemas(): IXmlSchema[]

closeConnection

  • Ends the connection with the Model API client. Flushes any pending deltas and invokes the callback once complete. If a callback is provided but no error callback is provided, errors will be handled through the default modelstore error handler.

    Parameters

    Returns void

  • Returns Promise<void>

createElement

  • createElement<T>(typeName: T): ConcreteModelElements[T]
  • Creates and returns a new element in the SDK and on the server. After creation, assign or add this instance to a property that accepts this kind of elements.

    Type parameters

    • T: keyof ConcreteModelElements

    Parameters

    • typeName: T

      structureTypeName of the element type you want to create

    Returns ConcreteModelElements[T]

deleteFile

  • deleteFile(filePath: string, callback: IVoidCallback, errorCallback: IErrorCallback): void
  • deleteFile(filePath: string): Promise<void>

deleteWorkingCopy

exportModuleMpk

  • exportModuleMpk(moduleId: string, outFilePath: string, callback: IVoidCallback, errorCallback?: IErrorCallback): void
  • exportModuleMpk(moduleId: string, outFilePath: string): Promise<void>

exportMpk

filterUnitsByCustomWidgetId

  • filterUnitsByCustomWidgetId(workingCopyId: string, widgetId: string, callback: ICallback<string[]>, errorCallback?: IErrorCallback): void
  • filterUnitsByCustomWidgetId(workingCopyId: string, widgetId: string): Promise<string[]>

findAppServiceActionByQualifiedName

findAppServiceActionParameterByQualifiedName

findAssociationBaseByQualifiedName

findAttributeByQualifiedName

  • findAttributeByQualifiedName(qname: string): IAttribute | null

findConstantByQualifiedName

  • findConstantByQualifiedName(qname: string): IConstant | null

findConsumedKafkaServiceByQualifiedName

  • findConsumedKafkaServiceByQualifiedName(qname: string): IConsumedKafkaService | null

findConsumedODataServiceByQualifiedName

  • findConsumedODataServiceByQualifiedName(qname: string): IConsumedODataService | null

findDataSetByQualifiedName

  • findDataSetByQualifiedName(qname: string): IDataSet | null

findDataSetParameterByQualifiedName

findDocumentTemplateByQualifiedName

findEntityByQualifiedName

  • findEntityByQualifiedName(qname: string): IEntity | null

findEnumerationByQualifiedName

  • findEnumerationByQualifiedName(qname: string): IEnumeration | null

findEnumerationValueByQualifiedName

findExportMappingByQualifiedName

  • findExportMappingByQualifiedName(qname: string): IExportMapping | null

findImageByQualifiedName

  • findImageByQualifiedName(qname: string): IImage | null

findImportMappingByQualifiedName

  • findImportMappingByQualifiedName(qname: string): IImportMapping | null

findImportedWebServiceByQualifiedName

findJavaActionByQualifiedName

  • findJavaActionByQualifiedName(qname: string): IJavaAction | null

findJavaActionParameterByQualifiedName

findJavaScriptActionByQualifiedName

findJavaScriptActionParameterByQualifiedName

findJsonStructureByQualifiedName

  • findJsonStructureByQualifiedName(qname: string): IJsonStructure | null

findLayoutByQualifiedName

  • findLayoutByQualifiedName(qname: string): ILayout | null

findLayoutParameterByQualifiedName

findMenuDocumentByQualifiedName

  • findMenuDocumentByQualifiedName(qname: string): IMenuDocument | null

findMessageDefinitionByQualifiedName

findMicroflowByQualifiedName

  • findMicroflowByQualifiedName(qname: string): IMicroflow | null

findMicroflowParameterByQualifiedName

findModuleByQualifiedName

  • findModuleByQualifiedName(qualifiedName: string): IModule | null
  • Given a qualified name, returns a Module.

    Parameters

    • qualifiedName: string

    Returns IModule | null

findModuleRoleByQualifiedName

  • findModuleRoleByQualifiedName(qname: string): IModuleRole | null

findNanoflowByQualifiedName

  • findNanoflowByQualifiedName(qname: string): INanoflow | null

findNanoflowParameterByQualifiedName

findNativeLayoutByQualifiedName

  • findNativeLayoutByQualifiedName(qname: string): INativeLayout | null

findNativePageByQualifiedName

  • findNativePageByQualifiedName(qname: string): INativePage | null

findNavigationProfileByQualifiedName

findPageByQualifiedName

  • findPageByQualifiedName(qname: string): IPage | null

findPageParameterByQualifiedName

  • findPageParameterByQualifiedName(qname: string): IPageParameter | null

findQueueByQualifiedName

  • findQueueByQualifiedName(qname: string): IQueue | null

findRegularExpressionByQualifiedName

findRemoteEntitySourceDocumentByQualifiedName

  • findRemoteEntitySourceDocumentByQualifiedName(qname: string): IRemoteEntitySourceDocument | null

findRuleByQualifiedName

  • findRuleByQualifiedName(qname: string): IRule | null

findRuleParameterByQualifiedName

  • findRuleParameterByQualifiedName(qname: string): IRuleParameter | null

findSnippetByQualifiedName

  • findSnippetByQualifiedName(qname: string): ISnippet | null

findUserRoleByQualifiedName

  • findUserRoleByQualifiedName(qname: string): IUserRole | null

findUserTaskOutcomeByQualifiedName

findWorkflowByQualifiedName

  • findWorkflowByQualifiedName(qname: string): IWorkflow | null

findXmlSchemaByQualifiedName

  • findXmlSchemaByQualifiedName(qname: string): IXmlSchema | null

flushChanges

getFile

  • getFile(filePath: string, outFilePath: string, callback: function, errorCallback: IErrorCallback): void
  • getFile(filePath: string, outFilePath: string): Promise<any>
  • Downloads the file specified by the supplied filepath. If outFilePath is empty, the raw response body will be provided in the callback

    Parameters

    • filePath: string
    • outFilePath: string
    • callback: function
        • (response?: any): void
        • Parameters

          • Optional response: any

          Returns void

    • errorCallback: IErrorCallback

    Returns void

  • Parameters

    • filePath: string
    • outFilePath: string

    Returns Promise<any>

getFilePaths

  • getFilePaths(callback: ICallback<string[]>, errorCallback: IErrorCallback): void
  • getFilePaths(): Promise<string[]>

getFiles

  • Returns all files or a subset of files options.filter: glob pattern to limit the set of files options.format: "json" or "zip" options.path: useful if format is "zip". If provided the zip will be stored on disk

    Parameters

    • callback: function
        • (response?: string[]): void
        • Parameters

          • Optional response: string[]

          Returns void

    • errorCallback: IErrorCallback

    Returns void

  • Returns Promise<string[]>

  • Parameters

    • options: IGetFilesOptions
    • callback: function
        • (response?: string[] | any): void
        • Parameters

          • Optional response: string[] | any

          Returns void

    • errorCallback: IErrorCallback

    Returns void

  • Parameters

    Returns Promise<string[] | any>

getLastEventId

  • getLastEventId(callback: ICallback<number>, errorCallback?: IErrorCallback): void
  • getLastEventId(): Promise<number>
  • Get the event id for the last processed batch of deltas in Model Server after flushing any pending deltas. If a callback is provided but no error callback is provided, errors will be handled through the default modelstore error handler.

    Parameters

    Returns void

  • Returns Promise<number>

importModuleMpk

  • importModuleMpk(mpkPath: string | Blob, callback: IVoidCallback, errorCallback?: IErrorCallback): void
  • importModuleMpk(mpkPath: string | Blob): Promise<void>
  • Imports the given module MPK.

    Importing a module overwrites existing files in the project.

    Gives error if

    • A module with the same name already exists
    • The module package is not using the same metamodel version as the project

    Parameters

    Returns void

  • Parameters

    • mpkPath: string | Blob

    Returns Promise<void>

loadUnitById

  • loadUnitById<T>(id: string, forceRefresh: boolean, callback: ICallback<T>, errorCallback?: IErrorCallback): void
  • loadUnitById<T>(id: string, forceRefresh: boolean): Promise<T>
  • Given an id, fetches a complete unit. The result might be returned from the cache. Use this method if you have just a unit Id, otherwise, unit.fetch() is a simpler alternative.

    Type parameters

    Parameters

    Returns void

  • Type parameters

    Parameters

    • id: string
    • forceRefresh: boolean

    Returns Promise<T>

onBuildResultEventReceived

  • onBuildResultEventReceived(callback: function): void

onFileChangesReceived

  • onFileChangesReceived(callback: function): void

onModelChange

onModelEventProcessed

onWorkingCopyDataEventReceived

  • onWorkingCopyDataEventReceived(callback: function): void

putFile

  • putFile(inFilePath: string | Blob, filePath: string, callback: IVoidCallback, errorCallback: IErrorCallback): void
  • putFile(inFilePath: string | Blob, filePath: string): Promise<void>

setErrorHandler

  • Sets the callback that is invoked when an error occurs in an asynchronous operation for which no error callback is specified.

    Examples of such operations are making changes to the model and loading elements.

    Parameters

    Returns void

startReceivingModelEvents

  • startReceivingModelEvents(): void

startReceivingWorkingCopyEvents

  • startReceivingWorkingCopyEvents(): void

stopReceivingModelEvents

  • stopReceivingModelEvents(): void

stopReceivingWorkingCopyEvents

  • stopReceivingWorkingCopyEvents(): void

Generated using TypeDoc