4 PLATFORM INDEPENDENT ANALYSIS AND DESIGN
4.5 Process
4.5.2 Process Data and Flow
4.5.2.1 Metamodel
Process classes are used for process data modeling as depicted in Figure 46. Process prop-erties, i.e. attributes of a process data class, capture the user input. A content class may be defined for a process class for the definition of a context for the input data represented by the process properties. If a content class is defined then an edit property may be defined for a process property with the impact that on the one hand the initial value shown to the user is determined from the edit property. On the other hand, changes to the process property are forwarded to the edit property. The attribute rangeExpression can be used to define a simple expression for the range of values a process property can receive. If a content class is defined for the corresponding process class, then this expression may reference the specified content class.
121
ProcessProperty rangeExpression[0..1] : String
ProcessClass
{ordered, subsets ownedAttribute}
Property
{subsets class}
Class 0..1
+contentClass
+processClass 1
+processProperties
*
+editProperty 0..1
Figure 46. Metamodel for the process data modeling
For process flow modeling only a small extension to UML activity elements has been made as depicted in Figure 47. A process flow is modeled with a special process activity which has an association to the Web process use case from the requirements model on the one hand and to the process class representing the process on the other hand. Further, a special user action is used for modeling interactions with the user of the Web application.
The effect of this action is to present the corresponding process data class to the user (cf.
4.6). He or she can enter data corresponding to the process properties of the process class, and when the user has finished entering data, this data is available at the output pins of the action. Each output pin corresponds to one process property of the process class. If a con-tent class is specified for a process class corresponding to a user action then the user action must have an input pin with a type conforming to the type of the content class. Figure 47 also shows the supported modeling elements for activities from the UML metamodel (model elements with white background). Figure 48 and Figure 49 show the supported control node and object node types, respectively.
Model Driven Software Engineering for Web Applications
Operation CallOperationAction CallBehaviorAction
Behavior
UserAction OutputPin
ControlFlow
ProcessClass ActivityEdge
ObjectFlow Behavior
ProcessActivity
InputPin WebProcess ProcessClass
ControlNode {redefines ownedBehavior}
Activity
ObjectNode ActivityNode
Action {redefines context}
+source
1 +outgoing *
+target
1 +incoming *
+processClass 1 +processActivity
1
+processClass 1
0..1
+node
*
1 +/webProcess
1 +/input {ordered}*
1 +/output
*{ordered}
Figure 47. Metamodel for the process flow modeling
123
ActivityFinalNode
ForkNode MergeNode
FlowFinalNode DecisionNode JoinNode
ControlNode
FinalNode
Figure 48. UML control nodes
ActivityParameterNode
DataStoreNode CentralBufferNode ObjectNode
Pin
InputPin OutputPin
Figure 49. UML object nodes
Derived Attributes
The derived attribute webProcess of a process activity refers to the webProcess attribute of the corresponding process class representing the process.
context ProcessActivity def : webProcess : WebProcess = self.processClass.webProcess
Constraints
The type of a process property must be either a data type, i.e. a primitive type or an enu-meration type, or a content class.
Model Driven Software Engineering for Web Applications
context ProcessProperty inv ProcessPropertyType :
self.type.oclIsKindOf( DataType ) or self.type.oclIsTypeOf( Class )
If an edit property is defined for a process property then a content class has to be assigned to the corresponding process class and the edit property has to be one of the owned proper-ties of this content class or one of its super classes.
context ProcessProperty inv ProcessPropertyEditProperty : self.editProperty->notEmpty() implies
self.processClass.contentClass.allParents()->including( self.processClass.contentClass )->
collect( c | c.ownedAttribute )->flatten()->includes( self.editProperty )
The designated process class for a process activity must have an incoming link.
context ProcessActivity inv ProcessActivityProcessClass : self.processClass.inLinks->notEmpty()
A process activity must have exactly one input parameter and at most one output parame-ter. This implies that it must have exactly one input activity parameter node and at most one output activity parameter node.
context ProcessActivity inv ProcessActivityParameter :
self.parameter->select( p | p.direction = #in )->size() = 1 and self.parameter->select( p | p.direction = #out )->size() <= 1 and self.parameter->select( p | p.direction = #inout )->size() = 0 and self.parameter->select( p | p.direction = #return )->size() = 0
The content class of the source navigation class of the process link connecting to the ess class of the process activity has to conform to the type of the input parameter of a proc-ess activity.
context ProcessActivity inv ProcessActivityInputParameter :
let source : NavigationClass = self.processClass.inLinks->any().source in
let inputParameter : Parameter = self.parameter->select( p | p.direction = #in )->first() in source.contentClass.conformsTo( inputParameter.type )
If the process class of a process activity has an outgoing link, then the output parameter has to conform to the content class of the target of this outgoing link. Additionally, the process activity must not have an activity final node.
context ProcessActivity inv ProcessActivityOutputParameter : self.processClass.outLinks->size() = 1 implies
self.parameter->select( p | p.direction = #out )->size() = 1 and not self.node->exists( n | n.oclIsKindOf( ActivityFinalNode ) ) and let target : NavigationClass = self.processClass.outLinks->any().target in
let outputParameter : Parameter = self.parameter->select( p | p.direction = #out )->first() in outputParameter.type.conformsTo( target.contentClass )
If the process class of a process activity does not have an outgoing link, then the process activity must have an activity final node.
125
context ProcessActivity inv ProcessActivityFinalNode : self.processClass.outLinks->isEmpty() implies
self.node->exists( n | n.oclIsKindOf( ActivityFinalNode ) )
A process activity must not have an initial node.
context ProcessActivity inv ProcessActivityInitialNode : not self.node->exists( n | n.oclIsKindOf( InitialNode ) )
If the process class of a user action is associated to a content class then exactly one input pin has to be defined for the user action and its type has to conform to the content class.
Otherwise, no input pin must be defined and at least one incoming control flow has to enter the user action.
context UserAction inv UserActionInput :
if self.processClass.contentClass->isEmpty() then
self.input->isEmpty() and self.incoming->notEmpty() else
self.input->size() = 1 and self.input->forAll( pin |
pin.type.conformsTo( self.processClass.contentClass ) ) endif
For each output pin of a user action a process property of the associated process class has to exist with its name matching the name of the output pin and its type conforming to the type of the output pin.
context UserAction inv UserActionOutput :
self.output->forAll( pin | self.processClass.processProperties->exists( p | p.name = pin.name and p.type.conformsTo( pin.type ) ) )
Notation
Stereotyped UML class diagrams are used for modeling the process data and stereotyped UML activity diagrams are used for modeling the process flow. For a definition of the cor-responding UML profile see A.5.