• Keine Ergebnisse gefunden

4 PLATFORM INDEPENDENT ANALYSIS AND DESIGN

4.5 Process

4.5.2 Process Data and Flow

4.5.2.3 Manual Refinement

(

name <- source.contentClass.name.firstToLower(), type <- source.contentClass,

),

-- create process data class inputPC : UWE!ProcessClass (

name <- pc.name + 'Input',

contentClass <- source.contentClass, ownedAttribute <- pp

),

pp : distinct UWE!ProcessProperty foreach( cp in source.contentClass.allOwnedAttribute()->

select( p | p.type.oclIsKindOf( UWE!DataType ) and not p.isMultivalued() ) ) (

name <- cp.name, type <- cp.type, lower <- cp.lower, upper <- cp.upper, editProperty <- cp ),

}

Model Driven Software Engineering for Web Applications

this approach, either the page for a validation project or for a user project is then shown to the user.

The process data required for the process flow of the process AddProject is depicted in Figure 55. For each user action a process class was defined. The process class ProjectKind-Input captures the selection of a project kind. Therefore a special enumeration type Pro-jectKind was defined. The process class AddValidationProjectInput corresponds to the pa-rameters of the operation addValidationProject and therefore two attributes of type String are required. For the operation addUserProject an additional attribute validationProject is required for the process class AddUserProjectInput. The selection of a validation project is optional, hence the multiplicity of the attribute is 0..1. Additionally, a rangeExpression has to be defined for attributes which are neither of primitive type nor enumerations, to express in terms of an expression in the expression language the collection from which the value of the attribute should be chosen. In this case the collection is given be the property valida-tionProjects of the content class given be the specified contentClass for the process class (see below).

Additionally, the definition of the general Web process AddProject requires an extension of the content model as depicted in Figure 56. On the one hand the operations addValida-tionProject and addUserProject, that are invoked by the introduced call operation actions, have to be added to the content class ProjectManager. On the other hand a derived attrib-ute validationProjects has to be introduced which is used for the selection of a validation project. Note that the expression language is not expressive enough to express the value of this attribute directly. When generating code for the content model a getter operation get-ValidationProjects is generated that has to be completed by the developer to return the set of available validation projects.

For simple processes which require the input of a value other than a primitive type or an enumeration, the automatically derived process data has to be refined by the developer in order to define the corresponding rangeExpression properties as already explained above.

In the running example this is the case for the process RemoveProject as depicted in Figure 58. Additionally, it was chosen to add a further user action to confirm the remove action, see Figure 57. The input is represented by a particular process class which uses the special enumeration type YesNoEnum. Depending on the output of this confirm user action either the corresponding call operation action is triggered or the process terminates because a to-ken reaches the activity final node directly.

Edit processes do not require manual refinement, but for the running example it was cho-sen not to let the user edit all attributes of the corresponding content class. Therefore, the

135

automatically generated attribute id was removed from the automatically generated process class EditUserProject as depicted in Figure 59.

ProjectManage r : Projec tMa nager

addUserProject

targe t result

name d escription validationPr oject

<<user action >>

AddUserProjectInput d escription

name validationPr oject

proje ctMa nager

addV alidationProject targe t

name description

result

<< user acti on>>

AddValidationProject Input

name description

<<use r action>>

P roje ctKindInput projectKin d

Project : Project

[va lidationProject] [userPro ject]

Figure 54. Manually refined process flow for process AddProject

Model Driven Software Engineering for Web Applications

<<process class>>

AddUse rProject Input

<<process class>>

contentClass = DANUBIA::Con tent::Pro jectManager

<<p roce ss class>>

AddProject

-na me : String -de scription : Stri ng

-validationP roject : Valida tionP roject [0..1]

<<process class>>

AddValidationProjectInput -name : Stri ng

-descrip tion : String -projectKind : ProjectKind

<< process cl ass>>

ProjectKindInput

<<enu mer ation >>

Project Kind

validationProje ct userProject

< <process prope rty>>

ran geExpression = self.validationPro jects

1 1 1

Figure 55. Manually specified process data for process AddProject

ProjectManager -/validationProje cts : Val idatio nProject [*]

+ addVali datio nProject( name : String, de scription : Str ing ) : Va lidationProject

+ addUse rProject( name : String, description : Stri ng, validationProje ct : ValidationPro ject ) : UserProject + remove Project( proje ct : P roject )

Figure 56. Refined content model for process AddProject

137

ProjectMana ger : Project Manager

<<u ser actio n>>

ConfirmRemoveProjectInput decision

<<user action>>

RemoveProjectInput pr oject pr ojectManager

rem ove Project pr oject target

[no]

[yes]

Figure 57. Manually refined process flow for process RemoveProject

<<pro cess class> >

Conf irmRemoveProjectInput -decision : YesNo Enum

<<p roce ss class>>

Re mov eProjectInput -pr oject : Project

<<process class>>

RemoveProject

<<enu mer ation >>

YesNoEnum ye s

no

<<pr ocess class> >

contentClass = DANUBIA::Conte nt::P rojectManage r

<<p roce ss p roperty> >

rangeExpression = self.projects

1 1

Figure 58. Manually refined process data for process RemoveProject

Model Driven Software Engineering for Web Applications

< <pro cess class> >

Edit UserProjectInput

<< process class>>

EditUse rProjec t

1

-name : Stri ng -descrip tion : String

< <pro cess class> >

contentCl ass = DANUBIA::Conte nt::UserProject

Figure 59. Manually refined process data for process EditUserProject