Assignment within the Assignment rule sets

All assignment rules in the Assignment folder use the Assignment engine. In working within the context of the assignment rules, use the following assignment properties.
Primary assignment
entity.CurrentAssignment
This property returns the current assignment, regardless of whether you attempt to perform primary or secondary assignment. If you attempt to use it for secondary assignment, then the property returns the same object as the CurrentRoleAssignment property.
Secondary assignment
entity.CurrentRoleAssignment
This property returns null if you attempt to use it for primary assignment.

Secondary assignment and the Assignment rules

UserRoleAssignment entities share the rule set of their primary entities. Thus, PolicyCenter assigns the UserRoleAssignment entities for an activity using the Activity Assignment rule sets, and so on. It is for this reason that assignment statements in the rules always use the CurrentAssignment formulation, such as the following:
  • Activity.CurrentAssignment.assignUserAndDefaultGroup( user )

It is important for rules to use this syntax, because it allows PolicyCenter to use the rules (in this case) for both activities and activity-related UserRoleAssignment entities.