SE Lab
0 0

المرجع السريعCheat sheet

كل صيغ Mermaid التي تحتاجها لمخطط التسلسل في صفحة واحدة.Every Mermaid sequence-diagram syntax you need, on one page.

المشاركونParticipants

participant API
مشارك (صندوق)Participant (box)
actor U as User
إنسان أو نظام خارجي (رجل صغير)Human / external system (stick figure)
participant OS as Order Service
معرّف قصير واسم معروض طويلShort id, long display name
box Backend
  participant A
  participant B
end
تجميع مشاركينGroup participants

الرسائلMessages

A->>B: call
متزامن: ينتظر الردSynchronous: waits for reply
B-->>A: result
رد / استجابةReply / response
A-)B: event
غير متزامن: أرسل وانسَAsync: fire-and-forget
A-xB: lost
رسالة فشلت أو لم تصلFailed / lost message
A->>A: validate
رسالة ذاتية (معالجة داخلية)Self-message (internal work)
A->B: plain
خط بلا رأس (نادر)Line without arrowhead (rare)

التفعيلActivation

A->>+B: request
B-->>-A: response
+ يبدأ و - ينهي شريط التفعيل+ starts, - ends the activation bar
activate B
deactivate B
الصيغة الطويلة لنفس الشيءLong form of the same thing

المقاطع المركّبةCombined fragments

alt success
  ...
else failure
  ...
end
if / else — فرع واحد يحدثif / else — exactly one branch
opt has coupon
  ...
end
if بدون elseif without else
loop every 5s
  ...
end
تكرارRepeat
par
  ...
and
  ...
end
بالتوازيIn parallel
break limit reached
  ...
end
اخرج من التدفقExit the flow
critical transfer
  ...
option failure
  ...
end
منطقة حرجة مع بدائل الفشلAtomic region with failure options

التوضيحAnnotation

Note right of A: text
ملاحظة بجانب مشارك (right of / left of)Note beside a participant
Note over A,B: text
ملاحظة فوق مشاركَينNote spanning two participants
autonumber
ترقيم الرسائل تلقائيًاNumber messages automatically
rect rgba(0, 150, 255, 0.15)
  ...
end
تظليل مرحلةHighlight a phase
%% comment
تعليق لا يظهر (في سطر مستقل)Hidden comment (own line)
هندسة البرمجيات · السنة الرابعة — تقدّمك محفوظ في هذا المتصفح فقط.Software Engineering · 4th year — your progress is saved in this browser only.