Dynamic assignees and assignee groups
In the context of state flows, dynamic assignees are users who are automatically assigned a role (for example, Modifier) once they create or modify an entity or relation that is linked to a state flow.
A dynamic assignee group is a group of users who are automatically assigned a task when an entity passes through a state flow.
By default, there are three dynamic assignees:
This assignee is someone who creates content items.
This assignee is someone who modifies one of the following default relations of the block type jobs:
Modifying the following relations, however, does not result in the user being designated as a modifier in dynamic assignment:
As a result, whoever creates or modifies an entity linked to the state flow is assigned the job or operation triggered in this specific state.
This assignee is someone who modifies blocks such as M.Project.Block.
In the following example, the Under Review state in the Sitecore Content Marketing Platform (CMP)™ flow is amended to include whichever user created the content item. This dynamic assignment assigns the state flow operation, where applicable, to the creator of the object, who can then perform the review action.
In this example, demo_user creates a Sitecore CMP content item and, as the creator of the Sitecore CMP content, is dynamically assigned as a reviewer of this content.
If a relation exists between a user and an entity linked to the state flow, then this relation is also displayed.
Dynamic user assignment and user relations
In the following example, a relation is created between the user and the content entity definitions. M.Content is an entity definition enabled for state flows.
A user who has the User_Relation flag enabled is included in a dynamic user assignment. For example, in the Under Review state, the User relation flag is used to dynamically assign the user.
The demo_user has the User_Relation flag enabled and is related to the content.
As this content reaches the Under Review state, the demo user is included in this state. The relation is displayed on the Details tab of the content.
In this example, you add a relation to the User definition. As a superuser, you cannot edit this definition. If you try to add a relation from the M.Content side, User becomes the parent of the M.Content, resulting in a circular relationship. Instead, add it as a taxonomy relation, then disable all unnecessary flags.
Dynamic assignee groups
To use the Assignee groups (dynamic) functionality, you must create a relation between the UserGroup entity definition and the entity linked to the state flow.
This relationship is shown in the following diagram. Two relations are created:
- BRAND A user group.
- BRAND B user group.
As the Content passes through the CMP stateflow, dynamic assignment means that:
- If the Content is related to BRAND A, the BRAND A user group is dynamically assigned to the Review job.
- If the Content is related to BRAND B, the BRAND B user group is dynamically assigned to the Review job.
The following example shows a new member called Relation1 with a parent relation to the Content entity. With the cardinality of many to many (many Usergroup entities possibly linked to many M.Content entities):
Once this relation has been created, you can set up a dynamic assignment of user groups. Begin by clicking +Add.
This new relation opens a dialog box that lists all the relations that exist between the two entities: User Group and the Entity linked to the state flow.
In this example, the Superusers user group is added to a content item.
As this content continues through the state flow, where the Superusers flag is included, the assignment encompasses the standard defined user group and the Superusers group. The relation, for example, is included in the Under Review state of the flow. When the content reaches this stage, the Superuser group is dynamically assigned as well as the standard assignee group of M.Builtin.Approvers.
The relation between entities can also be that of a child to a parent. In the following example Relation2 is created to form a child relation from UserGroup to M.Content.
The Dynamic Group assignment still works because the relation is what matters, not the hierarchy.
You can create the relation on any entity linked to a state flow.
Can we improve this article ? Provide feedback