Statistics
| Revision:

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

History | View | Annotate | Download (4.84 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.infrastructure.Dependency;
30
import org.modelio.metamodel.uml.infrastructure.ModelTree;
31
import org.modelio.metamodel.uml.statik.Interface;
32
import org.modelio.metamodel.uml.statik.Package;
33
import org.modelio.togaf.impl.TogafArchitectModule;
34
import org.modelio.togaf.profile.structure.model.BusinessArchitecture;
35
import org.modelio.togaf.profile.utils.ModelUtils;
36
import org.modelio.togaf.profile.utils.ResourceManager;
37

    
38
public class TogafFunction extends TogafService {
39

    
40
        public TogafFunction() {
41
                super(TogafArchitectModule.getInstance().getModuleContext().getModelingSession().getModel().createInterface());
42
                ModelUtils.setStereotype(this.element, "TogafArchitect","TogafFunction");
43
                this.element.setName(ResourceManager.getName("TogafFunction"));
44
                try {
45
                        
46
                        this.element.putNoteContent( "TogafArchitect", "TogafService_contract", "");
47

    
48
                        this.element.putNoteContent( "TogafArchitect", "TogafFunction_valueFactor", "");
49

    
50
                        this.element.putNoteContent( "TogafArchitect", "TogafFunction_changesNeeded", "");
51

    
52
                        this.element.putNoteContent( "TogafArchitect", "TogafFunction_increments", "");
53

    
54
                } catch (Exception e ) {
55
                        e.printStackTrace();
56
                }
57
        }
58

    
59
        public TogafFunction(Interface element) {
60
                super(element);
61
        }
62

    
63
        public String getvalueFactor() {
64
                String res = this.element.getNoteContent("TogafArchitect","TogafFunction_valueFactor");
65
                if (res == null || res.equals("")) {
66
                        res = "";
67
                }
68
                return res;
69
        }
70

    
71
        public void setvalueFactor(String value) {
72
                try {
73
                        this.element.putNoteContent( "TogafArchitect", "TogafFunction_valueFactor", value);
74
                } catch (Exception e) {
75
                        e.printStackTrace();
76
                }
77
        }
78

    
79
        public String getchangesNeeded() {
80
                String res = this.element.getNoteContent("TogafArchitect","TogafFunction_changesNeeded");
81
                if (res == null || res.equals("")) {
82
                        res = "";
83
                }
84
                return res;
85
        }
86

    
87
        public void setchangesNeeded(String value) {
88
                try {
89
                        this.element.putNoteContent( "TogafArchitect", "TogafFunction_changesNeeded", value);
90
                } catch (Exception e) {
91
                        e.printStackTrace();
92
                }
93
        }
94

    
95
        public String getincrements() {
96
                String res = this.element.getNoteContent("TogafArchitect","TogafFunction_increments");
97
                if (res == null || res.equals("")) {
98
                        res = "";
99
                }
100
                return res;
101
        }
102

    
103
        public void setincrements(String value) {
104
                try {
105
                        this.element.putNoteContent( "TogafArchitect", "TogafFunction_increments", value);
106
                } catch (Exception e) {
107
                        e.printStackTrace();
108
                }
109
        }
110

    
111
        public BusinessArchitecture getBusinessArchitecture() {
112
                return new BusinessArchitecture((Package) this.element.getOwner());
113
        }
114

    
115
        public void addBusinessArchitecture(BusinessArchitecture model) {
116
                this.element.setOwner(model.getElement());
117
        }
118

    
119
        public List<TogafService> getTogafService() {
120
                List<TogafService> res = new java.util.ArrayList<>();
121
                for (ModelTree model_element : this.element.getOwnedElement()) {
122
                        res.add(new TogafService((Interface) model_element));
123
                }
124
                return res;
125
        }
126

    
127
        public void addTogafService(TogafService model) {
128
                this.element.getOwnedElement().add(model.getElement());
129
        }
130

    
131
        public List<TogafFunctionSequence> getOutTogafFunctionSequence() {
132
                List<TogafFunctionSequence> res = new java.util.ArrayList<>();
133
                for (Dependency model_element : this.element.getDependsOnDependency()) {
134
                        res.add(new TogafFunctionSequence(model_element));
135
                }
136
                return res;
137
        }
138

    
139
        public void addOutTogafFunctionSequence(TogafFunctionSequence model) {
140
                this.element.getDependsOnDependency().add(model.getElement());
141
        }
142

    
143
        public List<TogafFunctionSequence> getInTogafFunctionSequence() {
144
                List<TogafFunctionSequence> res = new java.util.ArrayList<>();
145
                for (Dependency model_element : this.element.getImpactedDependency()) {
146
                        res.add(new TogafFunctionSequence(model_element));
147
                }
148
                return res;
149
        }
150

    
151
        public void addInTogafFunctionSequence(TogafFunctionSequence model) {
152
                this.element.getImpactedDependency().add(model.getElement());
153
        }
154

    
155
}