Statistics
| Revision:

root / branches / modelio3.7.x / src / main / java / org / modelio / togaf / profile / businessarchitecture / model / TogafEvent.java @ 237

History | View | Annotate | Download (3.07 KB)

1
/** 
2
 * Licensed to the Apache Software Foundation (ASF) under one 
3
 * or more contributor license agreements.  See the NOTICE file 
4
 * distributed with this work for additional information 
5
 * regarding copyright ownership.  The ASF licenses this file 
6
 * to you under the Apache License, Version 2.0 (the 
7
 * "License"); you may not use this file except in compliance 
8
 * with the License.  You may obtain a copy of the License at 
9
 * 
10
 *        http://www.apache.org/licenses/LICENSE-2.0 
11
 * 
12
 *        Unless required by applicable law or agreed to in writing, 
13
 *        software distributed under the License is distributed on an 
14
 *        "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
15
 *        KIND, either express or implied.  See the License for the 
16
 *        specific language governing permissions and limitations 
17
 *        under the License. 
18
 * 
19
 * 
20
 * @package    org.modelio.togaf. 
21
 * @author     Modelio 
22
 * @license    http://www.apache.org/licenses/LICENSE-2.0 
23
 * @version  1.0.00 
24
 **/
25
package org.modelio.togaf.profile.businessarchitecture.model;
26

    
27
import java.util.List;
28

    
29
import org.modelio.metamodel.uml.behavior.commonBehaviors.Signal;
30
import org.modelio.metamodel.uml.infrastructure.Dependency;
31
import org.modelio.metamodel.uml.infrastructure.ModelTree;
32
import org.modelio.metamodel.uml.statik.Package;
33
import org.modelio.metamodel.uml.statik.TemplateParameter;
34
import org.modelio.togaf.impl.TogafArchitectModule;
35
import org.modelio.togaf.profile.structure.model.BusinessArchitecture;
36
import org.modelio.togaf.profile.utils.ModelUtils;
37
import org.modelio.togaf.profile.utils.ResourceManager;
38

    
39
public class TogafEvent {
40
        protected Signal element;
41

    
42
        public TogafEvent() {
43
                this.element = TogafArchitectModule.getInstance().getModuleContext().getModelingSession().getModel().createSignal();
44
                ModelUtils.setStereotype(this.element, "TogafArchitect","TogafEvent");
45
                this.element.setName(ResourceManager.getName("TogafEvent"));
46
        }
47

    
48
        public TogafEvent(Signal element) {
49
                this.element = element;
50
        }
51

    
52
        public Signal getElement() {
53
                return this.element;
54
        }
55

    
56
        public void setParent(ModelTree parent) {
57
                this.element.setOwner(parent);
58
        }
59

    
60
        public void setParent(TemplateParameter parent) {
61
                this.element.setOwnerTemplateParameter(parent);
62
        }
63

    
64
        public BusinessArchitecture getBusinessArchitecture() {
65
                return new BusinessArchitecture((Package) this.element.getOwner());
66
        }
67

    
68
        public void addBusinessArchitecture(BusinessArchitecture model) {
69
                this.element.setOwner(model.getElement());
70
        }
71

    
72
        public List<IOFlow> getOutIOFlow() {
73
                List<IOFlow> res = new java.util.ArrayList<>();
74
                for (Dependency model_element : this.element.getDependsOnDependency()) {
75
                        res.add(new IOFlow(model_element));
76
                }
77
                return res;
78
        }
79

    
80
        public void addOutIOFlow(IOFlow model) {
81
                this.element.getDependsOnDependency().add(model.getElement());
82
        }
83

    
84
        public List<IOFlow> getInIOFlow() {
85
                List<IOFlow> res = new java.util.ArrayList<>();
86
                for (Dependency model_element : this.element.getImpactedDependency()) {
87
                        res.add(new IOFlow(model_element));
88
                }
89
                return res;
90
        }
91

    
92
        public void addInIOFlow(IOFlow model) {
93
                this.element.getImpactedDependency().add(model.getElement());
94
        }
95

    
96
}