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:
| Method | Parameters | Returns | Description |
|---|---|---|---|
AddDataObjectType() | dataObjectTypeId: int | IDataObjectCriteria | Restricts the criteria to a data object type by its numeric ID. |
AddDataObjectType() | sysnameOrGuid: string | IDataObjectCriteria | Restricts the criteria to a data object type by sysname or GUID. |
AddWhitelist() | guids: string | IDataObjectCriteria | Includes only objects matching the given comma-separated GUIDs. |
AddWhitelist() | dataObjects: DataObjects | IDataObjectCriteria | Includes only the given collection of data objects. |
AddWhitelist() | dataObjectId: int | IDataObjectCriteria | Includes only the object with the given ID. |
AddWhitelist() | idList: IEnumerable<int> | IDataObjectCriteria | Includes only objects matching the given list of IDs. |
SetWhitelist() | idList: IEnumerable<int> | IDataObjectCriteria | Replaces the whitelist entirely with the given list of IDs. |
AddBlacklist() | guids: string | IDataObjectCriteria | Excludes objects matching the given comma-separated GUIDs. |
AddBlacklist() | dataObjects: DataObjects | IDataObjectCriteria | Excludes the given collection of data objects. |
AddBlacklist() | dataObjectId: int | IDataObjectCriteria | Excludes the object with the given ID. |
AddBlacklist() | idList: IEnumerable<int> | IDataObjectCriteria | Excludes objects matching the given list of IDs. |
AddFilterExpression() | property: string, value: string, expInnerOperator: ExpInnerOperator = Equals, path: string = "" | IDataObjectCriteria | Adds a filter expression comparing a string property. |
AddFilterExpression() | property: string, value: int, expInnerOperator: ExpInnerOperator = Equals, path: string = "" | IDataObjectCriteria | Adds a filter expression comparing an int property. |
AddFilterExpression() | property: string, value: bool, expInnerOperator: ExpInnerOperator = Equals, path: string = "" | IDataObjectCriteria | Adds a filter expression comparing a bool property. |
AddFilterExpression() | property: string, value: DateTime, expInnerOperator: ExpInnerOperator = Equals, path: string = "" | IDataObjectCriteria | Adds a filter expression comparing a date/time property. |
AddFilterExpression() | property: string, value: IEnumerable<int>, expInnerOperator: ExpInnerOperator = Equals, path: string = "" | IDataObjectCriteria | Adds a filter expression comparing a property against a set of int values. |
AddFilterExpression() | property: string, value: IEnumerable<Guid>, expInnerOperator: ExpInnerOperator = Equals, path: string = "" | IDataObjectCriteria | Adds a filter expression comparing a property against a set of GUID values. |
AddProperties() | propertyIds: IList<int> | IDataObjectCriteria | Specifies which properties to load for matched objects. |
EvaluateCountExpectation() | actualCount: int | void | Evaluates a previously set count expectation against an actual count. |
SetView() | view: DataObjectView | IDataObjectCriteria | Sets the data object view used for loading. |
SetMaxObjects() | maxObjects: int | IDataObjectCriteria | Limits the maximum number of objects returned. |
MustHaveReferenceTo() | dataObjectIds: IList<int> | IDataObjectCriteria | Requires matched objects to reference the given IDs. |
MustBeReferredBy() | dataObjectUids: string | IDataObjectCriteria | Requires matched objects to be referred to by the given UIDs (string form). |
MustBeReferredBy() | dataObjectUids: IList<Guid> | IDataObjectCriteria | Requires matched objects to be referred to by the given UIDs. |
MustBeReferredBy() | dataObjectIds: IList<int>, referencePath: string = "" | IDataObjectCriteria | Requires 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[] = null | IDataObjectCriteria | Declares an expected result count with an associated error message. |
TreeNode() | treeNodeParents: TreeNodeParents, treeNodeChildren: TreeNodeChildren, treeNodes: bool, buildTree: bool | IDataObjectCriteria | Configures tree-node traversal and building behavior for hierarchical objects. |
ExpectedCountEvaluated() | count: ExpectedCount, customMessage: string = null | void | Evaluates whether the expected count condition was met, with an optional custom message. |
GetLoader() | none | IDataObjectLoader | Returns the loader that executes the criteria and loads matching data objects. |
GetReader() | none | IDataObjectReader | Returns a reader for reading property values from matched objects. |
GetWriter() | none | IDataObjectWriter | Returns a writer for modifying matched objects. |
Interface IDataObjectReader
Method reference:
| Method | Parameters | Returns | Description |
|---|---|---|---|
GetPropertyValue<T> | int propertyId, T defaultValue | T | Reads a single property by numeric property ID. |
GetPropertyValue<T> | int propertyId, T defaultValue, T defaultValueNoObjectFound | T | Same as above, but returns a distinct default when no data object could be resolved at all. |
GetPropertyValue<T> | string propertyOrRefPath, T defaultValue | T | Reads a property by sysname, or follows a reference path to a related object's property. |
GetPropertyValueUid | string propertySysname | Guid | Resolves the UID of a Set/Reference property value. |
GetReferencePropertyValueId | string propertySysname, bool throwExceptionIfNotSet = true | int | Reads a Reference/Set property value as its integer ID. |
GetReferencePropertyValueIds | string propertySysname | IntegerList | Reads a Reference/Set property value ID for every data object resolved by the reader, deduplicated. |
GetDisplayValue | string propertySysname, ExpectedCount expectedLength = ExpectedCount.Undefined, Func<string, string> formatter = null | string | Reads the display value of a property, optionally validating cardinality and formatting it. |
GetPropertyValuesDictionary<T> | string propertySysname, T defaultValue | Dictionary<int, T> | Reads one property value per resolved data object, keyed by data object ID. |
Interface IDataObjectWriter
| Method | Parameters | Returns | Description |
|---|---|---|---|
SetPropertyValueEncrypted() | property: string, value: string | DataObjectWriter | Sets a property value, encrypting it before storage. |
SetPropertyValue() | property: string, valueResolver: Func<DataObject, object[]> | DataObjectWriter | Sets a property value computed from a resolver function applied to the data object. |
SetPropertyValue() | property: string, value: object | DataObjectWriter | Sets a single property value by name. |
SetPropertyValue() | property: string, value: object[] | DataObjectWriter | Sets a multi-value property by name. |
SetPropertyValue() | propertyId: int, value: object | DataObjectWriter | Sets a single property value by property ID. |
SetPropertyValues() | values: Dictionary<int, object> | DataObjectWriter | Sets multiple property values at once, keyed by property ID. |
AddPropertyValues() | property: string, propertyValueIds: List<int> | DataObjectWriter | Adds values to a multi-value property by property value IDs. |
RemovePropertyValues() | property: string, propertyValueIds: List<int> | DataObjectWriter | Removes values from a multi-value property by property value IDs. |
CopyDataWithCopyRule() | sourceDataObjectId: int, copyRuleUid: string, excludeDestinationFields: List<string> = null | DataObjectWriter | Copies 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> =null | DataObjectWriter | Copies data from a source object instance into the target using a copy rule, optionally excluding fields. |
CreateDataObject() | dataObjectTypeId: int, parentId: int = 0 | DataObject | Creates a new data object of the given type ID, optionally under a parent. |
CreateDataObject() | dataObjectTypeUid: Guid, parentId: int = 0 | DataObject | Creates a new data object of the given type GUID, optionally under a parent. |
CreateDataObject() | dataObjectTypeSysName: string, parentId: int = 0 | DataObject | Creates a new data object of the given type sysname, optionally under a parent. |
Delete() | none | void | Deletes the current data object(s) targeted by the writer. |
DeleteDataObject() | dataObjectId: int | void | Deletes the data object with the given ID. |
DeleteDataObjects() | dataObjectIds: IEnumerable<int> | void | Deletes the data objects with the given IDs. |
Save() | none | IList<DataObject> | Saves the pending changes and returns the affected data objects. |
Save() | dataObjectId: int | DataObject | Saves changes for a single data object by ID. |
Save() | dataObjectIds: IntegerList | IList<DataObject> | Saves changes for the data objects with the given IDs. |
Save() | dataObjectCriteria: IDataObjectCriteria | IList<DataObject> | Saves changes for data objects matched by the given criteria. |
Save() | dataObjectLoader: DataObjectLoader | IList<DataObject> | Saves changes for data objects produced by the given loader. |
Save() | dataObject: DataObject | DataObject | Saves 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