27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

a = O1 → a → O2<br />

b = O2 → b → O3<br />

c = O2 → c → O4<br />

Next, the sequences of actions can be derived as:<br />

a . b = O1 → a → O2 → b → O3<br />

a . c = O1 → a → O2 → c → O4<br />

According to (3), the parallel behaviors with object relations<br />

can be expressed as (4).<br />

a . (b || c) = O1 → a → O2 → (b → O3 || c → O4)<br />

D. Defining Condition<br />

Activity diagrams use a decision node and guard conditions<br />

to denote alternative composition or choices. That is, when a<br />

decision node accepts a token, it will ev aluate if th e token<br />

satisfies which guard condition annotated in square brackets on<br />

branches, and th en deliver the token to th e outgoing edge<br />

satisfying the condition.<br />

Example activity diagram containing a decision and the<br />

associated ADL script are illustrated in Fig. 3.<br />

action receiveOrder end<br />

action fillOrder end<br />

action closeOrder end<br />

receiveOrder -> fillOrder ['order accepted']<br />

receiveOrder -> closeOrder ['order rejected']<br />

Fill Order<br />

[order accepted]<br />

Receive Order<br />

[order rejected]<br />

Figure 3. Example for defining condition<br />

E. Defining Nested Condition<br />

For complex decisions or nested decisions, additional<br />

information of guard conditions will be added to the sequence<br />

of actions. A guard condition also owns input and output<br />

objects to create a co nnection between actions related to it.<br />

Given the following chunk of ADL script,<br />

01 action a end 06 if 'guard2'<br />

02 action b end 07 then b<br />

03 decision from a 08 endif<br />

04 if 'guard1' 09 endif<br />

05 then 10 end<br />

Close Order<br />

the sequence of actions a . b can be expressed as (5).<br />

Suppose<br />

a = O1 → a → O2<br />

b = O2 → b → O3<br />

then a . guard1 & guard2:→ b = O1 → a → O → G1 (5)<br />

→ G2 → b → O3<br />

where G1, G2 denote output objects produced from ‘guard1’<br />

and ‘guard2’, respectively. The values of G1 and G2 a re O2<br />

attached with the evaluated condition.<br />

<br />

IV. GENERATING ACTIVITY DIAGRAM FROM ADL<br />

Parsing ADL scripts results in ADL semantic models,<br />

which cannot be directly transformed to activity diagrams<br />

because they still lack the information of controls, namely fork,<br />

join, decision, and merge. However, the particular pattern<br />

exists for each control and can be detected from the details of<br />

edges (incoming/ outgoing), labeled edges, and flow detail<br />

contained in ADL scripts. Steps to generate activity diagrams<br />

from ADL scripts are illustrated in Fig. 4.<br />

Parse ADL<br />

Script<br />

Normalize Fork and<br />

Decision Nodes<br />

Construct Join and<br />

Merge Nodes<br />

ADL Semantic<br />

Model<br />

Construct Fork and<br />

Decision Nodes<br />

Normalize Join and<br />

Merge Nodes<br />

Figure 4. Steps to generate activity diagrams from ADL scripts<br />

A constructor or a m odel is required for retriev ing loss<br />

information of controls and generating the activity diagram. To<br />

accomplish model-to-model transformation, QVT or query/<br />

view/ transformation specification [11] is applied to describe<br />

the transformation from the semantic model of ADL<br />

metamodel to the semantic model of the metamodel for<br />

constructing activity diagrams, as sh own in Fig. 5. Starting<br />

from defining top-level relations of model transformation that<br />

specify the mappings between the two models as follows,<br />

transformation adl (adl : ADL, constructor :<br />

ADConstructor) {<br />

top relation ObjectToObjectNode {...}<br />

top relation RelationToEdge {...}<br />

top relation ActionToActivityNode {...}<br />

relation ActionToAction {...}<br />

relation ActionToControlNode {...}<br />

}<br />

Build Objects and<br />

Relations<br />

Build Actions<br />

the semantic model for constructing activity diagrams is then<br />

created. Next, it will be transformed to the semantic model of<br />

the metamodel for constructing activity diagrams using the<br />

mappings of top-level relations defined as follows:<br />

transformation ad (constructor : ADConstructor, ad :<br />

AD) {<br />

top relation ObjectNodeToObjectNode {<br />

checkOnly domain constructor left:ObjectNode {<br />

hidden=false, name=on}<br />

enforce domain ad right:ObjectNode {name=on}<br />

...<br />

}<br />

top relation ActionToAction {...}<br />

top relation EdgeToActivityEdge {...}<br />

relation ActivityEdgeToControlFlow {...}<br />

relation ActivityEdgeToObjectFlow {...}<br />

top relation InitialNodeToInitialNode {...}<br />

top relation FlowFinalNodeToFlowFinalNode {...}<br />

top relation ActivityFinalNodeToActivityFinalNode<br />

{...}<br />

top relation ActivityNodeToEdgeDetail {...}<br />

relation OutgoingEdgeToForkAndDecisionNode {...}<br />

relation IncomingEdgeToJoinAndMergeNode {...}<br />

}<br />

726

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!