Introduction to SysML in Visual Paradigm SysML Tutorial for Visual Paradigm 1 Table of Contents Visual Paradigm User Interface Sleek Interface Classic Interface Block Definition Diagram New Project Packages Diagrams Blocks Definition Diagram Block Connections and Relationships Part Association Shared Association Generic Connections Generalizations Parts References Style and Formatting Value Property Multiplicities Connector Formatting Activity Diagrams Initial Node Activity Object Nodes Object Flow and Control Flow Decision Box Join Node Activity Final Node Swim Lanes SysML Tutorial for Visual Paradigm 2 Overview A model is an abstraction of phenomena in the real world; a Meta Model is yet another abstraction, highlighting properties of the model itself. The Visual Paradigm software application based on the System Modeling Language (SysML) allows the description of the elements and related attributes. In this tutorial, we create a Meta Model (MM) of the Building Programming Process taking into consideration various programming processes including actors or stakeholders active in those processes. The Meta Model shall describe the important entities, related attributes and the cross relationships of the whole process. This tutorial shows how to describe interactions among objects with Activity diagrams in SysML. Activities are a sequence of actions that take inputs, add value and provide outputs. Through this tutorial we will use the Stakeholders SysML model as case study and diagram an Activity model representing a simple Building Programming Process. Learning Objectives Understanding what is a Meta Model (MM) Creating a Meta Model using SysML Understanding the relationships across elements of the Meta Model Understanding hierarchical relationships Understanding and modeling horizontal relationships Defining abstract object types Understanding the “has”, “belongs to” and “is a” relationships among Building Blocks Understanding the notion of multiplicity Understanding Actions and Activities Understanding Flow Types Understanding value property and custom property Understanding Presentation techniques and Style and Formatting of elements SysML Tutorial for Visual Paradigm 3 Pre-requisites Visual Paradigm Academic License Installed Glossary The following acronyms are used in this document. DC: Double‐click on left button LC: Left‐click— also specified as “click” as the default mouse operation RC: Right‐click MM: Meta Model SysML: System Modeling Language MD: Magic Draw SysML editor BB: Building Block act: Activity Diagram SysML Tutorial for Visual Paradigm 4 1. Visual Paradigm User Interface After installing the academic license version of Visual Paradigm Software on your machine, go to your desktop and DC Visual Paradigm.exe file to open the application. By default the software loads in Sleek User Interface. We will switch to Classic User Interface, as for beginners that’s more convenient to work with. But if you feel confident enough, you can try the Sleek User Interface as well. Sleek User Interface 1. Toolbar A tabbed toolbar that allows you to perform various operations in Visual Paradigm. 2. Diagram Editor The diagram will be displayed in the Diagram editor. 3. Status Bar Notifications are shown here. You can also open the message pane and description pane from the bottom right of the status bar. Ref: http://www.visual-paradigm.com/ Go to Windows or Tools menu on top and click on Application Options. From the Application Options dialog box, go to appearance tab. Click on Classic User Interface from top. SysML Tutorial for Visual Paradigm 5 Classic User Interface: 1. 2. 3. 4. 5. 6. Menu Bar Tool Bar Diagram Navigator Properties Pane Message Pane Diagram pane SysML Overview: In SysML, the diagram is not the model, the tree is the model. The diagram is a “visualization of the model”. In other words, if you delete the entire diagram or elements from the diagram, you are not necessarily deleting them from the model. The diagram can represent the entire model, only branches of the model, or limited levels or views of the model. The «block» is the basic unit of structure in SysML and can be used to represent hardware, software, facilities, personnel, or any other system element. In the next section, we would understand the relevance of a Block in SysML process models, with the help of a Block Definition Diagram. SysML Tutorial for Visual Paradigm 6 2. Block Definition Diagram In this tutorial, we create a Meta Model (MM) of the Building Programming Process taking into consideration various programming processes including actors or stakeholders active in those processes. The Meta Model shall describe the important entities, related attributes and the cross relationships of the whole process. New Project Go to File –> New Project, to make a new project and name it “Building Programming Process in the New Project dialog box. Select Data type set with UML and click on Create Blank Project button at the bottom. New Package Go to Model Explorer on left and RC on the project name. Then go inside the Model Element menu and click on Package as shown. Create a new Package named Block Diagrams. SysML Tutorial for Visual Paradigm 7 Similarly, create another new package and name it Activity Diagrams. You can see both of the created packages on the Model Explorer window on the left. New Diagram RC on the Block Diagrams Package and go under the Sub Diagrams menu and click on New Diagram. SysML Tutorial for Visual Paradigm 8 In the new diagram dialog box click on SysML Diagrams from the left and click on Block Definition Diagram on the right as shown. Another Way To Do It When you Create your New Project, you will see the adjoining screen showing different Diagram Types which can be built in Visual Paradigm. Select SysML Modeling to see the set of Diagrams you can make under this domain. Click on Block Definition Diagram ( BDD) to start a new BDD In the Block Definition Diagram Editor, you would be asked to name your Diagram on top right as shown. Give it a name of “Concerned Stakeholders” SysML Tutorial for Visual Paradigm 9 New Block 1. On the Diagram Toolbar on left click on the Block Icon. 2. Then Click on the Diagram Editor on the right to place the Block 3. Name the Block “Healthcare Trust” Using the Resource-Centric Interface If you move your mouse pointer over a shape, you will see a number of icons surrounding it. Those are known as the resource icons. They together form the resource-centric interface. You can at times use these buttons directly for fast work flow instead of selecting the same commands from the Diagram Toolbar. SysML Tutorial for Visual Paradigm 10 3. Block Relationships and Connections Shared Association Shared Association is a way to represent the “has” relationship. In the Shared Association relationship the part exists by itself. Part Association Part Association represents the “has” relationship in a slightly different manner than Shared Association. It means that the subparts do not exist by themselves. They only exist as subparts of the higher level Block. Generalization Generalization represents the “is a” relationship. Which means the child is a type of its parent. Part Association Make two new Blocks “Clinics” and “Hospital” which will be under Healthcare Trust as its part. Click and hold on the Association button on the Diagram Toolbar. Now click on the Part Association button. Now first click on the Healthcare Trust Block and then drag your mouse to point to Clinics Block and then release your mouse. Similarly make the part association for the Hospital Block. SysML Tutorial for Visual Paradigm 11 Part Property The Part Property attribute represents the “has” relationship. For example, the Healthcare trust Block “has” the Clinic and the Hospital. In other words, Part Property identifies all the parts of the Block. Connector Formatting In order to change the format of the connector, RC on the connector, in Style and Formatting‐> Connector Style‐> Rectilinear. This will help set the connectors as orthogonal, which renders the whole diagram cleaner and more legible for the user. SysML Tutorial for Visual Paradigm 12 Generic Connector Make a new block, name it "Programming Group". Click on Generic Connector on the Diagram Toolbar on the left. Click on the Healthcare Trust and then click on the Programming Group to make the connection. This is used to make a nondirectional relationship between the Healthcare Trust Block and Programming Group Block. SysML Tutorial for Visual Paradigm 13 Shared Association Make three more Blocks which would be part of Programming Group, namely, Nurse Consultant, Architect and Healthcare Strategists. But these blocks can exist without the existence of Programming Group Block, thus we need to use Shared Association Connection between Programming Group and these three new blocks as shown. Make the Shared Association connection similar to the process of making Part Association. Generalization Make new blocks Medical Staffs and General Practitioner’s under Clinics Block as shown. Further make Social Workers, Attendants, Interns and Charge Nurse Blocks, all of which are Medical Staffs. So we use generalization connection as shown from the diagram toolbar on the left. After clicking Generalization from the Diagram Toolbar, click Medical Staffs Block first and drag your mouse to point towards Social Workers Block and then release it when the mouse is hovered over the Social Worker Block. Do the same for Attendants, Interns and Charge Nurse Block SysML Tutorial for Visual Paradigm 14 Edit Block Specification or Properties To change Specification of a block RC the Social Worker block, and click on Open Specification or you can press Enter. Add Property to a Block Go to Properties tab, and then click Add button to add a custom property. In the attribute specification dialog box give a name to the property “number”. Change multiplicity to 25. Press Ok to add the property to the block. SysML Tutorial for Visual Paradigm 15 Style and Formatting of a Block To change the style and formatting of any block you can RC the block and go to Styles and Formatting -> Formats. In the Formats dialog box you can change the line weight, line type, background color, font size and font type of the block. You can play around with multiple combinations of these. SysML Tutorial for Visual Paradigm 16 Value Property RC on clinics block and click on add -> value property menu. In the Value Type Specifications, in the general tab as shown, give a name to the value type. Name it Area Dimension Similarly create a quantity kind, name it Numbers and create a new unit “ sq.m.” ‘ Value Properties are attributes of any Block that can be represented as a primitive value such as dimension, area, volume, weight, thickness, location, or name. Value is a single attribute. SysML Tutorial for Visual Paradigm 17 ‘ Multiplicity RC on the connector between Hospitals block and Wards block. Go to Role B (Wards) then select Multiplicity button. This section basically takes care of how many numbers of such blocks are there. For this case it is how many wards are there in the Hospital. Select “other” from the drop down menu and manually enter the number of instances that elements needs to be. SysML Tutorial for Visual Paradigm 18 Final Block Definition Diagram ( BDD) SysML Tutorial for Visual Paradigm 19 4. Activity Diagrams and Process Flow An Activity is a sequence of single actions that takes inputs and provides outputs. Visual Paradigm graphically represents Activities in diagrams. The formal Model is described in the Model Explorer on the left. Creating Actions Actions are singular tasks executed within an Activity. In other words, an Activity is a collection of Actions. Actions take inputs and provide outputs, and they are represented as rounded squares New Activity Diagram To create a new activity diagram, RC the Activity Diagram Package in the Model Explorer, and click on Sub Diagrams -> New Diagram. In the diagram creation dialog box click on activity diagram type on the right from the UML diagram sets as shown on the left side. SysML Tutorial for Visual Paradigm 20 Initial Node & Activity Start the Activity by adding the Initial Node. Then add a new activity from the Diagram Toolbar. Name it “ Study the initial set of inputs : Develop Vision for the Project” Control Flow ( flow between activities) Make connection from the Initial Node, to this activity with the help of Control Flow button on the Diagram Toolbar. SysML Tutorial for Visual Paradigm 21 Object Flow ( flow of an object to and from an activity) Object Flow represents the flow of an Object Node exchanged between Actions within the Activity. It is similar to a typical output-input relationships between two functions. On the Diagram Toolbar, click on the object node button and then click on the Diagram Pane. Name it “Initial Design Vision Guideline Documents”. These are represented as sharp rectangle shapes. Join Node Similarly, make another activity “Start Gathering More Information as Input for Building Programming” and in this activity there are 5 more documents inputs as objects. ( as explained previously) ` SysML Tutorial for Visual Paradigm 22 We can use join node (the thick black bar) shown in the adjoining image to connect them together to the activity node. Decision Box To test any decision by the active stakeholders in the workflow process we can use the decision node box, which can have output either as Yes or No. Click on the Decision Node Button from the Diagram Toolbar and type in the testing question in the Decision Box. SysML Tutorial for Visual Paradigm 23 When each activity takes place, there can be input to the activity in the form of Object Nodes as previously mentioned. Similarly, there are output objects from the activity, which also can be represented by object nodes from the Diagram Toolbar as shown. Activity Final Node Click on the Activity Final Node button on the Diagram Toolbar on the left. This is used to terminate the activity. Make a control flow from the last Activity to the Activity Final Node to finish the whole Activity Diagram as shown. SysML Tutorial for Visual Paradigm 24 Swimlanes From the Diagram Toolbar on left add the Vertical Swimlanes element on the diagram area. By Default it would be added with two columns. Each columns or partitions should represent one Block (Healthcare Trust & Programming Group for this example). The Swimlanes can have multiple columns or rows (in case of horizontal Swimlanes). Each column or rows has to be represented by a Block which owns responsibility for the activities represented in those columns or rows. RC the Swimlanes and open its specification. Select Partition and click on Open Specification In this specification dialog box, click on represents button and select Block and then “ Healthcare Trust” Block to let the partition or 1st column represent all the activities by the Healthcare Trust Block. Also, rename partition manually to “ Healthcare Trust” Similarly do the same for the other partition and this time select the Programming Group. Remember both Healthcare Trust and Programming Group have relationship in the Block Definition Diagram. SysML Tutorial for Visual Paradigm 25 After you make the Swimlanes with appropriate Blocks as the partitions, you need to drag and drop the activity diagram onto the Swimlanes. You have to selectively place activities and objects in the respective partition, whose representative block is the block responsible for those activities. When you drag the activities and hover over any of the partitions of the Swimlanes, the partition becomes highlighted and the user interface displays it by a greyish selection around the partition as shown. Final Activity Diagram SysML Tutorial for Visual Paradigm 26