Main Class |
Namespace: Omada.OE.UtilityCodeAssembly
public class Main
The Main type exposes the following members.
Name | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
![]() | AddUsersToUserGroups |
Adds several users from a reference property to some user groups in another reference property, and if
removeOldUsers = true, then it will remove the existing users first.
| ||||||||
![]() | AddUserToUserGroups |
Makes a user a member of several user groups.
| ||||||||
![]() | AssignRefPropertyFromValueProperty |
CM uses values or list of values (comma or semicolon separated) and searches for data objects.
If searchPropSysName is provided, it looks for data objects where action object valuePropSysName = searchPropSysName.
Otherwise, CM checks if values are correct UIds.
If yes, it does search using object UIds. Otherwise search is done by display names.
If the target property is MultiValue, it adds new objects or replaces them, using value in clearExisting parameter.
| ||||||||
![]() | AssignSetPropertyValueToReferredObjects |
Assigns the specified set property value to a set property on the data object that is being referenced.
| ||||||||
![]() | AvoidDuplicates |
The method should check that the value of the field "fldToCheckPropSysName" on the target
does not equal to any of the values of the same property in objects of the type "masterDOTGuidStr",
If "masterDOTComparisonFilterSetPropSysName" is configured,
code method checks only for masterDOT data objects where set property "masterDOTComparisonFilterSetPropSysName"
is equal to any of the values in "masterDOTComparisonFilterCommaSeparatedSetPropValuesGuidsStr";
If shouldCheckBlackList is set to true,
then code method should also check that the value of the field "fldToCheckPropSysName" on the target
does not equal to any of the values in any Blacklist entry of the type "blackListDOTGuidStr"
with set property "blackListDOTComparisonFilterSetPropSysName"
with values "blackListDOTComparisonFilterCommaSeparatedSetPropValuesGuidsStr".
If equal, transaction should stop and display error message with text defined in "errorMessageText"
| ||||||||
![]() | CompleteActivity | The codemethod is intended to be used in request processes, where the flow is routed back to the requesting user at some point for some kind of confirmation. However, if the requesting user doesn't complete their activity within a certain time frame, the flow should continue automatically: the codemethod handles this scenario. The codemethod reassigns a certain activity instance to the identity user (typically the system user) and completes/activates a certain outgoing transition. and completes/activates a certain outgoing transition. Action object must be an activity instance. The activity must be active. The activity must have an outgoing transition with the specified transitionIndex. The transitions are ordered alphabetically by their English name. The method routes the process by activating the transition and it does this by reassigning the activity to the identity user. To use this code method, you can do the following (as an example): - Create a system timer event - Event must trigger on activities - The event filter should filter on a specific process template - The state filter should be "Active" - A filter expression should state that: active time <= x days
| ||||||||
![]() | CompleteActivityAsCurrentAssignee | The method completes the activity as the current assignee: if the activity is assigned to a group, a member within the group is assigned to the activity. The activity is completed even if the assignee rejects the activity. Important Note: This codemethod does not allow you to approve activities within the same process!
| ||||||||
![]() | CopyAssigneeToRefProperty | An activity from the process is used as the action object. The method copies the activity's assignees to a reference property on the target object. Used for a process event.
| ||||||||
![]() | CopyDataToReferredObjects |
Method is used to copy data to a (master) data object from the action data object.
The master data object is referred through a reference property on the action data object.
| ||||||||
![]() | CopyPropertyValueFromActiveUser | Obsolete. Obsolete! Use CopyPropertyValuesFromActiveUser instead! The method will set the value of a property on the action object based on the value of the same property on the active user object.
| ||||||||
![]() | CopyPropertyValueFromReferredObject |
Example: An incident object has a reference to a CI object.
A CI category is specified for the CI object.
The method can copy this CI category to the incident object.
| ||||||||
![]() | CopyPropertyValuesFromActiveUser |
Copies property values from the active user to the action object.
The method will set the value of the properties with the specified ids on the action object,
based on the value of the same properties on the active user object.
| ||||||||
![]() | CopyPropertyValuesFromReferencePath |
Method is using "ReferencePath" concept to load a data object and then to copy the value of
a property from this one to the target object.
| ||||||||
![]() | CopyPropertyValuesFromReferredObject |
Copies property values from DataObject referred in reference property
to the same properties in the ActionObject.
| ||||||||
![]() | CopyPropertyValuesFromReferredObject2 |
Copies property values from DataObject referred in reference property
to the properties in the ActionObject.
From and To properties are copied based on the order of the properties in
srcPropertySysNames and destPropertySysNames.
Eg.
srcPropertySysNames = 'Property1,Property2'
destPropertySysNames = 'Property2,Property1'
Will copy
From referenceObject.Property1 To ActionObject.Property2
From referenceObject.Property2 To ActionObject.Property1
| ||||||||
![]() | CopyPropertyValuesToReferencePath |
Method copies property values from action object to object referred via ReferencePath.
| ||||||||
![]() | CopyPropertyValuesToReferredObject |
Copies values for the supplied property system name on the action object to the data object
referred to through the property specified in referencePropertyId.
| ||||||||
![]() | CopyPropertyValuesToReferredObjects |
Copies values for the supplied property system name on the action object to the data object
referred to through the property specified in referencePropertyId.
| ||||||||
![]() | CopyPropertyValuesToReferredObjects2 |
Copies values for the supplied property system name on the action object to the data object
referred to through the property specified in referencePropertyId.
| ||||||||
![]() | CopySourcePropertyToTargetProperty |
Copies the value of source property to the target property
Both properties are on the same data object
It only works when:
- copying from one value property to another value property
- copying from one reference property to another reference property
| ||||||||
![]() | CreateDataObjectFromTemplate | Method creates a new data object of the specified type. The properties of the specified template object will be copied from the action object to the new data object, based on the settings of the specified copy rule. The method is used in master data management scenarios: when a "new object" process is completed, a new master object needs to be created based on the values of the "change request" object that was used in the process. The update events triggered on the new data object type are executed on the created data object.
| ||||||||
![]() | CreateDataObjectFromTemplate2 | Method creates a new data object of the specified type. The properties of the specified template object will be copied from the data object with id templateObjectId, based on the settings of the specified copy rule. If the templateDataObjectId = 0, the template data object will be the target object. The update events triggered on the new data object type are executed on the created data object.
| ||||||||
![]() | CreateDataObjectFromTemplateEx | Method creates a new data object of the specified type. The properties of the specified template object will be copied from the data object with id templateObjectId, based on the settings of the specified copy rule. If the templateDataObjectId = 0, the template data object will be the target object. The update events triggered on the new data object type are executed on the created data object.
| ||||||||
![]() | CreateProcessInstance | Used to create a process instance based on a timer. If the process template is an edit process, then the action object is used as the target in the new process.
| ||||||||
![]() | CreateUserFromTemplate | Method creates a new user. The properties of the specified template object will be copied from the action object to the new user, based on the settings of the specified copy rule. A property id must be provided containing the username on the action object.
| ||||||||
![]() | DeleteObject |
Delete marks the DataObject in context. The object will be purged, if parameter purge is true.
| ||||||||
![]() | DerriveConcatenatedCategory | Calculates and assigns a new value for a set property. The new value is calculated on the basis of the chosen values in 2 other set properties. The action object must contain all 3 set properties. For example, setPropertyValue1Id specifies the value "02. Medium" setPropertyValue2Id specifies the value "04. Critical" keyLength is 2 The method tries to find a value for the derrivedSetPropertyId property that begins with "0204".
| ||||||||
![]() | FormatTemplateText |
Returns a formatted text for the action object based on a template.
| ||||||||
![]() | GenerateGUID |
Generates a UId.
| ||||||||
![]() | GenerateIdentifier |
Generates an identifier (for roles etc.) based on a sequence and a prefix.
| ||||||||
![]() | GenerateRandomNumber |
Generates a random number between the specified minimum and maximum values.
| ||||||||
![]() | GenerateRandomPassword |
Generate random 8 char password such as "de5h4sdf".
| ||||||||
![]() | GetActiveUserInfo | Gets the active user's info. The code method returns the active user's first name, last name, username, and email.
| ||||||||
![]() | GetDataObjectChangeDescription | Obsolete. Method returns a text description of the differences between the first version of a data object and its current version. More precisely, the current value of each of the object's properties is compared to the first non-default value that was assigned to the object. The method is used in (SAP) master data management scenarios.
| ||||||||
![]() | GetDataObjectDifferenceDescription |
Returns description of the difference between two data objects.
| ||||||||
![]() | GetDataObjectDifferenceDescription2 | Method returns a text description of the differences between two data objects. The two data objects are not necessarily of the same data object types. The method is used in master data management scenarios.
| ||||||||
![]() | GetReferredUserInfo | Gets the information from the user who is being referred to. The code method returns information (first name, last name, username, and email) from the user being referenced.
| ||||||||
![]() | IsDateReached |
Will check if the specified date is reached
| ||||||||
![]() | MaintainUserGroupFromReferenceProperty | Method maintains the members of a user group. The members of the group are found by inspecting all the users in the system. Each user must reference another user through a reference property (typically a manager). After execution, the user group will have all the selected users (managers) as members. The method is designed to run on a timer event.
| ||||||||
![]() | MoveActionObjectToFolder |
Sets the parent of the action object to the specified newFolderId data object.
| ||||||||
![]() | MoveHelpdeskObjectToCustomerFolder | Obsolete.
The method moves the action object to the active user’s company folder.
Used by Omada Helpdesk.
| ||||||||
![]() | PopulateReferringObjectsForReferredObject |
We have the following scenario: the action object referres an object X trough the property masterObjRefPropertyId.
The objects Y1,Y2,Y3 of type referringObjTypeId are referring the object X trough a property referredTroughRefPropId.
The object Y1,Y2,Y3 have a set property filterSetPropertyId set to one of the values in filterSetPropertyValueIds.
The method will populate Y1,Y2,Y3 into the property referringObjRefPropertyId on the action object.
| ||||||||
![]() | RemoveAllInactiveUserGroupMemberships |
Removes all usergroup memberships from inactive users. Designed to run on a timer.
| ||||||||
![]() | RemoveReferenceFromReferringObjects |
The Code method finds all the dataobjects that refers the object in the property
referredPropertySysName through the properties listed in referringPropertySysNames.
It removes the reference to the object from these properties.
| ||||||||
![]() | ResetActivityAssignee |
Reassign an activity (instance) to the initial assignee. Should be used on a transition event.
| ||||||||
![]() | ResetUserPassword |
Resets the password for a user with a random generated string and notifies the user.
| ||||||||
![]() | RouteProcessOnDeadline |
Method is used on a timer event to check whether certain activities in processes of a certain type are
completed within deadline. If not, they will be autocompleted, and the process will be routed to the given transition.
| ||||||||
![]() | SaveDataObjCSV |
Method is used to save a CSV file generated from a view in the Omada temp folder.
| ||||||||
![]() | SaveDataObjCSVExtended |
Method is used to save a CSV file generated from a view.
| ||||||||
![]() | SendMailToRefferedGroup |
Sends a mail to all the users of a group specified in the reference property.
| ||||||||
![]() | SetAssigneeFromTargetPropertyValue | Method is to be used in a process-event-action (either timer-activated or transition-activated). The method updates the assignee on the action object (which must be an activity). The new assignee is found by looking in the selected value of a set property used on the process' target object. The assignee must be stated (as a user group name) in the set property value description.
| ||||||||
![]() | SetAssigneeToActiveUsersManager | Obsolete. The method updates the assignee on the action object (which must be an activity) The method can be used in a process event action (activated by either timer or transition). The method updates the assignee on the action object (which must be an activity) to the active user’s manager. The active user’s manager must be referenced in a reference property on the user object in a property where the system name = managerPropertySysName. The method is suitable for purchasing processes, etc., where the user’s manager must approve a purchase.
| ||||||||
![]() | SetTargetPropertyValue |
Sets the Set Property value.
If action object is process or activity, it updates target object.
If action object is other DOT, it updates action object.
| ||||||||
![]() | Sleep |
The CodeMethod will suspend execution for a number of milliseconds.
| ||||||||
![]() | SynchronizeTwoWayReference |
Method will synchronize the values of a two-way reference on a single ActionObject.
Example: in an ITIL scenario we operate with incidents and problems between which there is a relation.
To model the scenario in OE we have two dataobjecttypes - one for incidents and one for problems.
OE doesn't support two-way relations so to accomodate we create two reference properties called
"related problems" (placed on the incident type) and "related incidents" (placed on the problem type).
To ensure that they are synchronized this method is called whenever either an incident or a problem is created or updated.
| ||||||||
![]() | SynchronizeTwoWayReferenceFull |
Method will synchronize the values of a two-way reference between two data object types. For all objects of the two dataobjectypes.
Example: in an ITIL scenario we operate with incidents and problems between which there is a relation.
To model the scenario in OE we have two dataobjecttypes - one for incidents and one for problems.
OE doesn't support two-way relations so to accomodate we create two reference properties called
"related problems" (placed on the incident type) and "related incidents" (placed on the problem type).
To ensure that they are synchronized this method is called whenever either an incident or a problem is created or updated.
| ||||||||
![]() | TerminateProcess |
The code method terminates the process.
| ||||||||
![]() | TerminateProcessByReferencePath |
The code method terminates the processes referenced indirectly via the Action object.
The reference is described with a ReferencePath string.
The object referenced by the reference path can be an activity object, a process object or a target object.
In either case, the process related to the referenced object will be terminated.
| ||||||||
![]() | TestGetDataObjectsAVP | |||||||||
![]() | ThrowError |
| ||||||||
![]() | UpdateProcessSearchData |
The method will update the search data of one or more processes and their activities.
If the action object is a process this process will be updated,
otherwise all processes which have the target object as a target will be updated.
| ||||||||
![]() | UploadFile |
Uploads the file from the specifed filePath on the server
to the specfied file object.
|
Name | Description | |
---|---|---|
![]() | ToBool |
Converts object to boolean.
(Defined by ObjectExtensions.) |
![]() | ToDateTime |
Converts object to DateTime.
(Defined by ObjectExtensions.) |
![]() | ToInt |
Converts object to integer.
(Defined by ObjectExtensions.) |