Was this page helpful?

UML Sequence Diagrams

    Vendor
    MindTouch
    Type Script
    Categories Graphs
    Requires MindTouch Core 9.02 or later
    Status Beta
    License Free/Open Source
    Manifest http://scripts.mindtouch.com/umlsequence.xml

     

    Install Script
    To add  this script to your site, enter the address of your MindTouch installation (ex: http://www.mindtouch.com) and click the Add Script button.  This will open your control panel and prepopulate the necessary values.  You will still need to manually add configuration settings if required.  Note that no changes are made to your site until you confirm the action in your control panel.
    Your site address:     


    Table of Contents

    Description

    This extension creates UML sequence diagrams using the free service at http://www.websequencediagrams.com/.

    See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.


    Functions

    umlsequence.diagram(diagram : str, style : str) : xml

    Embed UML sequence diagram.

    Parameters:

    NameTypeDescription
    diagramstrUML sequence diagram description
    stylestr(optional) style for UML sequence diagram (one of 'default', 'earth', 'modern-blue', 'mscgen', 'omegapple', 'qsd', 'rose', 'roundgreen', or 'napkin'; default: 'default')


    Script Source

    <extension>
      <title>UML Sequence Diagrams</title>
      <copyright>Copyright (c) 2006-2010 MindTouch Inc.</copyright>
      <description>This extension creates UML sequence diagrams using the free service at http://www.websequencediagrams.com/.</description>
      <uri.help>http://developer.mindtouch.com/App_Catalog/UML_Sequence_Diagrams</uri.help>
      <namespace>umlsequence</namespace>
    
      <requires host="MindTouch Core 9.02" />
    
    	<function transform="pre">
        <name>diagram</name>
        <description>Embed UML sequence diagram.</description>
        <param name="diagram" type="str">UML sequence diagram description</param>
    		<param name="style" type="str" optional="true">style for UML sequence diagram (one of 'default', 'earth', 'modern-blue', 'mscgen', 'omegapple', 'qsd', 'rose', 'roundgreen', or 'napkin'; default: 'default')</param>
    		<return>
          <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
            <body>
              <div class="wsd" eval:wsd_style="$style ?? 'default'">
                <pre><eval:expr value="$diagram"/></pre>
              </div>
    					<script type="text/javascript" src="http://www.websequencediagrams.com/service.js" />
    				</body>
    			</html>
        </return>
      </function>
    </extension>
    


    Samples

      Output

    To embed the UML sequence diagram:

    1. Create a Formatted block of text.
    2. Enter the UML sequence diagram description (see manual for notation).
    3. Select umlsequence.diagram from Transformations menu in editor.
    Alice->Bob: Authentication Request
    alt successful case
        Bob->Alice: Authentication Accepted
    else some kind of failure
        Bob->Alice: Authentication Failure
        opt
            loop 1000 times
                Alice->Bob: DNS Attack
            end
        end
    else Another type of failure
        Bob->Alice: Please repeat
    end 
    Alice->Bob: Authentication Request
    alt successful case
        Bob->Alice: Authentication Accepted
    else some kind of failure
        Bob->Alice: Authentication Failure
        opt
            loop 1000 times
                Alice->Bob: DNS Attack
            end
        end
    else Another type of failure
        Bob->Alice: Please repeat
    end

    To embed the UML sequence diagram using the 'napkin' style:

    1. Create a Formatted block of text.
    2. Enter the UML sequence diagram description (see manual for notation).
    3. Select umlsequence.diagram from Transformations menu in editor.
    4. Switch to source mode and change the <pre> element to:
      <pre function="umlsequence.diagram($, 'napkin')">
    User->A: DoWork
    activate A
    A->B: <<createRequest>>
    activate B
    B->C: DoWork
    activate C
    C-->B: WorkDone
    destroy C
    B-->A: RequestCreated
    deactivate B
    A->User: Done
    
    User->A: DoWork
    activate A
    A->B: <<createRequest>>
    activate B
    B->C: DoWork
    activate C
    C-->B: WorkDone
    destroy C
    B-->A: RequestCreated
    deactivate B
    A->User: Done

     

    Was this page helpful?
    Tag page (Edit tags)
    You must login to post a comment.
    Powered by MindTouch 2010
    Powered by MindTouch 2010