Class UmlSequenceMessage
Represents a message exchanged between participants in a UML sequence diagram. Messages define the communications, method calls, or interactions that occur between participants in chronological order, displayed as horizontal arrows connecting the participant lifelines.
Inheritance
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class UmlSequenceMessage : Object
Remarks
In UML sequence diagrams, messages represent various types of communication:
- Synchronous calls - Method invocations that wait for a response
- Asynchronous calls - Fire-and-forget messages or events
- Return messages - Responses or return values from method calls
- Self-messages - Internal processing or recursive calls within the same participant
- Create messages - Object instantiation or initialization
- Destroy messages - Object destruction or cleanup
Examples
<SfDiagramComponent Height="600px" Model="@umlModel">
</SfDiagramComponent>
@code
{
UmlSequenceDiagramModel umlModel;
protected override void OnInitialized()
{
umlModel = new UmlSequenceDiagramModel()
{
Participants = new List<UmlSequenceParticipant>()
{
new UmlSequenceParticipant()
{
ID = "User",
Content= "User",
ShowDestructionMarker= true,
IsActor= true,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act1", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
},
new UmlSequenceParticipant()
{
ID = "Server",
Content= "Server",
ShowDestructionMarker= true,
IsActor= false,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act2", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
}
},
Messages = new List<UmlSequenceMessage>()
{
new UmlSequenceMessage()
{
ID = "MSG1",
Content = "User sends request",
FromParticipantID = "User",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG2",
Content = "Processing",
FromParticipantID = "Server",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG3",
Content = "Server sends response",
FromParticipantID = "Server",
ToParticipantID = "User"
}
}
};
}
}
Constructors
UmlSequenceMessage()
Declaration
public UmlSequenceMessage()
Properties
Content
Gets or sets the textual content of the message. This is the display text that appears along the message arrow and represents the human-readable description of the communication or method call.
Declaration
public string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the descriptive text of the message displayed between participants in the sequence diagram. This text is rendered along the message arrow and should be descriptive and user-friendly. Common formats include method signatures, operation names, or descriptive phrases. The default value is an empty string. |
Remarks
The Content property is used for visual display purposes, unlike the ID property which is used for internal referencing. The content can include method signatures with parameters, descriptive action names, or business-level descriptions of the interaction. Examples include "login(username, password)", "HTTP GET /api/users", "Process Payment", or "Validate Credentials".
Examples
<SfDiagramComponent Height="600px" Model="@umlModel">
</SfDiagramComponent>
@code
{
UmlSequenceDiagramModel umlModel;
protected override void OnInitialized()
{
umlModel = new UmlSequenceDiagramModel()
{
Participants = new List<UmlSequenceParticipant>()
{
new UmlSequenceParticipant()
{
ID = "User",
Content= "User",
ShowDestructionMarker= true,
IsActor= true,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act1", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
},
new UmlSequenceParticipant()
{
ID = "Server",
Content= "Server",
ShowDestructionMarker= true,
IsActor= false,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act2", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
}
},
Messages = new List<UmlSequenceMessage>()
{
new UmlSequenceMessage()
{
ID = "MSG1",
Content = "User sends request",
FromParticipantID = "User",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG2",
Content = "Processing",
FromParticipantID = "Server",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG3",
Content = "Server sends response",
FromParticipantID = "Server",
ToParticipantID = "User"
}
}
};
}
}
FromParticipantID
Gets or sets the identifier of the participant sending the message. This property establishes the source of the message communication and determines where the message arrow originates in the sequence diagram.
Declaration
public string FromParticipantID { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the ID of the participant that initiates the message.
This value must match the |
Remarks
The FromParticipantID is used to:
- Determine the starting point of the message arrow
- Validate message relationships during diagram rendering
- Calculate message positioning and lifeline intersections
- Support self-messages when FromParticipantID equals ToParticipantID
Examples
<SfDiagramComponent Height="600px" Model="@umlModel">
</SfDiagramComponent>
@code
{
UmlSequenceDiagramModel umlModel;
protected override void OnInitialized()
{
umlModel = new UmlSequenceDiagramModel()
{
Participants = new List<UmlSequenceParticipant>()
{
new UmlSequenceParticipant()
{
ID = "User",
Content= "User",
ShowDestructionMarker= true,
IsActor= true,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act1", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
},
new UmlSequenceParticipant()
{
ID = "Server",
Content= "Server",
ShowDestructionMarker= true,
IsActor= false,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act2", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
}
},
Messages = new List<UmlSequenceMessage>()
{
new UmlSequenceMessage()
{
ID = "MSG1",
Content = "User sends request",
FromParticipantID = "User",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG2",
Content = "Processing",
FromParticipantID = "Server",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG3",
Content = "Server sends response",
FromParticipantID = "Server",
ToParticipantID = "User"
}
}
};
}
}
ID
Gets or sets the unique identifier for the sequence message. This identifier serves as the primary key for referencing the message throughout the sequence diagram model and related components.
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String that uniquely identifies the message within the sequence diagram. This ID is used to link messages to activation boxes (StartMessageID, EndMessageID), fragments, and other diagram elements that reference specific messages. The ID must be unique within the sequence diagram and should follow standard naming conventions. The default value is an empty string. |
Remarks
The ID is case-sensitive and should be descriptive yet concise. Common naming patterns include sequential numbering (e.g., "MSG1", "MSG2") or descriptive names (e.g., "LoginRequest", "AuthResponse").
Examples
<SfDiagramComponent Height="600px" Model="@umlModel">
</SfDiagramComponent>
@code
{
UmlSequenceDiagramModel umlModel;
protected override void OnInitialized()
{
umlModel = new UmlSequenceDiagramModel()
{
Participants = new List<UmlSequenceParticipant>()
{
new UmlSequenceParticipant()
{
ID = "User",
Content= "User",
ShowDestructionMarker= true,
IsActor= true,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act1", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
},
new UmlSequenceParticipant()
{
ID = "Server",
Content= "Server",
ShowDestructionMarker= true,
IsActor= false,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act2", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
}
},
Messages = new List<UmlSequenceMessage>()
{
new UmlSequenceMessage()
{
ID = "MSG1",
Content = "User sends request",
FromParticipantID = "User",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG2",
Content = "Processing",
FromParticipantID = "Server",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG3",
Content = "Server sends response",
FromParticipantID = "Server",
ToParticipantID = "User"
}
}
};
}
}
MessageType
Gets or sets the type of UML sequence message (e.g., Synchronous, Asynchronous). The message type determines the visual representation of the arrow and indicates the communication pattern between participants.
Declaration
public UmlSequenceMessageType MessageType { get; set; }
Property Value
Type | Description |
---|---|
UmlSequenceMessageType | A UmlSequenceMessageType enumeration value indicating the type of message. Different message types are rendered with distinct arrow styles to convey the nature of the communication. The default value is typically Synchronous. |
Remarks
Common UML sequence message types include:
- Synchronous - Solid arrow with filled arrowhead (caller waits for response)
- Asynchronous - Solid arrow with open arrowhead (fire-and-forget)
- Return - Dashed arrow (return value or response)
- Self - Arrow that loops back to the same participant
- Create - Arrow pointing to a participant being instantiated
- Destroy - Arrow ending with destruction marker
Examples
<SfDiagramComponent Height="600px" Model="@umlModel">
</SfDiagramComponent>
@code
{
UmlSequenceDiagramModel umlModel;
protected override void OnInitialized()
{
umlModel = new UmlSequenceDiagramModel()
{
Participants = new List<UmlSequenceParticipant>()
{
new UmlSequenceParticipant()
{
ID = "User",
Content= "User",
ShowDestructionMarker= true,
IsActor= true,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act1", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
},
new UmlSequenceParticipant()
{
ID = "Server",
Content= "Server",
ShowDestructionMarker= true,
IsActor= false,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act2", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
}
},
Messages = new List<UmlSequenceMessage>()
{
new UmlSequenceMessage()
{
ID = "MSG1",
Content = "User sends request",
FromParticipantID = "User",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG2",
Content = "Processing",
FromParticipantID = "Server",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG3",
MessageType = UmlSequenceMessageType.Asynchronous
Content = "Server sends response",
FromParticipantID = "Server",
ToParticipantID = "User"
}
}
};
}
}
ToParticipantID
Gets or sets the identifier of the participant receiving the message. This property establishes the destination of the message communication and determines where the message arrow terminates in the sequence diagram.
Declaration
public string ToParticipantID { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the ID of the participant that receives the message.
This value must correspond to the |
Remarks
The ToParticipantID is used to:
- Determine the ending point of the message arrow
- Validate message relationships during diagram rendering
- Calculate message positioning and lifeline intersections
- Support self-messages when ToParticipantID equals FromParticipantID
- Trigger activation boxes on the receiving participant
Examples
<SfDiagramComponent Height="600px" Model="@umlModel">
</SfDiagramComponent>
@code
{
UmlSequenceDiagramModel umlModel;
protected override void OnInitialized()
{
umlModel = new UmlSequenceDiagramModel()
{
Participants = new List<UmlSequenceParticipant>()
{
new UmlSequenceParticipant()
{
ID = "User",
Content= "User",
ShowDestructionMarker= true,
IsActor= true,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act1", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
},
new UmlSequenceParticipant()
{
ID = "Server",
Content= "Server",
ShowDestructionMarker= true,
IsActor= false,
ActivationBoxes= new List<UmlSequenceActivationBox>()
{
new UmlSequenceActivationBox() { ID = "act2", StartMessageID= "MSG1", EndMessageID= "MSG3" }
}
}
},
Messages = new List<UmlSequenceMessage>()
{
new UmlSequenceMessage()
{
ID = "MSG1",
Content = "User sends request",
FromParticipantID = "User",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG2",
Content = "Processing",
FromParticipantID = "Server",
ToParticipantID = "Server"
},
new UmlSequenceMessage()
{
ID = "MSG3",
Content = "Server sends response",
FromParticipantID = "Server",
ToParticipantID = "User"
}
}
};
}
}