-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
help.html
444 lines (436 loc) · 12.8 KB
/
help.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<title>ZenUML language Reference</title>
<style>
.highlight table td {
padding: 5px;
}
.highlight table pre {
margin: 0;
}
.highlight .gh {
color: #999999;
}
.highlight .sr {
color: #f6aa11;
}
.highlight .go {
color: #888888;
}
.highlight .gp {
color: #555555;
}
.highlight .gs {
}
.highlight .gu {
color: #aaaaaa;
}
.highlight .nb {
color: #f6aa11;
}
.highlight .cm {
color: #75715e;
}
.highlight .cp {
color: #75715e;
}
.highlight .c1 {
color: #75715e;
}
.highlight .cs {
color: #75715e;
}
.highlight .c,
.highlight .cd {
color: #75715e;
}
.highlight .err {
color: #960050;
}
.highlight .gr {
color: #960050;
}
.highlight .gt {
color: #960050;
}
.highlight .gd {
color: #49483e;
}
.highlight .gi {
color: #49483e;
}
.highlight .ge {
color: #49483e;
}
.highlight .kc {
color: #66d9ef;
}
.highlight .kd {
color: #66d9ef;
}
.highlight .kr {
color: #66d9ef;
}
.highlight .no {
color: #66d9ef;
}
.highlight .kt {
color: #66d9ef;
}
.highlight .mf {
color: #ae81ff;
}
.highlight .mh {
color: #ae81ff;
}
.highlight .il {
color: #ae81ff;
}
.highlight .mi {
color: #ae81ff;
}
.highlight .mo {
color: #ae81ff;
}
.highlight .m,
.highlight .mb,
.highlight .mx {
color: #ae81ff;
}
.highlight .sc {
color: #ae81ff;
}
.highlight .se {
color: #ae81ff;
}
.highlight .ss {
color: #ae81ff;
}
.highlight .sd {
color: #e6db74;
}
.highlight .s2 {
color: #e6db74;
}
.highlight .sb {
color: #e6db74;
}
.highlight .sh {
color: #e6db74;
}
.highlight .si {
color: #e6db74;
}
.highlight .sx {
color: #e6db74;
}
.highlight .s1 {
color: #e6db74;
}
.highlight .s {
color: #e6db74;
}
.highlight .na {
color: #a6e22e;
}
.highlight .nc {
color: #a6e22e;
}
.highlight .nd {
color: #a6e22e;
}
.highlight .ne {
color: #a6e22e;
}
.highlight .nf {
color: #a6e22e;
}
.highlight .vc {
color: #ffffff;
}
.highlight .nn {
color: #ffffff;
}
.highlight .nl {
color: #ffffff;
}
.highlight .ni {
color: #ffffff;
}
.highlight .bp {
color: #ffffff;
}
.highlight .vg {
color: #ffffff;
}
.highlight .vi {
color: #ffffff;
}
.highlight .nv {
color: #ffffff;
}
.highlight .w {
color: #ffffff;
}
.highlight {
color: #ffffff;
}
.highlight .n,
.highlight .py,
.highlight .nx {
color: #ffffff;
}
.highlight .ow {
color: #f92672;
}
.highlight .nt {
color: #f92672;
}
.highlight .k,
.highlight .kv {
color: #f92672;
}
.highlight .kn {
color: #f92672;
}
.highlight .kp {
color: #f92672;
}
.highlight .o {
color: #f92672;
}
</style>
<link href="help/stylesheets/screen.css" rel="stylesheet" media="screen" />
<link href="help/stylesheets/print.css" rel="stylesheet" media="print" />
<script src="help/javascripts/all.js"></script>
</head>
<body class="index" data-languages='["DSL"]'>
<a href="#" id="nav-button">
<span>
NAV
<img src="help/images/navbar.png" alt="Navbar" />
</span>
</a>
<div class="toc-wrapper">
<img
src="help/images/logo.png"
class="logo"
alt="Logo"
style="margin: auto"
/>
<div class="lang-selector">
<a href="#" data-language-name="DSL">DSL</a>
</div>
<div class="search">
<input
type="text"
class="search"
id="input-search"
placeholder="Search"
/>
</div>
<ul class="search-results"></ul>
<ul id="toc" class="toc-list-h1">
<li>
<a
href="#introduction"
class="toc-h1 toc-link"
data-title="Introduction"
>Introduction</a
>
</li>
<li>
<a
href="#a-few-examples"
class="toc-h1 toc-link"
data-title="A few examples"
>A few examples</a
>
</li>
<li>
<a
href="#send-a-message"
class="toc-h1 toc-link"
data-title="Send a message"
>Send a message</a
>
</li>
<li>
<a
href="#nested-message"
class="toc-h1 toc-link"
data-title="Nested message"
>Nested message</a
>
</li>
<li>
<a
href="#send-a-self-message"
class="toc-h1 toc-link"
data-title="Send a self message"
>Send a self message</a
>
</li>
<li>
<a href="#alt" class="toc-h1 toc-link" data-title="Alt">Alt</a>
</li>
<li>
<a href="#loop" class="toc-h1 toc-link" data-title="Loop">Loop</a>
</li>
<li>
<a href="#new" class="toc-h1 toc-link" data-title="New">New</a>
</li>
<li>
<a href="#async" class="toc-h1 toc-link" data-title="Async">Async</a>
</li>
<li>
<a href="#errors" class="toc-h1 toc-link" data-title="Errors"
>Errors</a
>
</li>
</ul>
<ul class="toc-footer">
<li>
<a href="https://github.com/lord/slate"
>Documentation Powered by Slate</a
>
</li>
</ul>
</div>
<div class="page-wrapper">
<div class="dark-box"></div>
<div class="content">
<h1 id="introduction">Introduction</h1>
<p>
With ZenUML, you can create and edit sequence diagrams with ease.
Since ZenUML auto-generates a sequence diagram from the text you
enter, you can focus on more important activities - modelling.
</p>
<p>
You can use ZenUml DSL to draw sequence diagram
<a href="https://www.zenuml.com">online</a> or use the
<a
href="https://chrome.google.com/webstore/detail/web-sequence/kcpganeflmhffnlofpdmcjklmdpbbmef"
>Web Sequence Chrome Extension</a
>.
</p>
<h1 id="a-few-examples">A few examples</h1>
<p><img src="help/images/Sample1.png" alt="Sample1" /></p>
<p><img src="help/images/Sample2-Alt.png" alt="Sample2" /></p>
<p><img src="help/images/Sample4-Async.png" alt="Sample4" /></p>
<h1 id="send-a-message">Send a message</h1>
<blockquote>
<p>To send a simple message, use this code:</p>
</blockquote>
<pre
class="highlight javascript tab-javascript"
><code><span class="nx">result</span> <span class="o">=</span> <span class="nx">A</span><span class="p">.</span><span class="nx">methodA</span><span class="p">(</span><span class="nx">p1</span><span class="p">,</span> <span class="nx">p2</span><span class="p">);</span>
</code></pre>
<p>It contains 4 parts:</p>
<ol>
<li>
<code>result</code> - the result of methodA. This part is omitted in
the diagram.
</li>
<li>
<code>A</code> - the entity. Any string that is a valid Java (or C#
or C) variable name is a valid <code>Entity</code> name.
</li>
<li><code>methodA</code> - the name of the message</li>
<li><code>p1, p2</code> - the parameters of this method.</li>
</ol>
<h1 id="nested-message">Nested message</h1>
<blockquote>
<p><code>B.methodB(p3, p4)</code> is the nested message</p>
</blockquote>
<pre
class="highlight javascript tab-javascript"
><code><span class="nx">A</span><span class="p">.</span><span class="nx">methodA</span><span class="p">(</span><span class="nx">p1</span><span class="p">,</span> <span class="nx">p2</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">B</span><span class="p">.</span><span class="nx">methodB</span><span class="p">(</span><span class="nx">p3</span><span class="p">,</span> <span class="nx">p4</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>
<p>
A nested message can be considered as the implementation of its parent
message (method). It must be wrapped within <code>{}</code>.
</p>
<h1 id="send-a-self-message">Send a self message</h1>
<blockquote>
<p>To send a message to the participant itself</p>
</blockquote>
<pre
class="highlight javascript tab-javascript"
><code><span class="nx">result</span> <span class="o">=</span> <span class="nx">internalMethod</span><span class="p">(</span><span class="nx">p1</span><span class="p">,</span> <span class="nx">p2</span><span class="p">);</span>
</code></pre>
<p>It contains 3 parts:</p>
<ol>
<li>
<code>result</code> - the result of methodA. This part is omitted in
the diagram.
</li>
<li><code>internalMethod</code> - the name of the message</li>
<li><code>p1, p2</code> - the parameters of this method.</li>
</ol>
<aside class="notice">
An internal message must be wrapped within `{}` as *nested message*.
</aside>
<h1 id="alt">Alt</h1>
<pre
class="highlight javascript tab-javascript"
><code><span class="k">if</span> <span class="p">(</span><span class="nx">condition1</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">A</span><span class="p">.</span><span class="nx">methodA</span><span class="p">()</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">(</span><span class="nx">condition2</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">B</span><span class="p">.</span><span class="nx">methodB</span><span class="p">()</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="nx">C</span><span class="p">.</span><span class="nx">methodC</span><span class="p">()</span>
<span class="p">}</span>
</code></pre>
<p>
<code>condition</code> can be of a <code>word</code> or a simple
expression such as <code>a < b</code>.
</p>
<h1 id="loop">Loop</h1>
<pre
class="highlight javascript tab-javascript"
><code><span class="k">while</span><span class="p">(</span><span class="nx">condition</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">A</span><span class="p">.</span><span class="nx">methodA</span><span class="p">()</span>
<span class="p">}</span>
</code></pre>
<p>
<code>while</code>, <code>for</code>, <code>foreach</code>,
<code>forEach</code> are treated equally. <code>condition</code> can
be of a <code>word</code> or a simple expression such as
<code>a < b</code>.
</p>
<h1 id="new">New</h1>
<pre
class="highlight javascript tab-javascript"
><code><span class="nx">instance</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">AClass</span><span class="p">()</span>
</code></pre>
<p>
Use <code>new</code> keyword for object creation.
<code>instance =</code> is optional.
</p>
<h1 id="async">Async</h1>
<pre class="highlight plaintext"><code>Alice->Bob: How are you?
</code></pre>
<p>Asyc message does not have a message bar on the lifeline.</p>
<h1 id="errors">Errors</h1>
<aside class="notice">
If you see any errors, try to cut a small piece of code and test it.
</aside>
</div>
<div class="dark-box">
<div class="lang-selector">
<a href="#" data-language-name="DSL">DSL</a>
</div>
</div>
</div>
</body>
</html>