| | 100 | }}} |
| | 101 | |
| | 102 | A more complex example: |
| | 103 | |
| | 104 | [[Image(complex_sequence.png)]] |
| | 105 | |
| | 106 | {{{ |
| | 107 | [:pic:''' |
| | 108 | .PS |
| | 109 | copy "\full\path\to\sequence.pic"; |
| | 110 | |
| | 111 | # Define the objects |
| | 112 | actor(U, ""); |
| | 113 | object(G,"g:GUI"); |
| | 114 | placeholder_object(Dummy1); # more space |
| | 115 | placeholder_object(D); |
| | 116 | step(); |
| | 117 | |
| | 118 | # Message sequences |
| | 119 | active(G); |
| | 120 | step(); |
| | 121 | |
| | 122 | create_message(G,D,"db:DB"); |
| | 123 | active(D); |
| | 124 | step(); |
| | 125 | inactive(D); |
| | 126 | |
| | 127 | async(); # use asynchrone messages (not-filled arrowheads) |
| | 128 | |
| | 129 | comment(D,C,down 1 right, wid 1 ht 0.7 "waiting for" "condition" "dbMailbox") |
| | 130 | |
| | 131 | message(U,G,"openBrowser"); |
| | 132 | message(G,D,"query()"); active(D); |
| | 133 | message(D,G,"result"); inactive(D); |
| | 134 | |
| | 135 | connect_to_comment(D,C) |
| | 136 | |
| | 137 | message(U,G,"scroll"); |
| | 138 | message(G,D,"query()"); active(D); |
| | 139 | message(D,G,"result"); inactive(D); |
| | 140 | |
| | 141 | connect_to_comment(D,C) |
| | 142 | |
| | 143 | message(U,G,"Exit"); |
| | 144 | step(); |
| | 145 | begin_frame(G,F,"OnExit"); |
| | 146 | message(G,D,"shutdown()"); inactive(G); active(D); |
| | 147 | comment(G,C,down .2 right .2, wid 2 ht 0.25 "wait for cond. dbShutdown") |
| | 148 | step(); |
| | 149 | comment(D,C,right, wid 2 ht 1 \ |
| | 150 | "all queries preceeding the" \ |
| | 151 | "shutdown in the mailbox" \ |
| | 152 | "are answered already." \ |
| | 153 | "DbQuery-Objects can" \ |
| | 154 | "be destroyed") |
| | 155 | message(D,G,"done"); inactive(D); active(G); |
| | 156 | |
| | 157 | sync(); |
| | 158 | destroy_message(G,D,""); |
| | 159 | |
| | 160 | step(); |
| | 161 | end_frame(D,F); |
| | 162 | |
| | 163 | step(); |
| | 164 | inactive(G); |
| | 165 | |
| | 166 | # Complete the lifelines |
| | 167 | step(); |
| | 168 | complete(G); |
| | 169 | complete(U); |
| | 170 | .PE |
| | 171 | |
| | 172 | ''';'args: -F HersheySans --bitmap-size 1000x1000';'crop'] |