Skip to main content
Version: Omada Identity Cloud

Scripting classes

Refer to the Omada Identity Enterprise Server API documentation for detailed information on Omada specific classes.

Interface IDataObjectCriteria

Interface for building a query for Data Objects and retrieve the result:

MethodParametersReturnsDescription
AddDataObjectType()dataObjectTypeId: intIDataObjectCriteriaRestricts the criteria to a data object type by its numeric ID.
AddDataObjectType()sysnameOrGuid: stringIDataObjectCriteriaRestricts the criteria to a data object type by sysname or GUID.
AddWhitelist()guids: stringIDataObjectCriteriaIncludes only objects matching the given comma-separated GUIDs.
AddWhitelist()dataObjects: DataObjectsIDataObjectCriteriaIncludes only the given collection of data objects.
AddWhitelist()dataObjectId: intIDataObjectCriteriaIncludes only the object with the given ID.
AddWhitelist()idList: IEnumerable<int>IDataObjectCriteriaIncludes only objects matching the given list of IDs.
SetWhitelist()idList: IEnumerable<int>IDataObjectCriteriaReplaces the whitelist entirely with the given list of IDs.
AddBlacklist()guids: stringIDataObjectCriteriaExcludes objects matching the given comma-separated GUIDs.
AddBlacklist()dataObjects: DataObjectsIDataObjectCriteriaExcludes the given collection of data objects.
AddBlacklist()dataObjectId: intIDataObjectCriteriaExcludes the object with the given ID.
AddBlacklist()idList: IEnumerable<int>IDataObjectCriteriaExcludes objects matching the given list of IDs.
AddFilterExpression()property: string, value: string, expInnerOperator: ExpInnerOperator = Equals, path: string = ""IDataObjectCriteriaAdds a filter expression comparing a string property.
AddFilterExpression()property: string, value: int, expInnerOperator: ExpInnerOperator = Equals, path: string = ""IDataObjectCriteriaAdds a filter expression comparing an int property.
AddFilterExpression()property: string, value: bool, expInnerOperator: ExpInnerOperator = Equals, path: string = ""IDataObjectCriteriaAdds a filter expression comparing a bool property.
AddFilterExpression()property: string, value: DateTime, expInnerOperator: ExpInnerOperator = Equals, path: string = ""IDataObjectCriteriaAdds a filter expression comparing a date/time property.
AddFilterExpression()property: string, value: IEnumerable<int>, expInnerOperator: ExpInnerOperator = Equals, path: string = ""IDataObjectCriteriaAdds a filter expression comparing a property against a set of int values.
AddFilterExpression()property: string, value: IEnumerable<Guid>, expInnerOperator: ExpInnerOperator = Equals, path: string = ""IDataObjectCriteriaAdds a filter expression comparing a property against a set of GUID values.
AddProperties()propertyIds: IList<int>IDataObjectCriteriaSpecifies which properties to load for matched objects.
EvaluateCountExpectation()actualCount: intvoidEvaluates a previously set count expectation against an actual count.
SetView()view: DataObjectViewIDataObjectCriteriaSets the data object view used for loading.
SetMaxObjects()maxObjects: intIDataObjectCriteriaLimits the maximum number of objects returned.
MustHaveReferenceTo()dataObjectIds: IList<int>IDataObjectCriteriaRequires matched objects to reference the given IDs.
MustBeReferredBy()dataObjectUids: stringIDataObjectCriteriaRequires matched objects to be referred to by the given UIDs (string form).
MustBeReferredBy()dataObjectUids: IList<Guid>IDataObjectCriteriaRequires matched objects to be referred to by the given UIDs.
MustBeReferredBy()dataObjectIds: IList<int>, referencePath: string = ""IDataObjectCriteriaRequires matched objects to be referred to by the given IDs, optionally via a specific reference path.
ExpectedCount()count: ExpectedCount, errorMessageKey: string = "", defaultErrorMessage: string = "", formatParams: object[] = nullIDataObjectCriteriaDeclares an expected result count with an associated error message.
TreeNode()treeNodeParents: TreeNodeParents, treeNodeChildren: TreeNodeChildren, treeNodes: bool, buildTree: boolIDataObjectCriteriaConfigures tree-node traversal and building behavior for hierarchical objects.
ExpectedCountEvaluated()count: ExpectedCount, customMessage: string = nullvoidEvaluates whether the expected count condition was met, with an optional custom message.
GetLoader()noneIDataObjectLoaderReturns the loader that executes the criteria and loads matching data objects.
GetReader()noneIDataObjectReaderReturns a reader for reading property values from matched objects.
GetWriter()noneIDataObjectWriterReturns a writer for modifying matched objects.

Interface IDataObjectReader

Method reference:

MethodParametersReturnsDescription
GetPropertyValue<T>int propertyId, T defaultValueTReads a single property by numeric property ID.
GetPropertyValue<T>int propertyId, T defaultValue, T defaultValueNoObjectFoundTSame as above, but returns a distinct default when no data object could be resolved at all.
GetPropertyValue<T>string propertyOrRefPath, T defaultValueTReads a property by sysname, or follows a reference path to a related object's property.
GetPropertyValueUidstring propertySysnameGuidResolves the UID of a Set/Reference property value.
GetReferencePropertyValueIdstring propertySysname, bool throwExceptionIfNotSet = trueintReads a Reference/Set property value as its integer ID.
GetReferencePropertyValueIdsstring propertySysnameIntegerListReads a Reference/Set property value ID for every data object resolved by the reader, deduplicated.
GetDisplayValuestring propertySysname, ExpectedCount expectedLength = ExpectedCount.Undefined, Func<string, string> formatter = nullstringReads the display value of a property, optionally validating cardinality and formatting it.
GetPropertyValuesDictionary<T>string propertySysname, T defaultValueDictionary<int, T>Reads one property value per resolved data object, keyed by data object ID.

Interface IDataObjectWriter

MethodParametersReturnsDescription
SetPropertyValueEncrypted()property: string, value: stringDataObjectWriterSets a property value, encrypting it before storage.
SetPropertyValue()property: string, valueResolver: Func<DataObject, object[]>DataObjectWriterSets a property value computed from a resolver function applied to the data object.
SetPropertyValue()property: string, value: objectDataObjectWriterSets a single property value by name.
SetPropertyValue()property: string, value: object[]DataObjectWriterSets a multi-value property by name.
SetPropertyValue()propertyId: int, value: objectDataObjectWriterSets a single property value by property ID.
SetPropertyValues()values: Dictionary<int, object>DataObjectWriterSets multiple property values at once, keyed by property ID.
AddPropertyValues()property: string, propertyValueIds: List<int>DataObjectWriterAdds values to a multi-value property by property value IDs.
RemovePropertyValues()property: string, propertyValueIds: List<int>DataObjectWriterRemoves values from a multi-value property by property value IDs.
CopyDataWithCopyRule()sourceDataObjectId: int, copyRuleUid: string, excludeDestinationFields: List<string> = nullDataObjectWriterCopies data from a source object (by ID) into the target using a copy rule, optionally excluding fields.
CopyDataWithCopyRule()sourceDataObject: DataObject, copyRuleUid: string, excludeDestinationFields: List<string> =nullDataObjectWriterCopies data from a source object instance into the target using a copy rule, optionally excluding fields.
CreateDataObject()dataObjectTypeId: int, parentId: int = 0DataObjectCreates a new data object of the given type ID, optionally under a parent.
CreateDataObject()dataObjectTypeUid: Guid, parentId: int = 0DataObjectCreates a new data object of the given type GUID, optionally under a parent.
CreateDataObject()dataObjectTypeSysName: string, parentId: int = 0DataObjectCreates a new data object of the given type sysname, optionally under a parent.
Delete()nonevoidDeletes the current data object(s) targeted by the writer.
DeleteDataObject()dataObjectId: intvoidDeletes the data object with the given ID.
DeleteDataObjects()dataObjectIds: IEnumerable<int>voidDeletes the data objects with the given IDs.
Save()noneIList<DataObject>Saves the pending changes and returns the affected data objects.
Save()dataObjectId: intDataObjectSaves changes for a single data object by ID.
Save()dataObjectIds: IntegerListIList<DataObject>Saves changes for the data objects with the given IDs.
Save()dataObjectCriteria: IDataObjectCriteriaIList<DataObject>Saves changes for data objects matched by the given criteria.
Save()dataObjectLoader: DataObjectLoaderIList<DataObject>Saves changes for data objects produced by the given loader.
Save()dataObject: DataObjectDataObjectSaves changes for a single data object instance.
Save()dataObjects: IList<DataObject>IList<DataObject>Saves changes for a list of data object instances.

All allowed classes in scripts

  • System.Object
  • System.Int16
  • System.Int32
  • System.Int64
  • System.Decimal
  • System.Double
  • System.Single
  • System.Guid
  • System.Boolean
  • System.String
  • System.Text.StringBuilder
  • System.StringComparison
  • System.DateTime
  • System.TimeSpan
  • System.TimeZone
  • System.Exception
  • System.Random
  • System.Globalization.CultureInfo
  • System.Math
  • System.Void
  • System.Func
  • System.Array
  • System.Collections.Generic.List
  • System.Collections.Generic.Dictionary
  • System.Collections.Generic.HashSet
  • System.Text.RegularExpressions.Regex
  • System.Text.RegularExpressions.Match
  • System.Text.RegularExpressions.MatchCollection
  • Omada.CommonLib.IntegerList
  • Omada.OE.Model.DataObject
  • Omada.OE.Model.DataObjects
  • Omada.OE.Model.FriendlyException
  • Omada.OE.Model.AppException
  • Omada.OE.Model.ConfigurationObjectType
  • Omada.OE.Model.UnresolvedFilterExpression
  • Omada.OE.Model.Public.ExpInnerOperator
  • Omada.OE.Model.ObjectId
  • Omada.OE.Solution.OIM.AppLogic.SurveyFeature.PostActions.ActionArguments
  • Omada.OE.Solution.OIM.AppLogic.SurveyFeature.PostActions.ApplyChanges
  • Omada.OE.Booster.Facade.FacadeFactory
  • Omada.OE.Booster.Facade.Enumerations.ExpectedCount
  • Omada.OE.Booster.Assembly.Scripting.Helpers.ScriptingDebugger
  • Omada.OE.Booster.Facade.Interfaces.IDataObjectCriteria
  • Omada.OE.Model.DataObjectLoadOptionsBase
  • System.Char
  • System.Byte
  • System.UInt32
  • System.UInt16
  • System.UInt64
  • System.Text.Encoding
  • System.Convert