Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1453 alisa reffinder cleanup #1454

Merged
merged 4 commits into from Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

This file was deleted.

3 changes: 2 additions & 1 deletion alisa/org.osate.alisa.workbench/META-INF/MANIFEST.MF
Expand Up @@ -26,7 +26,8 @@ Require-Bundle: org.eclipse.xtext;visibility:=reexport,
org.osate.organization;bundle-version="1.0.0",
org.osate.xtext.aadl2.properties;bundle-version="1.0.0",
org.eclipse.xtext.xbase.lib,
org.osate.xtext.aadl2.errormodel;bundle-version="1.0.0"
org.osate.xtext.aadl2.errormodel;bundle-version="1.0.0",
org.osate.aadl2.modelsupport;bundle-version="1.0.0"
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.osate.alisa.workbench,
Expand Down
@@ -1,11 +1,9 @@
package org.osate.alisa.workbench.util

import com.google.inject.ImplementedBy
import com.google.inject.Inject
import org.eclipse.emf.ecore.util.EcoreUtil
import org.osate.aadl2.ComponentClassifier
import org.osate.aadl2.ComponentImplementation
import org.osate.alisa.common.scoping.ICommonGlobalReferenceFinder
import org.osate.aadl2.modelsupport.scoping.Aadl2GlobalScopeUtil
import org.osate.alisa.common.util.CommonUtilExtension
import org.osate.alisa.workbench.alisa.AlisaPackage
import org.osate.alisa.workbench.alisa.AssuranceCase
Expand All @@ -23,21 +21,17 @@ interface IAlisaGlobalReferenceFinder {

class AlisaGlobalReferenceFinder implements IAlisaGlobalReferenceFinder {

@Inject var ICommonGlobalReferenceFinder commonRefFinder

override Iterable<AssurancePlan> getAssurancePlans(ComponentImplementation ci) {
val listAccessiblePlans = commonRefFinder.getEObjectDescriptions(ci, AlisaPackage.Literals.ASSURANCE_CASE,
"alisa").map [ eod |
EcoreUtil.resolve(eod.EObjectOrProxy, ci) as AssuranceCase
].map[ap|ap.assurancePlans].flatten.filter[mp|CommonUtilExtension.isSameorExtends(ci, mp.target)]
val listAccessiblePlans = Aadl2GlobalScopeUtil.getAll(ci,
AlisaPackage.Literals.ASSURANCE_PLAN).map[ape| ape as AssurancePlan].filter[mp|CommonUtilExtension.isSameorExtends(ci, mp.target)]
return listAccessiblePlans

}

override getAssuranceCases(ComponentClassifier ci) {
val cases = commonRefFinder.getEObjectDescriptions(ci, AlisaPackage.Literals.ASSURANCE_CASE, "alisa").map [ eod |
EcoreUtil.resolve(eod.EObjectOrProxy, ci) as AssuranceCase
].filter[mp|CommonUtilExtension.isSameorExtends(ci, mp.system)]
val cases = Aadl2GlobalScopeUtil.getAll(ci, AlisaPackage.Literals.ASSURANCE_CASE)
.map [ eod |eod as AssuranceCase]
.filter[mp|CommonUtilExtension.isSameorExtends(ci, mp.system)]
return cases
}

Expand Down
3 changes: 2 additions & 1 deletion alisa/org.osate.categories/META-INF/MANIFEST.MF
Expand Up @@ -18,7 +18,8 @@ Require-Bundle: org.eclipse.xtext;visibility:=reexport,
org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional,
org.eclipse.core.runtime;bundle-version="3.10.0",
org.eclipse.xtext.xbase.lib,
org.osate.alisa.common;bundle-version="1.0.0"
org.osate.alisa.common;bundle-version="1.0.0",
org.osate.aadl2.modelsupport;bundle-version="1.0.0"
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.osate.categories,
Expand Down