 Hello and welcome to the session on Unified Modeling Language. In this video, we learn how to draw activity diagrams for a software system to be designed. At the end of this session, students will be able to understand action states and activity states, transitions, branches, forks, joints and swim lanes, analyze the above entities for a software system and draw an activity diagram representing designs to be used for software development. You have already learnt about class diagram, object diagram, use case diagram and interaction diagrams in the earlier videos. Now pause the video for a while and try to answer this question. Which is the next diagram after developing interaction diagrams in UML? There is answer, it is the activity diagram. The contents we are going to cover are activity diagram and introduction followed by an activity diagram with the help of an example. Activity diagrams are one of the diagrams in the UML for modeling the dynamic aspects of systems. It is essentially a flow chart showing flow of control from activity to activity. This involves modeling the sequential and possibly concurrent steps in a computational process. With an activity diagram, we can also model the flow of an object as it moves from state to state at different points in the flow of control. Activity diagrams may stand alone to visualize, specify, construct and document the dynamics of a society of objects or they may be used to model the flow of control of an operation. Activity diagrams commonly contain action states and activity states, transitions and objects. Consider the workflow associated with building a house. First, we select a site. Next, we appoint an architect to design the house. Once settled on the plan, the developer asks for bits to price the house. Once agreed on a price and a plan, construction can begin. Then permits are secured, ground is broken, the foundation is poured, the framing is erected and so on until everything is done. We are then handed the keys and a certificate of occupancy and we take position of the house. Although that is a tremendous simplification of what really goes on in a construction process, it does capture the critical path of the workflow. In a real project, there are lots of parallel activities among various states. Electricians can be working at the same time as plumbers and carpenters for example. We will also encounter conditions and branches. For example, depending on the result of soil's test, we might have to blast, dig or float. There might even be loops. For example, a building inspection might reveal code violations that result in scrap and rework. In modeling software intensive systems, we have a similar problem. How do we best model a workflow or an operation, both of which are aspects of the systems dynamics? We can model these dynamic aspects using activity diagrams. An activity diagram is essentially a flow chart that emphasizes the activity that takes place over time. Now what is an activity? An activity is an ongoing non-atomic execution within a state machine. Activities ultimately result in some action which is made up of executable atomic computations that result in a change in state of the system or the return of a value. Actions encompass calling another operation, sending a signal, creating or destroying an object or some pure computation such as evaluating an expression. Activity diagrams may contain simple and composite states, branches, spokes and joints. Action states and activity states are just special kinds of states in a state machine. When we enter an action or activity state, we simply perform the action or the activity and when we finish, control passes to the next action or activity. Figure shows an example of action state. We can see bid plan as a simple action and index equal to lookup e plus 7 as an expression which is again an action state. Here is an example showing activity states. We have process bill b as an activity state and also do construction as another. Here we can see entry oblique set log where set log is a special state labeled as entry action. When the action or activity of a state machine completes, flow of control passes immediately to the next action or activity state. We specify this flow by using transitions to show the part from one action or activity state to the next. In the UML, we represent a transition as a simple directed line, the initial state with a solid ball and stop state with a solid ball inside a circle as shown in figure. We have a start state indicated with a darkened bubble which changes to select site next to commission architect and finally to a stop state as indicated with a darkened bubble inside a circle. Simple and sequential transitions are common but they are not the only kind of path we will need to model a flow of control. As in a flow chart, we can include a branch which specifies alternate paths taken based on some Boolean expression. As figure shows, we represent a branch as a diamond. A branch may have one incoming transition and two or more outgoing ones. On each outgoing transition, we place a Boolean expression which is evaluated only once on entering the branch. As figure shows, after release work order, we have a condition to be evaluated materials not ready which is termed as a guard expression. If it evaluates to true, we branch to reschedule otherwise in case materials ready, we branch to assigned tasks. When we are modeling workflows of business processes, we might encounter flows that are concurrent. In the UML, we use a synchronization bar to specify the forking and joining of these parallel flows of control. A synchronization bar is rendered as a thick horizontal or vertical line. For example, consider the concurrent flows involved in controlling an audio device that mimics human speech and gestures. As figure shows, a fork represents the splitting of a single flow of control into two or more concurrent flows of control. A fork may have one incoming transition and two or more outgoing transitions, each of which represents an independent flow of control. Below the fork, the activities associated with each of these paths continues in parallel. As figure shows, prepare for speech is forked into gesture and decompress. Again, decompress is forked into sync mouth and stream audio. These two are next joined into a cleanup process. To partition the activity states on an activity diagram into groups, each group representing the business organization responsible for those activities, we use swim lanes. Each swim lane has a name unique within its diagram. It represents a high level responsibility for part of the overall activity of an activity diagram. It may eventually be implemented by one or more classes. In an activity diagram partitioned into swim lanes, every activity belongs to exactly one swim lane but transitions may cross lanes. As figure shows, we have three swim lanes created, one termed as a customer, the other being sales and the third one being the warehouse. Each has its independent flow of control, customer following two request product. Then from request product, it may change to or change into the next swim lane as process order. And this can also change into a lane of warehouse with full materials. Objects may be involved in the flow of control associated with an activity diagram. For example, in the workflow of processing an order, the vocabulary of your problem space will also include such classes as order and will. Instances of these two classes will be produced by certain activities such as process order will create an order object. Other activities may modify these objects. For example, ship order will change the state of the order object to filled. You can watch all these things in the given figure. Now having learnt all these concepts related to activity diagram, pause the video again for a while and try to answer this question. How an activity diagram for the construction process using the concepts that you have learnt? Here is the answer. We start with an initial state which changes to select site followed by commission, architect, develop plan, bid plan which has a branch. If not accepted, it again changes to the same action state labeled as bid plan. Otherwise it changes to. Do site work and do trade work which are the two folks created which are next join into finish construction and finally it reaches the final state where after this we have a house constructed for us and in between you can also watch the other details being the various action states, concurrent folks, activity states with submachine, concurrent joints, object flows with the process named as certificate of occupancy which is received after completion of the construction process. Thank you.