Survey event definition
The event definition concept also covers survey data. It enables you to define event definitions in Omada Identity that are triggered when a question/object in a survey is routed from one workflow step to another, or when the time limit for answering a survey question has expired and therefore it is now overdue.
This allows you to set up events based on the survey actions without the use of custom post action handlers. This can be used, for example, for the following purposes:
When an access request has been approved or rejected in an approval survey, the system automatically sends an email notification to the requester.
If the time limit has been exceeded, the system automatically sends an email notification to the person assigned to answer a survey question.
In the event definitions, it is possible to select survey object types as defined in a published survey template.
Create an event definition triggered in the access request approval survey template
You can create an event definition that is triggered when an approver decides to approve a request in the access request approval survey template:
-
Go to Setup > Administration > Data management > Event definitions.
-
Click New.
-
In the New event definition page, go to the Details for event definition section and enter the name of the event definition in the name field. For example: Send mail on approval.
-
In the Event is triggered when section, select the An existing object is updated checkbox.
-
In the Triggers on objects of this type field, select Survey objects for ApproveRequestedAccess.
-
If needed, add filters by clicking the Filter button and filling in the required data in the popup.
-
Create an email action and an email template for it.
infoYou can also add filter expressions to the event definition using the properties available in shadow data object type named Survey objects for (system name of the survey template).
Launch a survey from an event definition
The Survey schedule feature enables you to create an Event definition which triggers the launch of a survey with a code method. The code method can be configured with a dynamic deadline value for the survey and property values on the action object can be mapped to the survey scope variables and survey settings. This section describes how to create an Event definition which launches a survey when the Event definition is triggered. For doing that, follow these steps:
-
Create a new Survey schedule object for the survey template of the survey which should be launched.
-
Navigate to Setup > Administration > Data management > Survey schedules view. Click New.
-
In the Schedule section, check the Used in event checkbox. Selecting this checkbox removes the required value flag for all the scope variables and survey settings.
-
Fill out the fields for the survey schedule.
infoFor scope variables and survey settings you can prefill the values or keep them empty even if they require value. The values must then be mapped in the Code method on the Event definition.
-
Save the Survey schedule and reopen it.
-
Find and copy the UId of the Survey schedule. Press and hold Ctrl + right click on the form. Select Form data UId or Debug information and copy the UId.
-
Navigate to Setup > Administration > Data management > Event definitions view and click New.
-
When the Event definition is configured, add a new Action and select Execute code method.
-
In the Assembly field Select the Omada.OE.Solution.OIM.Assembly.dll assembly.
-
In the Class name field select Omada.OE.Solution.OIM.Assembly.PackagedSolution.SurveyFeature.
-
In the Name of method field select LaunchSurvey.
-
Paste the UId of the Survey schedule object created earlier in the surveyScheduleUId parameter.
In the scopeVariables and surveySettings parameters, it is possible to map property values from the action object to specific scope variables and survey settings. The following Fixed fields are also supported:
- Id
- Type
- Number
- DisplayName
- CreateTime
- CreatedBy
- ChangeTime
- ChangedBy
- DeleteTime
- DeletedBy
- Locked
For scope variables the mapping string has the following format:
[Scope variable name as defined in Survey template (starting with @)]=[System name of property or fixed field on Action object], for example, @Identity=Id.
For survey settings the mapping string has the following format:
[Survey setting name as defined in Survey template]=[System name of property or fixed field on Action object].
The surveyId parameter is an Out parameter which returns the id of the launched survey.