Class ActorNameResolver
java.lang.Object
io.jmix.aitoolsflowui.view.chat.support.ActorNameResolver
Resolves a human-readable actor name for a user-authored
AiChatMessage.
For messages authored by the currently logged-in user, returns the user's
instance name (preferred) or, failing that, the username. For messages
authored by someone else (admin viewing another user's conversation),
returns the raw createdBy string. Falls back to a configurable
default if both sources are blank.
The add-on does not assume a particular User class, so unlike the
CRM equivalent this resolver relies on MetadataTools.getInstanceName(java.lang.Object)
to render whichever User entity the consumer application uses.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolve(@Nullable AiChatMessage message, String defaultActorName) Resolves the display name of the actor that authored the given message.
-
Field Details
-
currentAuthentication
-
metadataTools
-
-
Constructor Details
-
ActorNameResolver
public ActorNameResolver()
-
-
Method Details
-
resolve
Resolves the display name of the actor that authored the given message.- Parameters:
message- message whose author is resolveddefaultActorName- name to fall back to when the author cannot be determined- Returns:
- the resolved actor name
-