Skip to content

Commit

Permalink
Issue #52 - Corrected pin type for expansion region.
Browse files Browse the repository at this point in the history
  • Loading branch information
seidewitz committed Feb 27, 2018
1 parent a5863fb commit 6508684
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2011-2017 Data Access Technologies, Inc. (Model Driven Solutions)
* Copyright 2011-2018 Data Access Technologies, Inc. (Model Driven Solutions)
* All rights reserved worldwide. This program and the accompanying materials
* are made available for use under the terms of the GNU General Public License
* (GPL) version 3 that accompanies this distribution and is available at
Expand Down Expand Up @@ -31,10 +31,10 @@
import org.modeldriven.alf.uml.Operation;
import org.modeldriven.alf.uml.ValueSpecificationAction;
import org.modeldriven.alf.uml.LoopNode;
import org.modeldriven.alf.uml.StructuredActivityNode;
import org.modeldriven.alf.uml.StructuredActivityNode;
import org.modeldriven.alf.uml.Type;
import org.modeldriven.alf.uml.ExpansionRegion;
import org.modeldriven.alf.uml.ActivityNode;
import org.modeldriven.alf.uml.Classifier;
import org.modeldriven.alf.uml.DataType;
import org.modeldriven.alf.uml.Property;
import org.modeldriven.alf.uml.Behavior;
Expand Down Expand Up @@ -489,9 +489,9 @@ public static ActivityNode mapPropertyAssignment(
} else {
// Otherwise, create a node to iteratively add possibly
// multiple values to the property.
Classifier featuringClassifier = property.getFeaturingClassifier().get(0);
Type objectType = ActivityGraph.getObjectType(property);
writeAction.setIsReplaceAll(false);
if (!(featuringClassifier instanceof DataType)) {
if (!(objectType instanceof DataType)) {
// If the property is a feature of a class, use an iterative
// expansion region.
ExpansionRegion region = graph.addExpansionRegion(
Expand All @@ -503,7 +503,7 @@ public static ActivityNode mapPropertyAssignment(

InputPin objectInputPin = graph.createInputPin(
region.getName() + ".input(" + objectSource.getName() + ")",
featuringClassifier, 1, 1);
objectType, 1, 1);
region.addStructuredNodeInput(objectInputPin);
region.addEdge(graph.createObjectFlow(
objectInputPin, writeAction.getObject()));
Expand All @@ -515,7 +515,7 @@ public static ActivityNode mapPropertyAssignment(
// a loop node to iteratively update the data value, rather than
// an expansion region.
InputPin objectInputPin = graph.createInputPin(
objectSource.getName(), featuringClassifier, 1, 1);
objectSource.getName(), objectType, 1, 1);
InputPin valueInputPin = graph.createInputPin(
"value", property.getType(), 0, -1);
LoopNode loopNode = graph.addLoopNode(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

/*******************************************************************************
* Copyright 2011-2017 Data Access Technologies, Inc. (Model Driven Solutions)
* Copyright 2011-2018 Data Access Technologies, Inc. (Model Driven Solutions)
* All rights reserved worldwide. This program and the accompanying materials
* are made available for use under the terms of the GNU General Public License
* (GPL) version 3 that accompanies this distribution and is available at
Expand Down

0 comments on commit 6508684

Please sign in to comment.