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

Cleanup Reactions language #42

Merged
merged 27 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
979a4dc
Remove obsolete operation registry in Reaction generator
HeikoKlare Jul 20, 2022
03802f2
Remove unused executor interface
HeikoKlare Jul 20, 2022
11cde49
Remove unused correspondence fail handler
HeikoKlare Jul 20, 2022
1a38aba
Streamline naming of Reaction and Routine interfaces and classes
HeikoKlare Jul 21, 2022
c09b4be
Unify naming of abstract Reation and Routine realizations
HeikoKlare Jul 21, 2022
1359b0f
Remove obsolete Reaction executor
HeikoKlare Jul 21, 2022
1bf5dba
Restructure Reactions runtime helper
HeikoKlare Jul 21, 2022
d3385d6
Restructure Reactions runtime classes
HeikoKlare Jul 21, 2022
2205f8e
Improve naming of facade classes
HeikoKlare Jul 21, 2022
25b47b5
Correct fluent Reaction builder tests generated code
HeikoKlare Jul 21, 2022
d95b1aa
Execute Reactions against routines facade interface
HeikoKlare Jul 21, 2022
d028572
Unify formatting in Reactions runtime project
HeikoKlare Jul 21, 2022
5524e5a
Make Reaction call management independent from execution state
HeikoKlare Jul 22, 2022
62f166d
Adapt Commonalities to moved Reaction execution state class
HeikoKlare Jul 22, 2022
27ac3a7
Simplify Reactions parameter generation
HeikoKlare Jul 22, 2022
18e2329
Unify passing execution state through Reactions
HeikoKlare Jul 22, 2022
345d964
Remove obsolete Reactions executor from Reactions tests
HeikoKlare Jul 22, 2022
2a38b3c
Provide predefined method for creating objects in Reaction routines
HeikoKlare Jul 25, 2022
85718ec
Remove unused methods
HeikoKlare Jul 25, 2022
007a81e
Unify method names
HeikoKlare Jul 25, 2022
d8ad943
Correct methods provided by abstract routine implementation
HeikoKlare Jul 25, 2022
bf1bde7
Unify correspondence access in Reactions
HeikoKlare Jul 25, 2022
6dae85f
Provide predefined matcher methods as constants
HeikoKlare Jul 25, 2022
bea7fb6
Correct package of routine step class generators
HeikoKlare Jul 25, 2022
33e685b
Move handling empty preconditions of Reactions to predefined class
HeikoKlare Jul 28, 2022
9be492f
Use remove instead of delete operation when removing elements
HeikoKlare Jul 28, 2022
da3eb34
Apply suggestions from code review
HeikoKlare Aug 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import tools.vitruv.change.correspondence.CorrespondenceModel

import static com.google.common.base.Preconditions.*

import static extension tools.vitruv.dsls.reactions.runtime.helper.ReactionsCorrespondenceHelper.*
import static extension tools.vitruv.dsls.reactions.runtime.helper.ReactionsCorrespondenceHelper.getCorrespondingElements

@Utility
class IntermediateModelHelper {
Expand All @@ -28,13 +28,13 @@ class IntermediateModelHelper {
static def <I extends Intermediate> I getCorrespondingIntermediate(CorrespondenceModel correspondenceModel,
EObject object, Class<I> intermediateType) {
// Assumption: Each object has at most one Intermediate correspondence.
return correspondenceModel.getCorrespondingObjectsOfType(object, null, intermediateType).head
return correspondenceModel.getCorrespondingElements(object, intermediateType, null).head
}

static def IntermediateResourceBridge getCorrespondingResourceBridge(CorrespondenceModel correspondenceModel,
EObject object) {
checkArgument(!(object instanceof Intermediate), "object cannot be of type Intermediate")
// Assumption: Each object has at most one Resource correspondence.
return correspondenceModel.getCorrespondingObjectsOfType(object, null, IntermediateResourceBridge).head
return correspondenceModel.getCorrespondingElements(object, IntermediateResourceBridge, null).head
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import tools.vitruv.dsls.commonalities.runtime.intermediatemodelbase.Intermediat
import tools.vitruv.dsls.commonalities.runtime.intermediatemodelbase.IntermediateModelBasePackage
import tools.vitruv.dsls.commonalities.runtime.resources.IntermediateResourceBridge
import tools.vitruv.dsls.commonalities.runtime.resources.ResourcesFactory
import tools.vitruv.dsls.reactions.runtime.helper.ReactionsCorrespondenceHelper
import static extension tools.vitruv.dsls.reactions.runtime.helper.ReactionsCorrespondenceHelper.getCorrespondingElements
import tools.vitruv.change.correspondence.CorrespondenceModel
import tools.vitruv.change.propagation.ResourceAccess

Expand Down Expand Up @@ -217,8 +217,7 @@ class ParticipationMatcher {
return Collections.singleton(object)
}

if (!ReactionsCorrespondenceHelper.getCorrespondingObjectsOfType(correspondenceModel, object, null,
Intermediate).empty) {
if (!correspondenceModel.getCorrespondingElements(object, Intermediate, null).empty) {
val attributeReferenceRootNode = containmentContext.attributeReferenceRootNode
if (attributeReferenceRootNode !== null) {
if (followAttributeReferences && attributeReferenceRootNode.matchesObject(object,
Expand Down Expand Up @@ -376,8 +375,8 @@ class ParticipationMatcher {
// Note: Not checking for correspondences for our dynamically created (and only partially setup)
// ResourceBridge.
if (!object.isResourceBridge) {
var correspondingIntermediate = ReactionsCorrespondenceHelper.getCorrespondingObjectsOfType(
correspondenceModel, object, null, Intermediate).head
var correspondingIntermediate = correspondenceModel.getCorrespondingElements(
object, Intermediate, null).head
if (correspondingIntermediateType != correspondingIntermediate?.eClass) {
if (correspondingIntermediateType === null) {
logger.trace('''«indent(depth)»Node «node.toSimpleString»: Object already corresponds to an «
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tools.vitruv.dsls.commonalities.runtime.operators.mapping.attribute

import tools.vitruv.dsls.reactions.runtime.ReactionExecutionState
import tools.vitruv.dsls.reactions.runtime.state.ReactionExecutionState

import static com.google.common.base.Preconditions.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tools.vitruv.dsls.commonalities.runtime.operators.mapping.reference

import tools.vitruv.dsls.reactions.runtime.ReactionExecutionState
import tools.vitruv.dsls.reactions.runtime.state.ReactionExecutionState

import static com.google.common.base.Preconditions.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tools.vitruv.dsls.commonalities.runtime.operators.mapping.reference
import java.util.List
import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.ecore.EReference
import tools.vitruv.dsls.reactions.runtime.ReactionExecutionState
import tools.vitruv.dsls.reactions.runtime.state.ReactionExecutionState

import static com.google.common.base.Preconditions.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import tools.vitruv.dsls.commonalities.runtime.intermediatemodelbase.Intermediat
import tools.vitruv.dsls.commonalities.runtime.resources.Resource
import tools.vitruv.dsls.commonalities.runtime.resources.ResourcesPackage
import tools.vitruv.dsls.reactions.runtime.helper.PersistenceHelper
import tools.vitruv.dsls.reactions.runtime.helper.ReactionsCorrespondenceHelper
import static extension tools.vitruv.dsls.reactions.runtime.helper.ReactionsCorrespondenceHelper.getCorrespondingElements

import static com.google.common.base.Preconditions.*
import static tools.vitruv.dsls.commonalities.runtime.helper.XtendAssertHelper.*
Expand Down Expand Up @@ -200,9 +200,9 @@ class IntermediateResourceBridgeI extends IntermediateResourceBridgeImpl {
intermediates += intermediateCorrespondenceContainer

val resourceHaving = intermediates.flatMap [
ReactionsCorrespondenceHelper.getCorrespondingModelElements(it, EObject, null, [
correspondenceModel.getCorrespondingElements(it, EObject, null, [
!(it instanceof Intermediate) && !(it instanceof Resource) && eResource !== null
], correspondenceModel)
])
].head
if (resourceHaving === null) {
throw new IllegalStateException('''Could not find any transitive correspondence or container of ‹«content
Expand Down Expand Up @@ -231,8 +231,7 @@ class IntermediateResourceBridgeI extends IntermediateResourceBridgeImpl {
// Collecting to Set removes duplicates and avoids a ConcurrentModificationException when adding the results to
// the result Set.
val transitiveIntermediates = foundIntermediates.flatMap [ intermediate |
ReactionsCorrespondenceHelper.getCorrespondingModelElements(intermediate, Intermediate, null, null,
correspondenceModel)
correspondenceModel.getCorrespondingElements(intermediate, Intermediate, null, null)
].toSet

// Add to result Set: This removes objects which we have already found before.
Expand All @@ -246,8 +245,7 @@ class IntermediateResourceBridgeI extends IntermediateResourceBridgeImpl {

private def findIntermediateCorrespondence(EObject object) {
if (correspondenceModel === null) return null; // TODO
val result = ReactionsCorrespondenceHelper.getCorrespondingModelElements(object, Intermediate, null, null,
correspondenceModel).head
val result = correspondenceModel.getCorrespondingElements(object, Intermediate, null, null).head
if (result === null) {
throw new IllegalStateException('''Could not find the intermediate correspondence of ‹«object»›!''')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ Require-Bundle: org.apache.log4j;visibility:=reexport,
tools.vitruv.change.composite;visibility:=reexport,
tools.vitruv.change.propagation;visibility:=reexport,
tools.vitruv.change.interaction;visibility:=reexport,
edu.kit.ipd.sdq.commons.util.emf
edu.kit.ipd.sdq.commons.util.emf,
edu.kit.ipd.sdq.activextendannotations
Bundle-ActivationPolicy: lazy
Export-Package: tools.vitruv.dsls.reactions.runtime,
Export-Package: tools.vitruv.dsls.reactions.runtime.reactions,
tools.vitruv.dsls.reactions.runtime.routines,
tools.vitruv.dsls.reactions.runtime.state,
tools.vitruv.dsls.reactions.runtime.helper,
tools.vitruv.dsls.reactions.runtime.marker,
tools.vitruv.dsls.reactions.runtime.structure,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading