3.6 Completing Activity Diagrams


To complete the specification of activity diagrams, OCL expressions can be used in the same ways as in interaction diagrams:

  • To indicate instances

  • To specify conditions

  • To specify actual parameter values

For activity diagrams, an OCL expression can be used to indicate the instance that is executing an activity. The contextual instance for all expressions in the diagram is the instance that executes (or controls) the overall activity that contains this diagram as a specification of its internal implementation.

Activity diagrams are also used to specify the flow of a complete system or business. In that case no object executes the overall activity. (One might argue that the system or company executes the overall activity.) Therefore, the keyword self cannot be used. See Section 3.8 for a further discussion of the implications of this case.

Figure 3-10 shows the specification of the operation addService(s:Service, p:ProgramPartner) of class LoyaltyProgram . This diagram contains examples of all possible uses of OCL. The first activity (from the top) takes one actual parameter: s.level . This the ServiceLevel level from the Service s . Both the first and second activities from the top are executed by the contextual instance indicated by the keyword self , whereas the middle activity is executed by the program partner instance that is the parameter p , and the last one is executed by parameter s . The conditions shown at both choices are simple OCL expressions.

Figure 3-10. Activity diagram specifying operation addService

graphics/03fig10.gif



Object Constraint Language, The. Getting Your Models Ready for MDA
The Object Constraint Language: Getting Your Models Ready for MDA (2nd Edition)
ISBN: 0321179366
EAN: 2147483647
Year: 2003
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net