Skip to main content
Version: On prem: 15.0.2

Code methods

A code method is a representation of a C# method. A number of code methods is delivered out of the box but you can also define them on your own.

Code methods can be used in event definitions where it is possible to map data object properties to the parameters of a code method. You can use code methods to run business logic in Omada Identity. They help workflows and processes work, for example, when you need to delegate specific resources from one user to another user in a given time frame, you can use a code method to easily handle the relevant updates and synchronizations in Omada Identity.

The code methods documentation contains configuration, parameters, and usage information of the code methods used to integrate them into the business processes designed in the Omada Identity. You can find the usage details of the available code methods in the code method documentation file.

tip

You must have a process data object type and a process template in place before you can apply a code method to them. You can also used them in global event definitions.

Nested events

Code methods are executed on events. See Exemplary configuration for more details.

A code method which updates a data object may cause events to fire, that is, start an event chain. Whether nested events are fired or not depends on the implementation of the code method. Some code methods have an input parameter to enable or disable nested events. The parameter can, for instance, be named skipEvents.

note

Code methods with an Out parameter update the current action object. An Out parameter does not fire nested events.

Code assemblies

Code methods are available for use in Omada Identity when the assemblies that contain them are properly added. You can only use a code method if its code assembly is available in Omada Identity.

For an overview of available code assemblies, go to Setup > Administration > More > Code Assemblies to go to the Code Assemblies view. Here, you can see a list of the available code assemblies on your system.

code-method

You can also click each assembly to view the classes and methods contained in the assembly.

code-method

Migrate code methods

The following code methods were moved from the Omada.OE.Booster.Assembly.dll to the Omada.OE.UtilityCodeAssembly.dll code assembly in the Omada Identity repository:

  • UpdateShadowSurveyObjectPropertyValue
  • CopyValuesFromContextObjectToReferringObjectsMatchingView
  • GenerateUniqueValue

That is, if you want to use the above-mentioned code methods, you can find them in the Omada.OE.UtilityCodeAssembly.dll code assembly.

To migrate the code methods from the deprecated code assembly to the maintained versions in Omada.OE.Solution.OIM.Assembly.dll, follow these steps:

  1. Go to Setup > Administration > Timers and create a new timer by clicking New.

  2. Enter a Name and any start date for a new timer and click OK.

  3. Go to Setup > Administration > Event Definitions and create a new event definition by clicking New.

  4. Enter a Name.

  5. In the Event triggered when field, uncheck the default value and select This timer executes.

  6. In the timer dropdown field, select the newly created timer.

  7. In the Triggers on object of type field, select Folder.

  8. In the Maximum number of objects handled field, enter 1 to prevent issues on large data sets.

  9. Click Apply.

  10. In the Event Definition action panel, click New.

  11. Check the Execute code method action and click Ok.

  12. In the Assembly field, select the Omada.OE.Booster.Assembly.dll assembly.

  13. In the Class name field, select Omada.OE.Booster.Assembly.CodeMethods.ValueGenerator.

  14. In the Name of method field, select ConvertAndMigrate.

  15. Click OK to save.

  16. Go back to the Event Definition detail page and click Run timer to run the migration.

Once the migration is complete, remember to do the following:

  • Delete the event definition from the Event Definitions list.
  • Delete the timer from the Timers list.
note

Additionally, the following code methods were moved from Omada.OE.Booster.Assembly.dll to Omada.OE.Solution.OIM.Assembly.dll:

  • MergeReferencePropertyValues
  • CheckIfSetPropertyHasValue
  • LaunchSurveyEx.
Limitation
  • Some code methods prevent the triggering of other event definitions.
  • Some code code methods have a parameter in which it can be specified whether to trigger events or not.
  • Some code methods will always trigger events (if defined).

For details, consult the code methods documentation.