scieee AI-readable full text Open interactive document viewer

Supporting process reuse in PROMENADE

Ribó Trujillo, Josep M.,Franch Gutiérrez, Javier

Abstract

Process reuse (the ability to construct new processes by assembling already built ones) and process harvesting (the ability to build generic processes that may be further reused, from existing ones) are two crucial issues in process technology. Both activities involve defining a set of mechanisms, like abstraction, adaptation, composition, etc. which are appropriate to achieve their goals. In this report, we define a general framework to process reuse and harvesting that proposes a complete set of mechanisms to deal with both activities. This general framework is particularized to the context of a process modelling language to model software processes, called PROMENADE. A definition of the identified reuse and harvesting mecha-nisms is proposed in the context of PROMENADE. Finally, two process reuse case studies which composes various reuse mechanisms are presented.

Full text

1 Supporting Process Reuse in PROMENADE Josep M. Ribó1, Xavier Franch2 1 Universitat de Lleida C. Jaume II, 69 E-25001 Lleida (Catalunya, Spain) [email protected] 2 Universitat Politècnica de Catalunya (UPC), c/ Jordi Girona 1-3 (Campus Nord, C6) E-08034 Barcelona (Catalunya, Spain) [email protected] Abstract. Process reuse (the ability to construct new processes by assembling already built ones) and process harvesting (the ability to build generic processes that may be further reused, from existing ones) are two crucial issues in process technology. Both activities involve defining a set of mechanisms, like abstraction, adaptation, composition, etc. which are appropriate to achieve their goals. In this report, we define a general framework to process reuse and harvesting that proposes a complete set of mechanisms to deal with both activities. This general framework is particularized to the context of a process modelling language to model software processes, called PROMENADE. A definition of the identified reuse and harvesting mechanisms is proposed in the context of PROMENADE. Finally, two process reuse case studies which composes various reuse mechanisms are presented. 1. Introduction Modularity and reuse capabilities in the context of process technology refer to the definition of a process model by means of reusing other process models already defined. Process reuse is a crucial feature in process technology since if we are able to rely on already built process models as pieces that will be assembled in the construction of a new one, instead of constructing it from the scratch, this will result in a modular and probably more efficient model construction. There are several issues that are connected with reuse: the ability to identify and generalize useful parts of already constructed process models in order to be reused later (harvesting); the adaptation of these models to be effectively reused in the construction of a new one; the ability to compose adequately different models in the construction of a new one; the projection of those interesting aspects of a process model; the ability to select a built model from a repository to be reused in the construction of a new model; model configuration managements, etc. These and other issues concerning modularity-reuse capabilities within a PML (both in the fields of workflow management and software process modelling, SPM) have been addressed in the literature [Chr94, Kal96, AC96, Jacc96, Per96, Car97, Kru97, PTV97, JC00, RRN01]. Although some process reuse frameworks have been proposed [JC00, RRN01] and there are various languages that cover this issue [INCO96, Bog95, Car97, Jacc96, AC96, ABC96, EHT97], we are not aware of any PML that offers a wide range of reuse mechanisms along with a standard notation to represent them. This absence has a negative impact in the usability of current PMLs for modelling real cases. In this respect, the objectives of our approach are the following: • To provide a powerful and expressive reuse framework focused on the language mechanisms that are necessary in the context of process technology to achieve reuse. This leads to the identification of a set of reuse mechanisms. Due to the objectives of our work, we only focus on modelling issues. Therefore, we do not consider other aspects (like model retrieval and configuration management) that are also relevant to reuse. 2 • To propose a particular definition of the identified mechanisms in the context of a specific PML. This definition should include the features of expressiveness (ability to model most of the situations) and standardization (the reuse mechanisms will be mapped into UML) and should support the identification and application of process patterns (i.e., common solutions to common problems that may be adapted and reused). The defined reuse operators have been incorporated into the PROMENADE metamodel (which is an extension of the UML metamodel. See [RF00, RF02]). In this report we restrict to the reuse features of PROMENADE. A description of the language can be found in [RF00, RF01]. Section 2 presents an expressive framework for process reuse, which is centered in the necessary reuse mechanisms. Section 3 presents the definition of process patterns in PROMENADE as a way to achieve parameterization and instantiation of SPMs. Section 4 presents SPM morphisms which will be necessary to define the reuse operators of generalization, specialization, renaming, projection, composition, which are desctibed in sections from 5 to 9. Section 10 presents an example of process reuse and section 11 contains the conclusions. 2. A framework for software process modularity/reuse We devote this section to the presentation of a framework for reuse which focuses specifically on the mechanisms that a PML should provide in order to help achieve reuse. This framework also presents the various reuse strategies that make use of these mechanisms. Afterwards, sections 5 to 9 show the specific definition of the reuse mechanisms in PROMENADE. 2.1 A mechanism-centered framework for process reuse Traditionally, three levels of abstraction have been established in the process modelling literature for PMs (see, for instance, [DKW99]) yielding to three different types of models: • Process pattern: An abstract model that offers a template solution to a common problem. This model may be parameterized and/or contain non-refined elements. It may be customized to meet the requirements of a particular process and/or combined with other process patterns or enactable models. A more detailed description of process patterns along with their modelling in PROMENADE can be found in section 3. • Enactable model: A particular process model ready to be enacted. It may come either from the adaptation (in particular, instantiation) of a process pattern, or from the combination of other process models or have been created ad-hoc. The PML may incorporate delayed binding mechanisms so that it may contain an incomplete process descriptions. • Enacting model: An instantiation of an enactable model. If the enactable model contains some incomplete process description, it will be completed at enactment time. In the context of process reuse, we keep this notation just changing the term process pattern for template model. The term process model may refer to a model at any of the three levels. We remark that an enactable model may contain some not-implemented tasks to be refined during enactment, using some delayed binding mechanism, as presented below). 3 Process pattern (template model) Abstraction mechanisms Adaptation mechanisms Abstraction mechanisms Composition mechanisms Composition mechanisms BOTTOM-UP harvesting Process pattern (template model) Adaptation mechanisms TOP-DOWN reuse BOTTOM-UP reuse+harvesting Process pattern (template model) + Abstraction and adaptation mechanisms Abstraction and adaptation mechanisms Enactable model Enacting model Delayed binding mechanisms BOTTOM-UP reuse Enactable model Enacting model + Enactable model Adaptation mechanisms Adaptation mechanisms Delayed binding mechanisms Fig. 1: Modularity/reuse framework More precisely, the notion of process reuse refers to a pair of general and complementary activities which are involved in it: • Harvesting: the process of transforming one or more PMs (enactable models or process patterns) into one process pattern so that it can be reused afterwards. • Reuse: the process of transforming one or more PMs (enactable models or process patterns previously harvested or constructed ad-hoc) into one enactable model. The activities of harvesting and reuse may be carried out using the following types of mechanisms: • Abstraction mechanisms. To get rid of some specific or undesired details of a PM. Abstraction mechanisms come up in harvesting activities. • Adaptation mechanisms. To make a PM (usually a process pattern) either more specific or suitable to be reused in a particular process. • Composition mechanisms. To combine a set of PMs in order to create a new one. Composition mechanisms are used both in reuse and harvesting activities. • Delayed binding mechanisms. To delay until enactment time the selection of a specific part of a SPM. These mechanims may be grouped along two different, usual harvesting and reuse strategies: • Bottom-up. Construction of PMs using either composition or generalization mechanisms. Using a bottom-up strategy we may obtain a more general model from another specific one (useful for harvesting) or a more complex model from its parts (useful for harvesting, if applied to process patterns and for reuse, if applied to enactable models). 4 • Top-down. Construction of PMs using adaptation mechanisms. Using a top-down strategy we may obtain a more specific model from another general one (useful for reuse). We do not use the top-down strategy for harvesting. In both cases, the resulting PM is in the template or the enactable level. Both strategies may be combined in a reuse activity. In the same way, the two forms of the bottom-up strategy may be combined in a harvesting activity. A whole reuse process combining the activities of reuse and harvesting may itself be modelled as a sequence of reuse mechanisms application, following any valid path in the framework shown in figure 1. Notice that we have defined types of mechanisms to move along all the feasible directions of the diagram. 2.2 Harvesting and reuse mechanisms In this section we detail and decompose the reuse types of mechanisms presented above. Abstraction mechanisms. Two abstraction mechanisms are considered, which correspond to the two ways that are normally used in order to abstract details from a complex model: generalization (consistent removal of some elements from the SPM) and parameterization (encapsulation of the abstracted elements by means of parameters). Adaptation mechanisms. Adaptation mechanisms involve some sort of model modification. The following modifications can be applied on a PM: (1) Addition of new elements to the PM. This makes the PM more specific and leads to two different mechanisms: specialization (consistent addition of some elements to the SPM) and instantiation (tailoring a parameterized PM to a specific context by determining its parameters). Notice that both mechanisms are the opposite to the abstraction ones. (2) Removal of (unnecessary) elements from the PM. We use the projection mechanism for this purpose. This mechanism restricts the model to the selected elements and their context (i.e., it obtains a view of it). Notice that a generalization may be considered a removal of elements with abstraction purposes while a projection is a removal of elements with adaptation purposes. (3) Substitution of elements of the PM. This substitution may be performed at two different levels (lexical and semantic) leading to two mechanisms: renaming mechanism (lexical substitution) and semantic substitution mechanism (substitution of some model elements for other different ones which model similar concepts). Composition mechanisms. We distinguish three ways to carry out a composition of a set of PMs: (1) Shallow composition. This is a grouping of a set of PMs without adding any additional specific semantics (the behaviour of the resulting model is the sum of the behaviours of the components). Furthermore, the namespaces of the component PMs are kept separated in the resulting one (i.e., no merging of namespaces). This composition is performed by the grouping mechanism. (2) Deep composition. This is a composition of a set of PMs by adding some additional behaviour to the resulting model (by defining several precedences between the main tasks of the components). The namespaces of the component PMs are merged into a single one. This is performed by the combination mechanism. (3) Inclusion. In this kind of composition, the functionality of an entire PM is incorporated as a subtask into the behaviour of a composite task (which belongs to another PM), possibly with some additional behaviour. This is performed by the inclusion mechanism. Delayed binding mechanisms. By delayed binding we mean the possibility to enact models that are not completely described (i.e., the implementation of some activities will be decided during enact- 5 ment. [Per96] uses the terms primitivation and stratification to refer to this). These models would be completed at enactment time using the refinement mechanism (a non refined task is substituted for a specific refinement of that task that has been included in the model at modelling time) and/or the inclusion one (i.e., a non-refined task t is substituted for an already constructed model which is included into the enacting one in the place of t). 2.3 Mechanism definition in PROMENADE PROMENADE provides a specific definition of all the above-mentioned mechanisms. Specifically, an expressive definition of the parameterization/instantiation mechanisms has been provided in the context of process patterns (in fact, process patterns have been defined as parameterized SPMs). The rest of mechanisms have been defined by means of one or more PROMENADE operators. Thus, the term ‘operator’ here refers to the specific definition of a harvesting/reuse mechanism within the context of PROMENADE. These operators may be applied both to enactable models or to process patterns. All the PROMENADE behavioural and reuse constructs have been mapped into UML (hence, all the diagrams used to describe the behaviour or reuse of a PROMENADE model are standard UML). Wherever an extension to the UML metamodel has been necessary, we have used the UML builtin extension mechanisms. We devote the next few sections to the definition of process patterns and the harvesting/reuse operators in PROMENADE. We rely on the notion of morphism between SPMs in order to provide the operators definition. Intuitively, a morphism between SPMs is a transformation from a SPM into another that keeps (part of) the structure of the SPM. 3. Process patterns in PROMENADE Parameterization/instantiation reuse mechanisms are defined in PROMENADE by means of process patterns. These process patterns may be combined with other SPM/process patterns to construct a bigger SPM/process pattern. Process patterns are integrated into the PROMENADE metamodel. In the next few sections we detail the main features of process pattern definition in PROMENADE. 3.1 Process pattern definition A process pattern may be defined as an activity abstraction which provides some solution template to a common problem in a given context (see, for instance, [UML01]). [Amb98] identifies three abstraction levels for process patterns (namely, task process patterns, stage process patterns and phase process patterns). Usually, process patterns are described in a loose and somewhat ambiguous way. Normally, textual descriptions of process patterns are used, which clearly lack the rigour of model descriptions. Furthermore, these notations are not standard. Other approaches [Sto01, GM01, SW01] define the structural and behavioural aspects of a process pattern by means of UML diagrams. However, they do not integrate process patterns into the UML metamodel. UML does define the notion of framework which is intended to be a pattern [RJB99]. A framework is defined as a stereotyped package. It abstracts a set of possibly parameterized collaborations (called mechanisms). A framework, itself, may be parameterized. Although UML frameworks are not restricted to a textual definition, they are still far from the rigorous definition which is convenient for the elements that come up in a modelling language. In particular, no definition of the elements that compose a process pattern is provided, the framework concept is not a first class metaelement defined in the UML metamodel but just a stereotype whose structure is not established 6 and no constraints about parameterization are given in the metamodel (e.g., which specific classes may instantiate a particular parameter, which particular constraints must be enforced on those instances and so on); the components of a framework (name, intention, initial context, process, participants, etc.) are not defined either. We are not aware of any software PML which applies its modelling notation to the definition of process patterns. The PROMENADE approach to process patterns can be characterized by the following key features (we have marked with a ‘*’ the features that constitute PROMENADE contributions): • A rigorous definition of process patterns integrated into the PROMENADE metamodel is given (see figure 2) (*). In this respect, notice that a process pattern is defined as a subclass of a SPM. In particular, a process pattern in PROMENADE is defined as a parameterized SPM. • Expressive and flexible parameterization. (*) Some parameters may encapsulate some structural or behavioural aspects of a process pattern. Any descendant of Task, Document, Tool, Role, Agent, SPM or Class may be a process pattern parameter. Therefore, process patterns allow the definition of generic SPMs which may be reused in different situations by means of a specific instantiation of its parameters (adaptation). PROMENADE allows the definition of specific constraints on process patterns parameters (in OCL) and provides a specific definition of the correctness of a parameter binding. Two metaclasses (ParameterConstraint and ProcessPatternBinding) have been incorporated to the PROMENADE metamodel in order to deal with both issues. An example of such constraints on the parameters may be the following: “the document class that instantiates the parameter P of the pattern must have as subdocuments the document classes A and B”. • Since a process pattern is, in particular, a SPM (see figure 2), the modularity/reuse operators that are described in the following few sections may be applied to process patterns resulting in a PML endowed with powerful reuse capabilities. (*) • Specific process patterns features (name, author, intent, initial context, result context, applicability, etc.) have been defined for PROMENADE process patterns in its metamodel (this is not the case of other modelling approaches like UML). • The model for a process pattern is rigorously defined using the features of the PROMENADE PML (precedence relationships, communications and ECA-rules may be used to describe the behaviour of a process pattern.) (*). Notice that this more rigorous definition of a pattern has nothing to do with the detail of such definition. In particular, a loosely defined process pattern may be perfectly well described by means of loose precedences between tasks (weak, start, etc.). Furthermore, these tasks may be process patterns parameters which need not to be precisely stated. As it is shown in figure 2, process patterns are defined in the PROMENADE metamodel as a SPM subclass. The metaelements in this figure are presented below. 7 Fig. 2: Metamodel classes for Process pattern definition 3.2 ProcessPattern Concept In PROMENADE, a process pattern is defined as a template SPM. That is, a SPM that may have some parameters. Some constraints may be applied to the parameter instantiation in order to enforce some properties which must hold for the parameters. By definition, the instantiation of a process pattern in PROMENADE results in a SPM. Process patterns in PROMENADE are characterized by means of several features. These features do not differ significatively from those presented in several sources (see [Sto01, GM01, Amb98], for instance). Some important differences arise, however, in the modelling of some of them. Features - Name (inherited from ModelElement) - Author - Also-known-as - Keywords - Intent - Pattern parameters. - Initial context. - Result context - Applicability (constraints). General constraints and parameter constraints - Participants. Inherited from SPMetamod. The structural aspects of a SPM. - Process. Inherited from SPMetamod. The behavioural aspects of a SPM. It includes both proactive behaviour modelling (precedences) and reactive behavioural modelling (ECA rules). See [RF01]. Notice that PROMENADE does not provide only a textual description of the process pattern behaviour but a rigorous one based on the usual behavioural mechanisms defined by this language. Model (UML) SPMetamod ProcessPattern Dependency (UML) PPBinding ParameterConstraint 1 defaultElement 0..1 TemplateParameter (UML) 1 0..1 Binding (UML) argument 1..* 0..1 ModelElement (UML) 0..1 0..1 1..* 0..1 0..* templateParameter 0..* 8 - Pros & cons - Example - Related patterns (reference) An example of process pattern definition can be found in section 10. A process pattern is meant to be less specific than a SPM. This is typically achieved by means of parameters that encapsulate either structural or behavioural aspects. In fact, any descendant of Task, Document, Tool, Role, Agent, SPM or Class may be a process pattern parameter. The power of process patterns is mainly a consequence of this parameterization capability. The features to manage process patterns parameterization comes from the UML metamodel. Since a process pattern is a descendant of the UML metaclass ModelElement, it may have template parameters, which, in turn, will be instances of ModelElement. On the other hand, a parameterized process pattern may be instantiated by a specific SPM using a UML Binding (i.e. a sequence of model elements each one of which is associated to a process pattern parameter). Hereafter, we will call actual parameters the specific classes used to instantiate the template parameters of a process pattern. However, there exist two issues related to process pattern parameterization which are not modelled in the UML metamodel and which we feel are very important: - Definition of specific constraints on parameters. - Definition of correctness of a parameter binding. Two metaclasses have been added to the UML metamodel to cope with both aspects: ParameterConstraint and ProcessPatternBinding. This metaclasses are presented in the next few sections. There are three issues that, along with parameterization, transform PROMENADE process patterns into powerful concepts: • All the modularity/reuse mechanisms that we have discussed in this chapter are applicable to PROMENADE process patterns. In particular, this means that it is possible: - To combine process patterns (with each other or with SPMs) to create bigger process patterns. - To create hierarchies of process patterns. In this way, a process pattern could refine a more abstract one. - To create a view (a projection) of a process pattern. - To incorporate a process pattern into another or into a SPM. The definitions given above for these operators apply. However, it is important to keep in mind that any operator applied on a process pattern will lead to another process pattern. • Since an instantiated PROMENADE process pattern is, by definition, a SPM, it may come up at any place where a SPM is required. • A PROMENADE process pattern is an abstraction for a SPM. Therefore, we may apply process patterns (in the same way as SPM) to very different granularities and hence, use them to model the three process patterns levels described in [Amb98] (namely, task process patterns, stage process patetrns and phase process patterns). • Unlike the textual definitions of other approaches, the model for a process pattern is rigorously defined using the features of the PROMENADE PML. 3.3 ParameterConstraint Concept A process pattern may define some constraints on the actual parameters that may be used to instantiate a particular template parameter. This is necessary because the process pattern may assume that the actual parameters have some specific features which it needs in order to perform its functionallity. A typical example may occur (but it is not restricted) to parameters of the metaclass MetaTask. Let us consider the following example: A process pattern Specification that has a parameter called 9 SpecifyDocument, which accounts for a task, may require that the actual task to be bound to that parameter have, in its turn, a task parameter of type DocumentSpecification. Obviously, the motivation of this requirement is that the process pattern Specification uses that task parameter. This example is extended in section 10. Each template parameter may be associated to (at most) one instance of the metaclass ParameterConstraint, which defines a list of constraints on that parameter. Features - tempParam: TemplateParameter - constraints: set(Predicate) 3.4 Process Pattern Binding (PPBinding) Concept Binding is a UML metaclass that establishes a relationship between a template model element (supplier) and another model element (client) that instantiates it. This binding is established by means of a sequence of actual parameters that are bound to the formal parameters of the template class. PPBinding is a subclass of Binding incorporated to the PROMENADE metamodel that regulates process pattern instantiation. In particular, - The client of a PPBinding must be of type SPM. - The supplier of a PPBinding must be of type ProcessPattern. - The sequence of arguments of a PPBinding instance (i.e. the actual parameters that instantiate the process pattern to which the binding is associated) must: (1) be (one-to-one) of the same metatypes as the template parameters of the supplier process pattern. (2) keep the constraints stated in the parameter constraints associated to each template parameter of the supplier process pattern. (3) keep the general constraints stated by the supplier process pattern. 3.5 Graphical representation Figure 3 shows how process patterns may be represented in PROMENADE. This figure refers to the example shown in section 10. Notice that the process pattern contain some parameters and that we may attach to its representation constraints concerning those parameters by means of a note. For instance, constraint (5) states that the task class that will instantiate FSpecifyComp must have a parameter of type FSpecDoc (because this parameter is used within the definition of Specify- CompWithNFPattern. SpecDoc: MetaDocument FSpecifyComp: MetaTask NFSpecifyComp: Metatask <<processPattern>> SpecifyCompWithNFPattern (1) SpecDoc.allSupertypes->includes(Document) (2) Specdoc.subdocs->includes(FSpecDoc) (3) Specdoc.subdocs->includes(NFSpecDoc) (4) FSpecifyComp.allSupertypes->includes(Task) (5) FspecifyComp.params->exists(p|p.type=FSpecDoc) (6) NFSpecifyComp.allSupertypes->includes(Task) (7) NFspecifyComp.params->exists(p|p.type=NFSpecDoc) Fig. 3: Graphical representation of a Process pattern 16 transfoRole (r: MetaRole, t: MetaTask): MetaRole result.tasksClR=r.tasksClR->iterate(s:MetaTask, res: set(MetaTask) |res->including(transfoTask(s,t)) ) result.tasksClP=r.tasksClP->iterate(s:MetaTask, res: set(MetaTask) |res->including(transfoTask(s,t)) ) result.docsClR=r.docClR->iterate(d:MetaDocument, res: set(MetaDocument) |res->including(transfoDoc(d,t)) ) result.name= r.name • transfoDoc(d,t) transfoDoc(d,t) is the document class into which d is transformed by the application of the removeOneTaskCl (m1, t) operator. This document class is obtained by removing from the document class d any reference to t. transfoDoc (d: MetaDocument, t: MetaTask): MetaDocument result.subdocsCl=d.subdocsCl->iterate(d2:MetaDocument, res: set(MetaDocument) |res->including(transfoDoc(d2,t)) ) result.superdocCl=transfoDoc(d2.superdocCl,t) result.responsibleCl=r.tasksClR->iterate(s:MetaTask, res: set(MetaTask) |res->including(transfoTask(s,t)) ) result.name= d.name • transfoClass (c,t) transfoClass(c,t) is the class into which c (a class from m1 , usually applied to classes that does not belong to the cathegories of document, task, communication or role) is transformed by the application of the removeOneTaskCl (m1, t) operator. This class is obtained by removing from the class c any reference to t. transfoClass (c: Class, t: MetaTask): Class if(c=t) then result=NULL else if (c.oclType=MetaTask) result=transfoTask(c,t) else if (c.oclType=MetaDocument) result=transfoDoc(c,t) else if (c.oclType=MetaRole) result=transfoRole(c,t) else if (c.oclType=MetaTool) result=transfoTool(c,t) else if (c.oclType=MetaAgent) result=transfoAgent(c,t) else result= result.name=c.name result.features->iterate(f:Feature, res: set(Feature) |res->including (transfoFeature(f)) ) • transfoAssoc(a,t) transfoAssoc(a,t) is the association class into which a is transformed by the application of the removeOneTaskCl (m1, t) operator. This association class is obtained by removing from the association class a any reference to t and by removing a itself, if it links t with some other class. 17 transfoAssoc (a: Association, t: MetaTask): Association result=if (a.connection->exists(ae|ae.type=t)) then result=NULL else a.connection->iterate(ae:AssociationEnd res: set(AssociationEnd) |res->including(transfoAssocEnd(ae,t) ) ) • transfoDep(d,t) transfoDep(d,t) is the dependency class into which the dependency d from the SPM m1 is transformed by the application of the removeOneTaskCl (m1, t) operator. This dependency class is obtained by removing from d any reference to t and by removing d if it links t with some other class. transfoDep (d: Dependency, t: MetaTask): Dependency result=if (d.client->includes(t) or d.supplier->includes(t)) then result=NULL else result.supplier=iterate->(c:Class, res: set(Class) |res->including(transfoClass(d.supplier,t)) ) result.client= iterate->(c:Class, res: set(Class) |res->including(transfoClass(c,t)) ) • transfoPrec(p,t) transfoPrec(p,t) is the precedence class into which a precedence p that belongs to the SPM m1 is transformed by the application of the removeOneTaskCl (m1, t) operator. This precedence class is obtained by removing from d any reference to t and by removing p itself if it links t with some other class. transfoPrec (p: Precedence, t: MetaTask): Precedence result=if (p.client->includes(t) or p.supplier->includes(t) or p.taskCl=t) then result=NULL else result.taskCl=transfoTask(p.taskCl) result.client=p.client->iterate(c:MetaTask, res: set(MetaTask) |res->including(transfoTask(c,t)) ) result.supplier=p.supplier->iterate(c:MetaTask, res: set(MetaTask) |res->including(transfoTask(c,t)) ) result.parbind=p.parbind->iterate(pb:ParBinding, res: set(ParBinding) |res->including(transfoParBind(pb,t)) ) • transfoComm(c,t) transfoComm(c,t) is the communication class into which c is transformed by the application of the removeOneTaskCl (m1 , t) operator. This communication class is obtained by removing from c any reference to t and by removing c itself if it links t with some other class. transfoComm (c: Communication, t: MetaTask): Communication Post: result=if (c.receivers->includes(t) or c.senders->includes(t)) then result=NULL else 18 result.receivers=c.receivers->iterate(ce:CommunicationEnd res: set(CommunicationEnd) |res->including(transfoClass(ce)) ) result.senders=c.senders->iterate(ce:CommunicationEnd res: set(CommunicationEnd) |res->including(transfoClass(ce)) ) 5.4 Graphical representation of generalization/specialization operators As we have said, a PROMENADE SPM has been defined as a UML package, hence, according to the UML metamodel, it is a generalizable element. As a consequence, we may use the standard UML notation to represent a generalization/specialization relationship between two SPMs. In the PROMENADE metamodel, a special kind of the UML Generalization has been defined (namely, SPMGenRel; see figure 4) in order to depict the relationship established between two SPMs, A and B, such that B is obtained from the application of a generalization/specialization relationship on A. Figure 5 shows an example of the graphical representation. In this case, A has been obtained from the application of a generalization operator (taskRemoval) to B. Fig. 4: Extension of the UML metamodel to deal with the Generalization operator (fragment) Fig. 5: Representation of the generalization/specialization operators in PROMENADE B <<SPM>> A <<SPM>> <<SPMGenRel>> {operator=removeTasks({t1,t2,...,tk} ReuseOperator RemoveTaskCl RemoveDocCl Generalization (UML) addedElms 1..* ModelElement (UML) SPMGenRel operator 1 particularM 1 SPMGeneralization 1..* 1 generalM 1 SPMetamod 1 1 19 6. Renaming operator A renaming of a model consists of a set of lexical substitutions that are applied to that model. As a result of a renaming, the identifiers of some classes, features, associations, etc of a model may have changed. Renaming may bring about name conflicts (e.g., two different elements may have identical name after a renaming). Therefore, not all renamings should be allowed. These aspects are discussed in the following sections. The renaming operator is also defined. 6.1 Unicity of names property PROMENADE keeps a name policy which ensures that element names in a SPM do not clash. This policy is rooted in the UML name policy, which is based on the notion of namespace and on some constraints defined in the UML metamodel for the various UML metaelements. PROMENADE adds some new constraints to those defined in UML. In the following we synthesize the constraints concerning names that are to be kept in a PROMENADE SPM. 1. Constraints at SPM level This group of constraints establish requirements about the naming of the elements owned by a SPM (i.e., task classes, document classes, role classes, communication classes, associations and other classes). The origin of the constraint is included. (1) All instances of the elements owned by a SPM A (i.e., MetaRole, MetaDocument, Meta- Task, Communication, Class) must have different name. They must have different name from the elements defined in A’s supertypes as well. (UML metamodel definition: Constraint [1] of the NameSpace metaclass). (2) All the associations defined both in a SPM A and in its supertypes must have a unique combination of <name, associated-classifiers>. (UML metamodel definition: Constraint [2] of the NameSpace metaclass). (3) There may be no element imported by a SPM A with the same name as an element owned by A (including its supertypes). (UML metamodel definition: Constraints [2] and [4] of the Package metaclass). (4) The names of the imported elements should not clash. (UML metamodel definition: Constraints [3] and [5] of the Package metaclass). 2. Constraints at component level These constraints apply to different aspects concerning specific elements owned by a SPM. In particular, the constraints are defined on some aspects of classifiers (MetaDocument, MetaTask, MetaRole, Communication, Class) and associations. (1) The association-ends of a specific association must have unique names. (UML metamodel definition: Constraint [1] of the Association metaclass). (2) All associations defined on a specific classifier A (or A’s supertypes) must have different names for their opposite association-ends. (UML metamodel definition: Constraint [3] of the Classifier metaclass). (3) All attributes defined on a specific classifier A (or A’s supertypes) must have different names. (UML metamodel definition: Constraint [2] of the Classifier metaclass). (4) All ECA-rules defined on a specific metatask T (or T’s supertypes) must have different names. (PROMENADE metamodel definition: Constraint of the MetaTask metaclass). (5) Given a specific classifier A (including A’s supertypes), there should not be any conflict between the names of A’s attributes, opposite association-ends, ECA-rules and owned elements. (UML metamodel definition: Constraint [4], [5] of the Classifier metaclass 20 PROMENADE metamodel definition: Constraint of the MetaTask metaclass). (6) No behavioural feature of the same kind may match the same signature in a classifier. (UML metamodel definition: Constraint [1] of the Classifier metaclass). 3. Constraints at parameter level These constraints apply either to task parameters or to behavioural features parameters. (1) All parameters of a behavioural feature must have different names. (UML metamodel definition: Constraint [1] of the BehaviouralFeature metaclass). (2) All parameters of a task must have different names. (PROMENADE metamodel definition: Constraint of the MetaTask metaclass). We say that a SPM that keeps the referred constraints complies with the unicity of names property. Otherwise, it is an inconsistent SPM An application of the renaming operator should maintain consistency. 6.2 The Renaming operator Renaming operator. Definition 1 A renaming of a model m consists in the application of a set of lexical substitutions on that model in such a way that the unicity of names property is kept. m2=renaming(m1,ss) ss is a list of substitutions that can be applied to m1 keeping the unicity of names property. m2 is the SPM resulting from applying, in parallel, the set of substitutions ss to m1. A substitution is a pair (s1/s2) such that s1 is the textual element that is substituted for s2 throughout a SPM. We present below three conditions that are sufficient in order to ensure that the unicity of names property holds after the application of a set of substitutions. Proposition 1. Let m be a PROMENADE model that satisfies the unicity of names property. Let ss be a substitution list to be applied to m. The conjuntion of the following conditions is sufficient to ensure that the model renaming(m,ss) keeps the unicity of names property: (1) For all pair of (si/sk), (sr/st) in ss, si=sr⇒sk=st (2) For all pair of (si/sk), (sr/st) in ss, sk=st ⇒ si=sr (3) For all (si/sk) in ss, sk is not either in m or in SPMs imported by m or in a m supertype. • Condition (1) states that an identifier of the model m cannot be substituted for more than one identifier. Clearly this condition is a necessary one. Otherwise some indeterminism would be introduced in the application of a set of substitutions to a model. • Condition (2) establishes that two diferent identifiers of m (say si, sr) should be substituted for two different ones (i.e. sk ≠ st). This condition ensures that the new identifiers introduced in the SPM will not clash. This condition is not strictly necessary in order to ensure unicity of names. Consider, for instance, the situation in which two different attribute identifiers defined in different classes are substituted by the same string without breaking the unicity of names property. • Condition (3) states that any identifier used to substitute another one should not belong to the SPM (or to an imported one). It constitutes a safe measure for many cases in which the substi- 21 tution of a model identifier for some other which is already in the model may break the unicity of names. Again, this is not a necessary condition. In situations similar to the presented in condition (2), condition (3) is unnecessarily strict. Although conditions (2) and (3) certainly ensure that the unicity of names property holds after the application of the renaming operator to a SPM that complies with that property, they are, by far, too restrictive. In particular, they forbid a clash between any pair of identifiers contained in any SPM element. However, the metamodel constraints enumerated in section 6.1 only forbid certain clashes within a specific level (namely, SPM, Classifier or Parameter level). Therefore, we may redefine the renaming operator by restricting conflicts to the clashes occurring within a specific level and allowing interlevel clashes. This may be enforced by incorporating to the renaming operator a different substitution list for each specific level and enforcing conditions (1), (2) and (3) for each one of the lists. Renaming operator. Definition 2 We provide an alternative definition for the renaming operator in the following way: m’=renaming(m, substsLev1, substsLev2, substsLev3) where, • substsLev1 is a list of name substitutions at SPM level. In particular, it may contain substitutions of: - SPM component names (namely, task classes, document classes, communication classes, role clases, other classes). - Association names. • substsLev2 is a list of pairs <classifier, name-substitution-list> such that the substitution list refers to classifier elements. In particular, this list may contain substitutions of: - Names of attributes or behavioural elements of the classifier. - Names of elements owned-by the classifier. - Names of the opposite-end of the associations in which the classifier participates. - Names of the associated ECA-rules (if the classifier is a task class). • substsLev3 is a list that may contain either triples <classifier, behavioural-element, namesubstitution-list> or pairs <task-class, name-substitution-list>. In the first case, the substitution list refers to parameters of a behavioural element associated to a specific classifier, while in the second case it refers to task parameters. The idea is to enforce the conditions (1), (2) and (3) to each substitution list as a less restrictive way to ensure that the SPM which results from the application of the renaming operator satisfies the unicity of names property. Unfortunatelly, the three conditions do not ensure the constraint that association-ends must have a unique name within each association (constraint 2.(1) ). We need also a 4th condition to enforce that all association ends must have a unique name within each association. Proposition 2. Let m be a PROMENADE model that satisfies the unicity of names property. Let m’ be the SPM that results from the application of the renaming operator: m’=renaming(m, substsLev1, substsLev2, substsLev3) with, • substsLev1=<m,ss1> • substsLev2={<cl1,ss2>, <cl2,ss3>, ..., <clk,ssk+1>} 22 • substsLev3={<t1,ssk+2>, ...,<tm,ssm>} (ti may refer to either a task or a pair <classifier, behavioural-element>). The conjuntion of the following conditions is sufficient to ensure that the model m’ keeps the unicity of names property: (1) For all substitution list ssj (j=1...m), and for all pair of (si/sk), (sr/st) in ssj, si=sr ⇒ sk=st. (2) For all substitution list ssj (j=1..m), and for all pair of (si/sk), (sr/st) in ssj, sk=st ⇒ si=sr. (3) For all pair of (si/sk) in ssj (j=1..m), sk not either in m or in a SPM imported by m, or in a m supertype. For all pair <clr,ssj>, and for all pair of (si/sk) in ssj, sk not either in clr or in a clr supertype. (4) The names of the association-ends in any association are unique. Remarks: • A classifier name substitution may affect other parts of the SPM (e.g. If a document class name changes, the type of some task class parameters will also change). • Conditions (1) to (4) still impose some restrictions which are not strictly necessary (e.g., although it is not forbiden by the metamodel, any pair of associations with different names may not be substituted by another pair with the same name. Something similar is true for behavioural features). Proposition 3. Let m be a SPM and let m’ be another SPM resulting from the application of a renaming operator: m’=renaming(m,ss), such that ss satisfies the conditions stated in proposition 1 or m’=renaming(m, substsLev1, substsLev2, substsLev3), such that substsLev1, substsLev2, substsLev3 satisfy the conditions stated in proposition 2. Then, m and m’ are isomorphs. As a consequence of proposition 3, a renaming done on the basis of either proposition 1 or 2 keeps model equivalence (the model that results from a renaming operation is equivalent to the one before the renaming). 6.3 Usage of the renaming operator The renaming operator may be used to make compatible a pair of incompatible models (i.e. which are incompatibles for lexical reasons) or to simplify a model with redundancies. In particular, it may be used to: • Separate two different (i.e. non equivalent) classes (of two different models) with the same name (before a combination process. See section 8). • Give the same name to a pair of equivalent classes belonging to the same model or even different models (useful in a combination process. See section 8). 6.4 Graphical representation The relationship established between a pair of models A, B such that, A is a renaming of B can be represented by means of a special kind of Dependency: the Renaming dependency (see the 23 PROMENADE extension of the UML metamodel concerning renaming operator shown in figure 6). Figure 7 shows an example of this representation. Fig. 6: Extension of the UML metamodel to deal with the Renaming operator Fig. 7: Representation of the renaming operator 7. Projection operator The projection of a SPM with respect to a set of classes {c1, c2, ..., cn} is constituted by {c1, c2, ..., cn} together with the minimum set of additional classes needed by {c1, c2, ..., cn} in order to make sense (we call these classes, the context of {c1, c2, ..., cn}). 7.1 Classifier context Intuitively, the context of a classifier c is composed of all the classes that are related with c by means of some links (e.g., associations, generalizations, dependencies, etc.). In particular, we consider the following definitions: • Class context: The context of a class c is composed of: - the set of classes related to c by means of associations (including aggregations) - the set of classes on which c depends (dependency relationship), - c superclass • Task context: The context of a task class c is composed of: - the class context of c, NFAspects2 <<SPM>> NFAspects <<SPM>> <<Renaming>> {operator= renaming(NFAspects, (Component/Component2))} ReuseOperator Dependency (UML) Renaming operator 1 original 1 SPMRenaming 1 renamed 1 SPMetamod 1 1 ModelElement (UML) 24 - c’s subtasks, - c’s precedences, - the document classes that act as parameters for c, - the role class which is responsible for c and the role classes that participate in c. • Document context: The context of a document class c is composed of: - the class context of c, - the role class that is responsible for c, - the task classes that have c as parameter and - the subdocument classes of c. • Role context: The context of a role class c is composed of: - the class context of c, - the set of task classes for which c is responsible and in which c participates, - the set of document classes for which c is responsible. • Communication context: The context of a communication class c is composed of: - the class context of c, - the set of task/roles classes that may send/receive the communication. 7.2 Projection of a model with respect to a set of classes The projection operator allows us to generate model views. A SPM view can be defined in the following way [AC96]: A view is a projection of a process model according to a well-defined characteristic. This well-defined characteristic may be defined in terms of a set of classes belonging to the SPM (e.g. all the tasks classes for which a given role is responsible, all the tasks that use a documetn class as parameter...). The projection of a SPM with respect to a set of classes s is defined intuitively as the transitive closure of the context of the classes in s. That is, the classes that belong to s together with all the classes on which they depend directly or indirectly. More rigorously, v=projection(m,{c1,...,cn}) v is the model obtained from m (v is a view of m) in the following way: (1) The PROMENADE reference model belongs to v (2) c1,...,cn belong to v (3) If c belongs to v, context(c) belongs to v (4) No other class belongs to v. A maintask for v may be chosen between any task class which has no supertask in v or, alternatively, a new task class may be defined, which has as subtasks all v’s tasks which have no supertask in v. 7.3 Graphical representation The relationship established between a pair of models A, B such that, A is a projection of B can be represented by means of a special kind of Dependency: the Projection dependency (see figure 8). Figure 9 shows an example of this representation. 25 Fig. 8: Extension of the UML metamodel to deal with the Projection operator Fig. 9: Representation of the projection operator 8. Composition operators These operators allow the construction of a new SPM by the composition of some already constructed ones. These existing SPMs may be seen as partial models of a complete SPM. This ability is crucial in order to deal with complex models which can be thus built from small pieces. This may happen for models that cover different parts of software development as specification, design or implementation, which may be developed by different teams. Some composition tools will be needed then in order to put together all those partial models and build a model for the entire software development process. Something similar may happen with off-the-shelf models which are to be stuck in some other models that need to incorporate their functionality and with process patterns that will be reused (possibly combined with other process paterns or SPMs) after adaptation. Needless to say that these features will enhance model reuse. PROMENADE defines three different composition operators: model grouping, model combination and model inclusion. • Model grouping: This operator gathers together a set of SPMs without adding any additional specific semantics. Furthermore, the namespaces of the component SPMs are kept separated in the resulting SPM (i.e. no merging of namespaces). • Model combination: This operator combines some SPMs by adding several precedence relationships among their main tasks. The namespaces of the component SPMs are merged into a single one. Therefore, component models must be compatible. • Model inclusion: This operator is used whenever the functionality of an entire SPM is to be incorporated into the behaviour of a composite task of another SPM. That is: it allows us to mix models with subtasks in order to describe the behaviour of a composite task. Again, the included SPM must be compatible with the one in which it is included. A <<SPM>> B <<SPM>> <<Projection>> {operator=projection(B,{c1,...,cn})} ReuseOperator Dependency (UML) Projection operator 1 original 1 SPMProjection 1 projected 1 SPMetamod 1 1 ModelElement (UML) 32 5. Identify the precedences of intended composite tasks of m that contain any reference to a task class t that belongs to the list of redundant task classes and substitute t for its counterpart. 6. Substitute the subdocument and superdocument classes of intended document classes of m which belong to the list of redundant classes for their counterparts. 7. Substitute the participants and responsibles for intended task classes that refer to redundant roles for their counterparts. 8. Substitute the responsibles for intended document classes that refer to redundant roles for their counterparts. 9. If the maintask class refers to one redundant task class, substitute it for its counterpart. At this point there is no reference to a redundant element in any intended element. That is, all associations, parameters, roles, supertasks, subtasks, subdocuments... from an intended element that referred to a redundant one, now refers to their counterpart. Therefore, we can: 10. Remove all the redundant classes. Notice that the removal of redundant classes will not do any harm since in previous steps we have substituted all the references to redundant classes for their counterparts. removeClasses(MakeComponentNF, Redundants) where Redundants is the list of redundant classes (obtained from SemSubsts getting the head of each of its pairs). 11. Remove all the residual classes. Notice that, by definition, the removal of the residual classes will result in the removal of any reference to them along the SPM. removeClasses(MakeComponentNF, Residuals) Following this procedure we may construct a new SPM that has, as structure, the superposition of the structures of its component models and, as behaviour, the behaviours of its component models (these behaviours are encapsulated in their respective main task classes) organized and structured by means of a set of precedence relationships between their corresponding main task classes. Notice that this construction ensures that all PROMENADE SPMs share the reference model structure on which they are constructed. Notice also that the strategy of this operator induces a merging of the component namespaces. Sometimes we are interested only in grouping some models without specifying the behaviour of the composite model, but merging their namespaces. We can also use the combination operator for this purpose. In this case, this operator does not specify either any behaviour or parameters for the main task (i.e. an empty set of precedences and parameters). Structurally, the relationship between a model m that has been obtained from a combination of models m1,...,mn and its component models m1,...,mn is established by the association modelcombination in the PROMENADE metamodel. This association induces, by definition, a dependency stereotyped <<combination>> from the composite SPM to the component ones. 33 SPM combination operator. Graphical representation There are two complementary ways to represent graphically the combination of a set of SPMs. The first representation focuses on showing the component and the composite SPMs that are involved in the combination (see figure 13, which represents M3 as the combination of M1and M2). This representation has the drawback that it does not show the behaviour of the composite SPM. The second one is more specific and it shows the maintask of the composite SPM as a set of precedences between its component SPMs (as we have said, these dependencies take place actually, between the maintasks of the component SPMs). Since we have used a two-tiered approach to the construction of the PROMENADE metamodel (explicit extension of the UML metamodel and creation of a UML-profile; see [RF01, RF02]), there exist two ways to depict the second representation: we can use either the representation that PROMENADE introduces for precedences (see figure 14) or the UML standard notation for dependencies (which will be conveniently stereotyped to denote a specific kind of precedence) accompanied with the appropriate tagged values (see figure 15). Notice that in this representation, arrows are depicted from the client to the supplier to be consistent with the menaning of dependencies in UML. In all cases, parameters are included in attached notes (as we have said, those parameters correspond to parameters of the maintask of the respective SPMs). Figures 14 and 15 show that the main task of M3 may be described as a strong precedence from the main task of M1 to the main task of M2. Figure 12, below, depicts the metamodel extension to deal with grouping and combination operators. Fig. 12: Extension of the UML metamodel to deal with two Composition operators ReuseOperator Dependency (UML) Projection operator 1 SPMComposition ModelElement (UML) combined 1 combining 2..* Precedence precs 1..* 0..1 SPMCombination invs : set (Predicate) lexs : set (Substitution) sems : set (Substitution) resid : set (Classifier) 1 1..* 0..1 Parameter (UML) 1..* params 1..* SPMGrouping SPMetamod 1 2..* 1..* 1 grouping 1..* grouped 1 34 Fig. 13: M3 obtained as a combination of M1 and M2 Fig. 14: Representation of the behaviour of a combined SPM using the PROMENADE notation Fig. 15: Standard UML representation of the behaviour of a combined SPM M1 <<SPM>> M2 <<SPM>> strong x  z y  t params: x:D1 y:D2 params: z:D1 t:D2 M1 <<SPM>> M2 <<SPM>> parbind={(x  z), (y  t)} params: x:D1 y:D2 params: z:D1 t:D2 <<strong>> <<SPM>> <<SPM>> M1 M2 M3 <<SPM>> <<combination>> 35 Model combination vs. model grouping Whenever a composition between a group of SPMs is required we may apply either the model combination or the model grouping operators. In this section we try to state which is the best choice according to the particular situation. There are two main differences between both operators: (1) The combination operator allows the definition of some additional behaviour to the composite model (i.e. some precedences between the main tasks of the component models) (2) Both operators create a new namespace for the composite model. However, while the grouping operator actually keeps the namespaces of the component models separate and independent (i.e. it is possible to refer, within the composite model to each component namespace. E.g. m1::A), the combination operator merges them into a single and integrated namespace. The conflicts that may arise when this operator is applied are avoided by requiring that the combined models must be directly combinable. We may say that the grouping operator leads to a loose composition while the combination operator produces a tighter and more integrated one. In particular, notice that if we want to merge the equivalent (or similar) elements of the component models into a single element in the composite model, we will choose the combination operator. The grouping one would keep those similar or equivalent concepts separated and independent. 8.3 Inclusion operator Sometimes, during the design of the behaviour of a composite task t that belongs to a model m, we notice that an already constructed model m2 provides the functionality that is required for a specific t’s subtask. The inclusion operator is used in these cases, that is: whenever the functionality of an entire model m2 is to be incorporated as a subtask into the behaviour of a composite task t (which belongs to another model m), possibly with some additional precedences. Therefore, we define: m’=inclusion(m,t,m2,beh) where m and m2 are PROMENADE SPMs, t is a task class of m and beh is a set of precedences linking m2’s main task with some t’s subtasks. with the following meaning: • The structure of m’ is composed of the structural elements of m and those of m2. The main task of m2 is incorporated as a subtask of t in the new model m’. • The behaviour of m’ is that of m with the additional precedences beh which have been incorporated to t. That is, the inclusion operator allows us to mix models with subtasks in order to describe the behaviour of a composite task. This operator may be used, not only in the modelling phase, but also in the enactment one in connection with the delayed binding capability. When at enactment time, an activity t whose behaviour has not been established at modelling time has to be refined, an entire model (coming from 36 a library of reusable models) may be chosen to provide the behaviour for t. In this case, the inclusion operator is used. Formal definition Let m and m2 be two compatible SPMs. Let t be a task class in m. Let beh be a set of precedence relationships established between subclasses of t and, possibly, the main task class of m2. We say that m’ is the model obtained from the inclusion of m2 in the task t of m with the precedence relationships beh, which we note: m’=inclusion(m,t,m2,beh) In order to define m’ we consider two model morphisms: f:m  m’ and f2:m2  m’ defined in the following way: f=(idname, ftask, iddoc, idrole, idclass, idgen, idcomm , idassoc, iddep, fmainta) f2=(id2name, f2task, id2doc, id2role, id2class, id2comm , id2gen, id2assoc, id2dep, f2mainta) with, ftask(s,t)= if (s≠t) then result=idtask(s) else result.name=s.name result.subtasksCl=IDtask(s.subtasksCl)->union(f2task (m2.maintaskCl)) result.precs=transfoPrecs(t.precs)->union(transfoPrecs(beh)) result.params=IDparam(s.params) result.supertaskCl=ftask(s.supertaskCl, t) result.atomic=false fmaintask(m.maintask)=ftask(m.maintask, t) f2task(s)= if (s≠m2.maintaskCl) then result=id2task(s) else result.name=s.name result.subtasksCl=ID2task(s.subtasksCl) result.precs=ID2precs(s.precs) result.params=ID2param(s.params) result.supertaskCl=ftask(t,t) result.atomic=s.atomic f2maintask(m2.maintask)=f2task(m2.maintask) transfoPrecs(sp)=sp->iterate(p:Precedence, res:set(Precedence) |res->including(transfoP(p)) ) transfoP(p)= if (p.supplier=m2.maintaskCl) result.supplier=set{f2task (m2.maintaskCl)} result.client=Ftask(p.client) else if (p.client=m2.maintaskCl) result.client=set{f2task (m2.maintaskCl)} result.supplier=Ftask(p.supplier) else result.supplier=Ftask(p.supplier) result.client=Ftask(p.client) Once these model morphisms have been defined, we can easily define m’: m’.name=m.name m’.gens=IDgen(m.gens)->union(ID2gen(m2.gens)) m’.assocs=IDassoc(m.assocs)->union(ID2assoc(m2.assocs)) m’.deps=IDdep(m.deps)->union(ID2dep(m2.deps)) 37 m’.docs=IDdoc(m.docs)->union(ID2doc(m2.docs)) m’.rolesCl=IDrole(m.rolesCl)->union(ID2role(m2.rolesCl)) m’.othersCl=IDclass(m.othersCl)->union(ID2gen(m2.othersCl)) m’.tasksCl=Ftask(m.tasksCl,t)->union(F2task(m2.tasksCl)) m’maintask=ftask(m.maintaskCl,t) According to the above definition, the new model m’ will contain the generalizations, associations, dependencies, communications, document classes, task classes, role classes and other classes of m and m2. Its main task will be that of m. Most of the task classes in both m and m2 will remain the same in m’ (notice the identity morphisms applied); however, task class t will incorporate a new subtask (namely, the main task class of m2) along with the precedences established in beh. In its turn, the main task class of m2 will keep the same structure and exhibit the same behaviour. It will incorporate, however, t as its supertask class. Notice that the inclusion operator may be used as well to define a specific behaviour for a not refined task class. m’=inclusion(m, t, m2, {}) where t is a not refined task class of m. According to the inclusion operator the behaviour of t in m’ will be that of m2. Notice that no precedence set is necessary in this case. Graphical representation A SPM that results from the inclusion of a SPM m2 into a composite task t, with additional behaviour beh is represented graphically by means of precedences between m2 ant t’s subtasks. These precedences will be the ones stated in beh. Alternatively, a standard graphical representation may be taken by means of stereotyped dependencies (<<inclusion>>) between m2 and the t’s subtasks (see figure 16). Fig. 16: Extension of the UML metamodel to deal with the Inclusion operator SPMComposition ReuseOperator Dependency (UML) Inclusion operator 1 including 1 SPMInclusion 1 included 1 SPMetamod 1 1 ModelElement (UML) 38 9. Delayed binding The delayed binding ability in PROMENADE may take two different forms: (1) A substitution at enactment time a task/document class A fo the SPM for some A’s refinement (i.e. another task/document class from the SPM that specializes A). A specific selection may be enforced by other previous selections. This is discussed in [RF01]. (2) A SPM may be parameterized (i.e. it may be a process pattern). As a result, some of its generic elements may be instantiated at enactment time. In this case, the actual parameters used for the instantiation will come from a library of SPMs (or process patterns) for reuse. The inclusion operator is likely to be used. 10. An example of process reuse Catalysis [DC99] is a collection of software development processes which are described in a modular way by the application of several patterns. These patterns share a common structure (i.e., the static elements used by them, like Spec, Collaboration, Design, are supplied by Catalysis). They are described informally in natural language and may be used in the description of one or more Catalysis processes. One of the Catalysis patterns which is used more recurrently in different processes is the one intended to specify a component (pattern 15.7 in [DC99]; let us call it SpecifyCompCat). This pattern relies on the notions of Collaboration and SpecType in order to construct the specification for a component referred to a specific role. The strategy followed by this pattern is the following: (1) definition of the static model, which provides the vocabulary to specify the operations; (2) specification of the operations; (3) assignment of responsibilities. Figure 17 shows a definition of this pattern in PROMENADE. It contains no parameters since it is not intended to be used universally but only within the Catalysis processes (i.e., the structural elements, including Collaboration and SpecType are defined in the Catalysis context and imported by all the patterns). Notice that PROMENADE allows a rigurous definition of the pattern. In addition to the usual textual features included in most pattern languages (author, keywords, intent, etc. [Amb98]; see fig. 17), other aspects described with a more precise (and standard) formalism are included. In particular, the pattern structural elements are presented by means of a UML class diagram (this diagram is encapsulated in StructuralAspectsCat and it is shared by all the Catalysis processes); its behaviour is described by means of a set of precedence relationships between the component activities (which may be decomposed in other subactivities). These relationships establish some temporal precedences between activities; include some parameter binding to link the documents involved in them; and are depicted by means of stereotyped UML dependencies. See [RF00, RF01] for a complete description. The details of the semantics are not necessary in the rest of the paper. The behavioural description of this pattern for the sake of brevity. However, an example of process behaviour description is shown in figure 18. Catalysis does not support the statement of software quality attributes (i.e., non-functional requirements [ISO99], short NFR) in a component specification. As other approaches do [CNM99, CL99], it can be considered useful to incorporate such NFRs in that specification. We have done this in [RF01]. Figure 18 shows the behaviour description for the SPM SpecifyCompWithNF. 39 <<processPattern>> SpecifyCompCat <<SPM>> StructuralAspectsCat <<imports>> Fig. 17: Definition of the SpecifyCompCat pattern SpecifyCompWithNF is a specific SPM which states that a component specification should consist of a functional and a non-functional specifications and also a validation of the specification. This SPM proposes the strategy of performing the functional specification first. It also applies a concrete strategy for specifying the functional and the non functional requirements. The details of this strategy are encapsulated in the subtasks of FSpecifyComp and NFSpecifyComp. SpecifyCompWithNF parameters lp: in Library lc: in Library evd: Document sd: i/o SpecDoc FSpecifyComp parameters fsd: out FSpecDoc evd in SpecEvalDoc lc: in Library {parameter binding= ([lc  lc], [sd.fspec  fsd], [evd  evd])} NFSpecifyComp parameters nfsd: out FSpecDoc evd in SpecEvalDoc lnfp: in Library {parameter binding= ([lp  lp], [sd.nfspec  nfsd], [evd  evd])} <<strong>> <<start>> <<start>> <<end>> <<end>> ValidateFSpecif parameters fsd: in FSpecDoc evd: out fbk SpecEvalDoc <<strong>> {parameter binding= ([fsd  fsd], [evd  evd])} Fig. 18: Behaviour description of the model SpecifyCompWithNF. Name: SpecifyCompCat Author: JMR & XFG Keywords: software component, specification, Catalysis. Intent: To incorporate into a specification document (Spec- Type) the functional specification of a software component according to a specific role. Pattern parameters: No parameters defined. Pattern structure: Imported from StructralAspectsCat Initial context: A component has to be designed and implemented. The participants should be available and ready to start the specification task. Input parameters: • A collaboration document corresponding to a specific role (col: Collaboration) • The specification document (partially constructed) (spec: SpecType). Result context: The specification document of the component has been built. Output parameters: • A specification document that contains the component specification corresponding to a specific role. (spec:SpecType). Applicability: No additional constraints have been defined. Participants: One or more members of the specifier team Structure: The structure shared by all Catalysis processes (imported from StructuralAspectsCat). Not shown Process: Not shown. Related patterns: ComponentSpecification 40 In the current situation, it is interesting to incorporate NFRs into the SpecifyCompCat Catalysis process pattern by reusing SpecifyCompWithNF. Not all the steps that we will follow are strictly necessary but, in this way, we will illustrate how various reuse operators may be composed along the reuse framework (see figure 1). The proposed operator composition process is shown in fig. 19. Notice that the diagram depicted in this figure is standard UML. The relationships between the various models are represented by means of UML dependencies. The sense of the arrows has been selected according to the UML semantics. The UML metamodel has been extended with several stereotypes and tagged values using the standard UML extension mechanisms (see [UML01]). The steps followed in this reuse process are detailed next. Step 1. Abstraction of SpecifyCompWithNF  SpecifyCompWithNFPattern First of all, we will build the process pattern SpecifyCompWithNFPattern which abstracts the particular specification strategy so that different functional and non-functional methodologies can be used in each particular situation. This abstraction process is carried out by means of a parameterization. The result in shown in fig. 20. By the parameterization of the documents and tasks that are necessary to perform this pattern, many different specific strategies to carry out a specification may be used to instantiate it (e.g., by diagrams, by templates, purely textual, formal –model-oriented, equational, etc..). To preserve consistency, some requirements are established on these parameters (e.g., the document type that instantiates the parameter specification document SpecDoc must have as subdocuments, a functional specification and a non-functional specification documents). These requirements have been expressed in OCL. Notice again that the model for the process pattern is not described just textually but in a rigorous manner using the PROMENADE PML constructs (see fig. 20), which have been mapped into UML. In particular, notice that PROMENADE allows the rigorous definition of parameters by means of their types and of constraints for the parameter instantiation. Notice also that other patterns which propose a different component specification strategy or which do not perform a non-functional specification may coexist with the proposed one. SpecDoc: MetaDocument FSpecifyComp: MetaTask NFSpecifyComp: Metatask <<processPattern>> SpecifyCompWithNFPattern <<SPM>> SpecifyCompWithNF NFSpecDoc: MetaDocument NFSpecifyComp: Metatask <<processPattern>> NFAspects <<processPattern>> SpecifyCompCat NFSpecDoc NFSpecifyComp <<processPattern>> SpecifyCompCatWithNF <<processPattern>> MakeCompCat <<combination>> <<semsubst>> <<projection>> <<parameterization>> <<processPattern>> MakeCompCatWithNF {subst=(SpecifyCompCat, SpecifyCompCatWithNF)} Figure 19: Reuse example. Operator composition process 41 SpecDoc: MetaDocument FSpecifyComp: MetaTask NFSpecifyComp: Metatask <<processPattern>> SpecifyCompWithNFPattern Fig. 20: The SpecifyCompWithNFPattern process pattern Step 2. Adaptation of SpecifyCompWithNFPattern  NFAspects We do not want to incorporate the whole functionality of SpecifyCompWithNFPattern into Specify- CompCat; only the non-functional aspects. For this reason we will adapt this pattern. The idea is to perform a projection of SpecifyCompWithNFPattern onto its non-functional aspects. Therefore, we apply the projection operator, once the elements on which the projection is carried out have been identified. The projection is carried out on the elements that provide the non-functional component specification, namely: NFSpecDoc, as document class; NFSpecifyComp, as task class; and Library, as other cathegory of classes. Therefore, the following operator usage must be performed: NFAspects = projection(SpecifyCompWithNFPattern, {NFSpecDoc, NFSpecifyComp, Library}). The resulting model (NFAspects) will keep (by definition of projection in PROMENADE) the context of the classes on which the projection has been performed. As a result, other classes like FSpecDoc and SpecEvalDoc will belong to NFAspects (since they are parameters of the task class NFSpecifyComp, hence, part of its context). Something similar will happen with ValidateFSpec (since this task class have FSpecDoc as parameter). Step 3. Combination of SpecifyCompCat with NFAspects  SpecifyCompCatWithNF This is the central step of the reuse process we are following. The specification of the NF aspects will be combined with the Catalysis pattern that models the specification of a software component. The new pattern (SpecifyCompCatWithNF) will establish some additional behaviour: the functional specification should be made before the non-functional one. Some considerations must be made prior to the application of the combination operator: Name: SpecifyCompWithNFPattern Author: JMR & XFG Keywords: software component, specification, software attributes, component, non funcionality. Intent: To provide a document (SpecDoc) which contains the functional and non-funcitonal specification of a software component; or to review a previous specification. Pattern parameters: • The specification document type (SpecDoc). • A task to perform the functional specification (FspecifyComp) • A task to perform the non functional specification (NFspecifyComp) Initial context: A component has to be designed and implemented. The participants should be available and ready to start the specification activity. Input parameters: • A library of components (lc: Library) • A library of non-functional properties (lp: Library) (optional) • An evaluation document (if it is a specification revision) (evd: Document) (optional) • The specification document to be reviewed (if it is a specification revision) (sd: SpecDoc). Result context: The specification document of the component has been built. Output parameters: • The specification document completed (sd: SpecDoc). Applicability: Some constraints have been defined on the pattern parameters: (1) SpecDoc.allSupertypes->includes(Document) (2) Specdoc.subdocs->includes(FSpecDoc) (3) Specdoc.subdocs->includes(NFSpecDoc) (4) FSpecifyComp.allSupertypes->includes(Task) (5) FspecifyCom.params->exists(p|p.type=FSpecDoc) (6) NFSpecifyComp.allSupertypes->includes(Task) (7) NFspecifyCom.params->exists(p|p.type=NFSpecDoc) Participants: One or more members of the specifier team Structure: (not shown) Process: (not shown)