Plug-in (Function & Smart Service)Free

Appian Introspect Capability

by Appian Corporation

Description

Create SAIL variables and rule inputs referencing Appian Objects! Also introspect CDT Metadata. Finally the goals is to give the possibility to parameterize some behavior bases on meta definitions.

This is the list of Design Objects that can be created references for

  • Types
  • CDT Fields
  • Rules
  • Process Model
  • DataStoreEntity

This is the list of Design Objects which definition Metadata can be get at runtime:

  • CDT --> CDTMetadata
  • CDT Fields --> CDTFieldMetadata

A CDTMetadataModel collects all referenced CDTs Metadata from a root one

The main features implemented are:

  • Get a Reference to a given Type,
  • Get back the original Type from a Reference
  • Get the corresponding list type for the referenced type
  • Create a new value of the referenced type
  • Get a Reference to a referenced CDT Field given a TypeReference and the field's name.
  • Use the fieldName property to dynamically get or set field values
  • A validation is done for the given fieldName to be a valid field of the type referenced by the given TypeReference
  • It can be asked for the type of the original field
  • It can be asked if the original field is an array
  • Get a Reference to a Rule Definition
  • Get back the original Rule from a Reference
  • Get a Reference to a Process Model Definition
  • Get back the original Process Model from a Reference
  • Get a Reference to a DataStore Entity
  • Get back the original DataStore Entity from a Reference
  • Get a Reference to the CDT that is persisted in the given entity
  • Get the definition Metadata of a CDT including it's fields and all CDTs referenced directly or indirectly

Features

Main Functions:

  • CreateTypeReference and CreateTypeReferenceFromTypeId: Given a Type or a typeId returns an instance of the TypeReference CDT which points to it.
  • GetType, GetListType, NewValue, GetFieldNames are also implemented for the TypeReference CDT
  • CreateFieldReference, GetFieldType, IsFieldArray: Given a TypeReference and a field name, returns an instance of the CDTFieldReference CDT which points to the field definition. You can get the typeId from the returned CDTFieldReference and ask it the referenced field is an array
  • CreateRuleReference, GetRule: Given a Rule Reference returns an instance of RuleReference CDT which point to the given Rule. You can get back the original rule Reference and invoke it if necessary.
  • CreateProcessModelReference, GetProcessModel: Given a Process Model Constant returns an instance of ProcessModelReference CDT which point to the same Process Model as the given constant. You can get back the original Process Model reference and invoke it.
  • CreateEntityReference, GetEntity, GetEntityTypeReference: Given an Entity Constant returns an instance of EntityReference CDT which point to the same Entity as the given constant. Again you can get back the original Data Store Entity, you can also get a Reference to the CDT that is persisted in the referenced entity.
  • LoadMetadata: Returns a CDTMetadataModel grouping the metadata of the given CDT and any other rereferenced directly or indirectly indexed by typeId.

with( local!mdm: loadmetadata('type!{urn:com:appian:types}FC_Carrusel'), local!typeId: typeof('type!{urn:com:appian:types}FC_Carrusel'()), local!cmd: local!mdm.metadatas[wherecontains(local!typeId, local!mdm.metadatas.typeId)].metadata[1], local!languageField: local!cmd.fields[wherecontains("language", local!cmd.fields.fieldName)][1], local!mdm.metadatas[wherecontains(local!languageField.fieldType, local!mdm.metadatas.typeId)].metadata[1] )

Release notes

  • new functions:
  • getEntityTypeReference: return a TypeReference to the CDT that is persisted in the Entity referenced by the given EntityReference
  • loadMetadata: load the metadata of the given CDT plus all its referenced CDTs
Version history (2)

1.1.2

  • Corrected an error when getting back the getFieldType for a list field, now it returns the item's type in this case.
  • New Function createTypeReferenceFromTypeId(typeId) returns a new TypeReference to the Type corresponding to the given typeId. The goal is to be able to create a TypeReference to the referenced field's type:

createTypeReferenceFromTypeId(getFieldType(local!fieldReference))

1.1.1

  • Corrected an error thrown in Function createRuleReference
  • Corrected the Function GetType(TypeReference) now it returns the Referenced Type itself and not an ID_REFERENCE to its constructor
  • New Function newValue(TypeReference) returns an ID_REFERENCE to the referenced type's constructor
  • New Function getListType(TypeReference) return the referenced type's corresponding List Type
  • New Function createEntityReference(DataStoreEntity) returns new Reference to the given datastore entity, so this references can be saved and loaded as part of other CDTs
  • New Function getEntity(EntityReference) returns the referenced entity from the given EntityReference, so this reference can be used anywhere a DataStoreEntity is expected
  • CreateRuleReference can also be used with integrations, interfaces and decision tables too