4 PLATFORM INDEPENDENT ANALYSIS AND DESIGN
4.4 Navigation
4.5.1 Process Integration
In order to invoke dynamic behavior an interface between processes and navigation is needed. This is achieved by integrating the invocation of processes in the navigation model by means of process classes and process links which are derived from the corresponding Web process use cases in the requirements model.
4.5.1.1
Metamodel
The modeling elements relevant for process integration are depicted in Figure 42. The two basic constructs from the navigation metamodel node and link are specialized by introduc- ing the modeling elements process class and process link, respectively.
Each process is represented by a process activity (see 4.5.2) and a process class that is as- sociated to the corresponding Web process use case. Only the latter is relevant for process integration. In general process classes represent data that is used during execution of a process. For each process one process class is designated for integration in the navigation model. Process links are special links used for the invocation of a process. Either the source or the target (but not both) of a process link must be a process class. Following a process link to a process class starts the execution of the corresponding process activity. The input parameter of the activity must be compatible with the source content class. A process link from a process class is automatically followed upon completion of the corre- sponding process activity. The output parameter of the process activity must be compatible with the target content class. If a process class has no outgoing process links then the navi- gation context is not changed on invocation of the process.
Model Driven Software Engineering for Web Applications Node Link ProcessLink ProcessClass WebProcess Association Class 1 +/source * +/outLinks 1 +/target * +/inLinks +/webProcess 0..1
Figure 42. Metamodel for integration of processes in the navigation model
Derived Attributes
The derived attribute webProcess of a process class is defined as being the associated Web
process use case. This attribute is only defined for the process class representing the proc- ess.
context ProcessClass def : webProcess : WebProcess = if self.inLinks->isEmpty() then OclUndefined else
self.useCase->any( uc | uc.oclIsKindOf( WebProcess ) ) endif
Constraints
All ingoing and outgoing links of a process class must be process links. context ProcessClass inv ProcessClassLinkTypes :
self.inLinks()->forAll( pl | pl.oclIsTypeOf( ProcessLink ) ) and self.outLinks()->forAll( pl | pl.oclIsTypeOf( ProcessLink ) )
A process class can have at most one incoming process link and at most one outgoing process link.
context ProcessClass inv ProcessClassLinkCount : self.inLinks->size() <= 1 and self.outLinks->size() <= 1
Every process class that is reachable by following a process link must be associated to ex- actly one Web process use case.
context ProcessClass inv ProcessClassWebProcess : self.inLinks->notEmpty() implies
self.useCase->one( uc | uc.oclIsKindOf( WebProcess ) )
One end of process link must be a process class and the other end must be a navigation class.
context ProcessLink inv ProcessLinkEnds :
self.source.oclIsKindOf( NavigationClass ) and self.target.oclIsTypeOf( ProcessClass ) or self.source.oclIsTypeOf( ProcessClass ) and self.target.oclIsKindOf( NavigationClass )
Notation
The same notation as for navigation models, i.e. stereotyped UML class diagrams, is used for modeling the process integration. For a definition of the corresponding UML profile see A.5.
4.5.1.2
Tranformation ProcessIntegration
The transformation ProcessIntegration depicted in Figure 43 enhances the navigation
model by adding process classes and process links for the integration of processes. The transformation comprises one transformation rule which is outlined below and detailed in B.3.7.
Menu2IntegratedMenu
ProcessIntegration
Navigation Model With Added Menus
Navigation Model With Integrated Processes Requirements Model Menu2IntegratedMenu ProcessIntegration Navigation Model With Added Menus
Navigation Model With Integrated
Processes Requirements
Model
Figure 43. Transformation ProcessIntegration
The automatic integration of the two processes AddProject and RemoveProject of the pro-
ject manager content class is depicted in Figure 44. For the former an additional exit link was generated, because a target was defined for the corresponding Web process use case depicted in Figure 26.
Model Driven Software Engineering for Web Applications
<<menu >> P roje ctMa nagerMenu
<< process cla ss>> AddProject
<<na viga tion class>>
Projec t
<< process cla ss>> Re moveProject <<pr ocess lin k>> 1
<<pr ocess lin k>> 1 < <process link>> 1
Figure 44. Integrated navigation model for content class ProjectManager derived by trans- formation ProcessIntegration
Rule Menu2IntegratedMenu
Each Web process use case from the requirements model is mapped to a process class in the integrated navigation model. A process link connects the menu corresponding to the content class of the Web process use case to the generated process class. An outgoing process link is generated for the optional target of the Web process use case. In comparison to the rule implementation in B.3.7 the following details have been omitted below: target bindings that are not relevant for understanding the rule, and targets for the ends of the process links.
rule Menu2IntegratedMenu {
from nc : UWE!Menu (
nc.contentClass.useCase->exists( uc | uc.oclIsKindOf( UWE!WebProcess ) ) ) using
{
wps : Sequence( UWE!WebProcess ) = nc.contentClass.useCase-> select( uc | uc.oclIsKindOf( UWE!WebProcess ) )->asSequence(); wpsWithTarget : Sequence( UWE!WebProcess ) = wps->select( wp | not wp.target.oclIsUndefined() );
wpsWithoutTarget : Sequence( UWE!WebProcess ) = wps->select( wp | wp.target.oclIsUndefined() );
wpsOrdered : Sequence( UWE!WebProcess ) = wpsWithTarget->union( wpsWithoutTarget ); }
to tnc : UWE!Menu ( … ), -- target for copying source element pc : distinct UWE!ProcessClass foreach ( wp in wpsOrdered ) (
name <- let n : String = wp.name.regexReplaceAll( ' ', '' ).firstToUpper() in if UWE!WebProcess.allInstances()->select( uc |
uc.name.regexReplaceAll( ' ', '' ).firstToUpper() = n )->size() > 2 then nc.getTraceSource( 'NavigationClass2Menu' ).name else '' endif + n, …
),
pl : distinct UWE!ProcessLink foreach ( wp in wpsOrdered ) (
… ),
epl : distinct UWE!ProcessLink foreach ( wp in wpsWithTarget ) ( … ), … }
4.5.1.3
Manual Refinement
The manual refinement of the automatically derived process classes and links comprises the definition of guards for the entry process link, in order to specify under which condi- tions a process can be executed. For details about the definition of guards see 4.4.1. As de- picted in Figure 45 a guard for the process entry link to the process RemoveProject has
been defined to ensure that the collection of projects is not empty.
<<menu >> P roje ctMa nagerMenu
<< process cla ss>> AddProject
<<na viga tion class>>
Projec t
<< process cla ss>> Re moveProject <<pr ocess lin k>>
{guard = not empty self .projects }
1
<<pr ocess lin k>> 1 < <process link>> 1
Figure 45. Manually refined process classes and links for content class ProjectManager