Custom DRF Events Handling
Copy
Previously we discussed how DAC automatically maintains a record of every instance of every Derived Relationship in a table. It does so using an internal event handling mechanism which can also be leveraged and extended for configuration and customization of events in a DAC domain.
As of 12.0 SP5 an Event Handler is available under the DRF that provides event types and default methods OOTB. Events fire when item membership in a domain changes – for instance, when a Part item is added or removed from a BOM structure under an active DAC AC Policy. The event runs the associated method, executing business logic before unidr_Relationships are committed (persisted).
To expose the Event Handlers relationship tab:
Log in as Admin.
Edit the dr_RelationshipFamily ItemType.
Set ‘Default Structure View’ to TabsOn.
Figure 55.
You will see the tab below when DRF is opened.
Aras provides 2 OOTB Event Handlers:
dr_HandleItemVersion is a core function and should not be edited or removed.
dr_EnsurePropagatedAccess checks whether adding a new item to the domain would provide permissions for the user that were not granted prior to the event.
The dr_EnsurePropagatedAccess Event Handler
To add an item to a Domain,
A user must have the can_get access right to the item. This handler is configured to enforce can_get OOTB; see the Event Data column in Figure 54.
An administrator can specify additional Access Types in a comma separated list, e.g., can_get,can_delete.
If the user does not have any of the specified Access Types when adding an item to a Domain, an error is raised and the operation is rolled back.
Figure 56.
The OnBeforePersistRelationships event will execute any method under the Event Handler column in Execution Order, with Event Data parameters if provided. Therefore, a knowledgeable implementor can provide an alternate method to dr_EnsurePropagatedAccess or even remove the Event entirely as business rules require.
Figure 57.