Relation Field Type
Description:
The relation
field type is used to create relationships between different case types. It allows you to link cases together, creating a network of related data that can be navigated and queried. This field type is essential for creating complex data relationships and cross-referencing information across different case types within your application.
Elasticsearch Mapping: object
YAML Definition
- name: related_cases
type: relation
display_name: "Related Cases"
guidance: "Select cases that are related to this one."
required: false
readonly: false
hidden: false
relation: ""
cardinality: "oneToMany"
item_type: ""
Attributes
-
name (string): Required.
The unique identifier for the field. -
type (string): Required.
Must be set torelation
for relation fields. -
display_name (string): Optional.
The label displayed in the user interface. If not provided, a formatted version ofname
is used. -
guidance (string): Optional.
Help text or instructions for the field, assisting users in understanding what related cases to select. -
required (boolean): Optional.
Iftrue
, at least one related case must be selected before submission. Default:false
. -
readonly (boolean): Optional.
Iftrue
, the field is read-only and cannot be edited by the user. Default:false
. -
hidden (boolean): Optional.
Iftrue
, the field is hidden from the user interface. Default:false
. -
relation (string): Optional.
Related case type reference. -
cardinality (string): Optional.
Relationship cardinality. Options:oneToOne
,oneToMany
,manyToOne
,manyToMany
. Default:oneToMany
. -
item_type (string): Optional.
Type of related items.
Examples
Basic Relation Field:
- name: related_claims
type: relation
display_name: "Related Claims"
guidance: "Select claims that are related to this policy"
relation: "claim"
cardinality: "oneToMany"
item_type: "claim"
One-to-One Relation:
- name: primary_contact
type: relation
display_name: "Primary Contact"
guidance: "Select the primary contact for this case"
relation: "contact"
cardinality: "oneToOne"
item_type: "contact"
required: true
Many-to-Many Relation:
- name: team_members
type: relation
display_name: "Team Members"
guidance: "Select team members assigned to this project"
relation: "user"
cardinality: "manyToMany"
item_type: "user"
Readonly Relation Field:
- name: parent_case
type: relation
display_name: "Parent Case"
readonly: true
relation: "case"
cardinality: "oneToOne"
item_type: "case"
Usage Notes
- Relationship Types:
- oneToOne: Single related case (e.g., primary contact).
- oneToMany: Multiple related cases from one source (e.g., related claims).
- manyToOne: Many cases related to one target (e.g., team members).
- manyToMany: Complex relationships between multiple cases.
- Case Type References:
- Use
relation
to specify the target case type. - Use
item_type
to define the type of related items. - Ensure that referenced case types exist in your system.
- Use
- Required Relations:
- Set
required: true
for essential relationships. - Useful for mandatory associations like primary contacts or parent cases.
- Set
- Readonly Relations:
- Use
readonly
for system-managed relationships. - Common for automatically created relationships or calculated associations.
- Use
- Data Navigation:
- Relation fields enable navigation between related cases.
- Support for bidirectional relationship traversal.
- Useful for creating data hierarchies and networks.
- Use Cases:
- Policy Management: Linking policies to claims, beneficiaries, and agents.
- Project Management: Connecting projects to tasks, team members, and deliverables.
- Customer Management: Relating customers to orders, support tickets, and accounts.
- Document Management: Linking documents to cases, versions, and approvals.
- Workflow Management: Connecting workflow steps, approvals, and participants.
- Performance Considerations:
- Complex relationships may impact query performance.
- Consider indexing strategies for frequently accessed relationships.
- Optimize for common relationship traversal patterns.
- Data Integrity:
- Ensure referential integrity between related cases.
- Handle cascading updates and deletions appropriately.
- Consider circular reference prevention.
- User Experience:
- Provide clear guidance on what relationships to create.
- Consider the complexity of relationship selection interfaces.
- Support for search and filtering in relationship selection.
- Reporting and Analytics:
- Relation fields enable complex reporting across case types.
- Support for relationship-based metrics and KPIs.
- Enable network analysis and relationship mapping.
By incorporating the relation
field type into your schema, you create powerful data relationships that enable complex data modeling and cross-referencing across different case types within your application.