summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-09-05 11:22:30 (EDT)
committer Stephan Born2012-09-05 11:22:30 (EDT)
commit26dff64fe2328d6862ac3fda19616052cd683504 (patch)
tree8d66eddfb324a581e6305054cd1c646efc5f5fd0
parent36fd1434c07a4bed86511110e7ebe95fc17c55b8 (diff)
downloadorg.eclipse.stardust.ui.web-26dff64fe2328d6862ac3fda19616052cd683504.zip
org.eclipse.stardust.ui.web-26dff64fe2328d6862ac3fda19616052cd683504.tar.gz
org.eclipse.stardust.ui.web-26dff64fe2328d6862ac3fda19616052cd683504.tar.bz2
CRNT-26070
1)Added code in m_connection.js to update the existing connection in case of IN-OUT mapping in setAnchorPoint() 2)Added code in ModelElementUnmarshaller.java to updateDataFlowConnection() for DataMapping handling. 3)Added method in ModelElementMarshaller.java for DataMappingType JSON object creation git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58947 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java3
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java104
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java144
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js82
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js8
5 files changed, 252 insertions, 89 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java
index 46caba9..14b9fb4 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java
@@ -393,8 +393,7 @@ public class ConnectionCommandHandler
DataMappingType dataMapping = AbstractElementBuilder.F_CWM.createDataMappingType();
DataMappingConnectionType dataMappingConnection = AbstractElementBuilder.F_CWM.createDataMappingConnectionType();
- // TODO Add index
-
+ dataMapping.setElementOid(++maxOid);
dataMapping.setId(data.getId());
dataMapping.setName(data.getName());
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
index 6742a77..267fcd5 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
@@ -110,6 +110,10 @@ public abstract class ModelElementMarshaller
{
jsResult = toDataMappingConnectionType((DataMappingConnectionType) modelElement);
}
+ else if (modelElement instanceof DataMappingType)
+ {
+ jsResult = toDataMappingJson((DataMappingType) modelElement);
+ }
else if (modelElement instanceof DataType)
{
jsResult = toDataJson((DataType) modelElement);
@@ -219,7 +223,7 @@ public abstract class ModelElementMarshaller
for (DataPathType dataPath : processDefinition.getDataPath())
{
JsonObject dataPathJson = new JsonObject();
-
+
dataPathesJson.add(dataPathJson);
dataPathJson.addProperty(ModelerConstants.ID_PROPERTY, dataPath.getId());
dataPathJson.addProperty(ModelerConstants.NAME_PROPERTY, dataPath.getName());
@@ -431,11 +435,13 @@ public abstract class ModelElementMarshaller
for (DataMappingConnectionType dataMappingConnection : poolSymbol.getDataMappingConnection())
{
JsonObject connectionJson = toDataMappingConnectionType(dataMappingConnection);
-
+ if (connectionJson.has(ModelerConstants.MODEL_ELEMENT_PROPERTY))
+ {
connectionsJson.add(
extractString(
connectionJson.getAsJsonObject(ModelerConstants.MODEL_ELEMENT_PROPERTY),
ModelerConstants.ID_PROPERTY), connectionJson);
+ }
}
// Transitions
@@ -1168,6 +1174,7 @@ public abstract class ModelElementMarshaller
DataMappingConnectionType dataMappingConnection)
{
JsonObject connectionJson = new JsonObject();
+ JsonObject dataFlowJson = new JsonObject();
connectionJson.addProperty(ModelerConstants.OID_PROPERTY,
dataMappingConnection.getElementOid());
@@ -1177,47 +1184,21 @@ public abstract class ModelElementMarshaller
connectionJson.addProperty(ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY,
mapAnchorOrientation(dataMappingConnection.getTargetAnchor()));
- JsonObject dataFlowJson = new JsonObject();
- connectionJson.add(ModelerConstants.MODEL_ELEMENT_PROPERTY, dataFlowJson);
-
DataType data = dataMappingConnection.getDataSymbol().getData();
if (null != data)
{
- dataFlowJson.addProperty(ModelerConstants.TYPE_PROPERTY,
- ModelerConstants.DATA_FLOW_LITERAL);
- dataFlowJson.addProperty(ModelerConstants.ID_PROPERTY, ""
- + dataMappingConnection.getElementOid());
ActivityType activity = dataMappingConnection.getActivitySymbol().getActivity();
for (DataMappingType dataMapping : activity.getDataMapping())
{
// Update the dataFlowJson for currentData symbol
if (dataMapping.getData().getId() == data.getId())
{
- if (dataMapping.getDirection() == DirectionType.IN_LITERAL)
- {
- dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY,
- true);
- dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY,
- false);
- connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_OID,
- dataMappingConnection.getDataSymbol().getElementOid());
- connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_TYPE,
- ModelerConstants.DATA);
- connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_OID,
- dataMappingConnection.getActivitySymbol().getElementOid());
- connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_TYPE,
- ModelerConstants.ACTIVITY_KEY);
-
- }
- else if (dataMapping.getDirection() == DirectionType.OUT_LITERAL)
+ dataFlowJson = toDataMappingJson(dataMapping);
+ // TODO - Currently API always assumes connectionJson.getSourceNode will
+ // be data, to set Activity in sourceNode for OUT Mapping for data below
+ // code is added.
+ if (dataFlowJson.has(ModelerConstants.OUT_DATA_MAPPING_PROPERTY))
{
- dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY,
- false);
- dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY,
- true);
- // TODO - Currently API always assumes connectionJson.getSourceNode will
- // be data, to set Activity in sourceNode for OUT Mapping for data this
- // code is placed here
connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_OID,
dataMappingConnection.getActivitySymbol().getElementOid());
connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_TYPE,
@@ -1228,11 +1209,17 @@ public abstract class ModelElementMarshaller
ModelerConstants.DATA);
}
else
+ // If user unchecks IN,OUT mapping from properties page, following will be
+ // considered
{
- dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY,
- true);
- dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY,
- true);
+ connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_OID,
+ dataMappingConnection.getDataSymbol().getElementOid());
+ connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_TYPE,
+ ModelerConstants.DATA);
+ connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_OID,
+ dataMappingConnection.getActivitySymbol().getElementOid());
+ connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_TYPE,
+ ModelerConstants.ACTIVITY_KEY);
}
}
}
@@ -1242,6 +1229,7 @@ public abstract class ModelElementMarshaller
getModelBuilderFacade().createFullId(ModelUtils.findContainingModel(data),
data));
dataFlowJson.addProperty(ModelerConstants.ACTIVITY_ID_PROPERTY, activity.getId());
+ connectionJson.add(ModelerConstants.MODEL_ELEMENT_PROPERTY, dataFlowJson);
}
return connectionJson;
@@ -1438,6 +1426,48 @@ public abstract class ModelElementMarshaller
}
/**
+ *
+ * @param dataMapping
+ * @return
+ */
+ public JsonObject toDataMappingJson(DataMappingType dataMapping)
+ {
+ JsonObject dataFlowJson = new JsonObject();
+
+ dataFlowJson.addProperty(ModelerConstants.TYPE_PROPERTY,
+ ModelerConstants.DATA_FLOW_LITERAL);
+ dataFlowJson.addProperty(ModelerConstants.ID_PROPERTY, dataMapping.getId());
+ dataFlowJson.addProperty(ModelerConstants.OID_PROPERTY, dataMapping.getElementOid());
+
+ if (null != dataMapping.getDirection())
+ {
+ if (dataMapping.getDirection().equals(DirectionType.IN_LITERAL))
+ {
+ dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY, true);
+ dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY, false);
+ }
+ else if (dataMapping.getDirection().equals(DirectionType.OUT_LITERAL))
+ {
+ dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY, false);
+ dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY, true);
+ }
+ else if(dataMapping.getDirection().equals(DirectionType.INOUT_LITERAL))
+ {
+ // IN_OUT Mapping scenario
+ dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY, true);
+ dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY, true);
+ }
+ else
+ {
+ dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY, false);
+ dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY, false);
+ }
+ }
+ return dataFlowJson;
+ }
+
+
+ /**
* @param model
* @return
*/
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
index bf3f196..301fa7a 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
@@ -38,6 +38,7 @@ import org.eclipse.stardust.model.xpdl.carnot.ApplicationType;
import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelFactory;
import org.eclipse.stardust.model.xpdl.carnot.ConditionalPerformerType;
import org.eclipse.stardust.model.xpdl.carnot.DataMappingConnectionType;
+import org.eclipse.stardust.model.xpdl.carnot.DataMappingType;
import org.eclipse.stardust.model.xpdl.carnot.DataPathType;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
import org.eclipse.stardust.model.xpdl.carnot.DescriptionType;
@@ -59,9 +60,9 @@ import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils;
import org.eclipse.stardust.model.xpdl.xpdl2.TypeDeclarationType;
/**
- *
+ *
* @author Marc.Gille
- *
+ *
*/
public abstract class ModelElementUnmarshaller
{
@@ -112,7 +113,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param element
* @param json
*/
@@ -197,7 +198,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param element
* @param json
*/
@@ -284,7 +285,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param element
* @param controlFlowJson
*/
@@ -344,22 +345,46 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param dataFlowConnection
* @param dataFlowConnectionJson
*/
private void updateDataFlowConnection(DataMappingConnectionType dataFlowConnection,
JsonObject dataFlowConnectionJson)
{
- dataFlowConnection.setSourceAnchor(mapAnchorOrientation(extractInt(
- dataFlowConnectionJson,
- ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY)));
- dataFlowConnection.setTargetAnchor(mapAnchorOrientation(extractInt(
- dataFlowConnectionJson, ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY)));
+ JsonObject dataFlowJson = dataFlowConnectionJson.getAsJsonObject(ModelerConstants.MODEL_ELEMENT_PROPERTY);
+ if (dataFlowConnectionJson.has(ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY))
+ {
+ dataFlowConnection.setSourceAnchor(mapAnchorOrientation(extractInt(
+ dataFlowConnectionJson,
+ ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY)));
+ }
+ if (dataFlowConnectionJson.has(ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY))
+ {
+ dataFlowConnection.setTargetAnchor(mapAnchorOrientation(extractInt(
+ dataFlowConnectionJson,
+ ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY)));
+ }
+
+ if (dataFlowJson.has(ModelerConstants.IN_DATA_MAPPING_PROPERTY)
+ || dataFlowJson.has(ModelerConstants.OUT_DATA_MAPPING_PROPERTY))
+ {
+ for (DataMappingType dataMapping : dataFlowConnection.getActivitySymbol()
+ .getActivity()
+ .getDataMapping())
+ {
+ if (dataMapping.getId() == dataFlowConnection.getDataSymbol()
+ .getData()
+ .getId())
+ {
+ updateDataMapping(dataFlowJson, dataMapping);
+ }
+ }
+ }
}
/**
- *
+ *
* @param element
* @param json
*/
@@ -381,7 +406,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param processDefinition
* @param processDefinitionJson
*/
@@ -513,7 +538,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param activitySymbol
* @param activitySymbolJson
*/
@@ -530,7 +555,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param activitySymbol
* @param gatewaySymbolJson
*/
@@ -547,7 +572,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param startEventSymbol
* @param startEventSymbolJson
*/
@@ -563,7 +588,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param endEventSymbol
* @param endEventSymbolJson
*/
@@ -736,7 +761,7 @@ public abstract class ModelElementUnmarshaller
System.out.println("Creating Primitive Type: " + dataJson.get(ModelerConstants.PRIMITIVE_DATA_TYPE_PROPERTY));
getModelBuilderFacade().updatePrimitiveData(data, dataJson.get(ModelerConstants.PRIMITIVE_DATA_TYPE_PROPERTY).getAsString());
-
+
System.out.println("Primitive Type: " + data.getType());
}
else if (dataJson.get(ModelerConstants.DATA_TYPE_PROPERTY).getAsString().equals(
@@ -748,7 +773,7 @@ public abstract class ModelElementUnmarshaller
}
else
{
- System.out.println("Other type " + dataJson.get(ModelerConstants.DATA_TYPE_PROPERTY).getAsString());
+ System.out.println("Other type " + dataJson.get(ModelerConstants.DATA_TYPE_PROPERTY).getAsString());
}
}
}
@@ -765,7 +790,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param element
* @param elementJson
* @param elementProperties
@@ -783,7 +808,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param targetElement
* @param request
* @param property
@@ -853,7 +878,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param json
* @param element
* @throws JSONException
@@ -882,7 +907,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param modelElementJson
* @param element
*/
@@ -906,7 +931,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param orientation
* @return
*/
@@ -933,7 +958,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @return
*/
private ModelBuilderFacade getModelBuilderFacade()
@@ -946,7 +971,7 @@ public abstract class ModelElementUnmarshaller
}
/**
- *
+ *
* @param json
* @param memberName
* @return
@@ -960,4 +985,71 @@ public abstract class ModelElementUnmarshaller
? member.getAsString()
: (String) null;
}
+
+ /**
+ *
+ * @param dataFlowJson
+ * @param dataMapping
+ */
+ private void updateDataMapping(JsonObject dataFlowJson, DataMappingType dataMapping)
+ {
+ // If both IN-OUT mapping is present
+ if (dataFlowJson.has(ModelerConstants.IN_DATA_MAPPING_PROPERTY)
+ && dataFlowJson.has(ModelerConstants.OUT_DATA_MAPPING_PROPERTY))
+ {
+ if (dataFlowJson.get(ModelerConstants.IN_DATA_MAPPING_PROPERTY).getAsBoolean()
+ && dataFlowJson.get(ModelerConstants.OUT_DATA_MAPPING_PROPERTY)
+ .getAsBoolean())
+ {
+ dataMapping.setDirection(DirectionType.INOUT_LITERAL);
+ }
+ }
+ // IN data mapping is updates
+ else if (dataFlowJson.has(ModelerConstants.IN_DATA_MAPPING_PROPERTY))
+ {
+ if (dataFlowJson.get(ModelerConstants.IN_DATA_MAPPING_PROPERTY).getAsBoolean())
+ {
+ //If OUT mapping was already set , update to IN-OUT mapping
+ if (dataMapping.getDirection().equals(DirectionType.OUT_LITERAL))
+ {
+ dataMapping.setDirection(DirectionType.INOUT_LITERAL);
+ }
+ else
+ {
+ dataMapping.setDirection(DirectionType.IN_LITERAL);
+ }
+ }
+ else
+ {
+ if (dataMapping.getDirection().equals(DirectionType.INOUT_LITERAL))
+ {
+ dataMapping.setDirection(DirectionType.OUT_LITERAL);
+ }
+ }
+ }
+ // OUT data mapping is updates
+ else if (dataFlowJson.has(ModelerConstants.OUT_DATA_MAPPING_PROPERTY))
+ {
+ if (dataFlowJson.get(ModelerConstants.OUT_DATA_MAPPING_PROPERTY).getAsBoolean())
+ {
+ //If IN mapping was already set , update to IN-OUT mapping
+ if (dataMapping.getDirection().equals(DirectionType.IN_LITERAL))
+ {
+ dataMapping.setDirection(DirectionType.INOUT_LITERAL);
+ }
+ else
+ {
+ dataMapping.setDirection(DirectionType.OUT_LITERAL);
+ }
+ }
+ else
+ {
+ if (dataMapping.getDirection().equals(DirectionType.INOUT_LITERAL))
+ {
+ dataMapping.setDirection(DirectionType.IN_LITERAL);
+ }
+ }
+ }
+ }
+
}
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js
index e5ef4a6..7064752 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js
@@ -387,25 +387,43 @@ define(
*/
Connection.prototype.setSecondAnchorPoint = function(
anchorPoint, sync) {
- /*if (this.isDataFlow()) {
- if (this.fromAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
- var dataSymbol = this.fromAnchorPoint.symbol;
- var activity = this.toAnchorPoint.symbol;
- } else {
- var dataSymbol = this.toAnchorPoint.symbol;
- var activity = this.fromAnchorPoint.symbol;
- }
- for ( var n in dataSymbol.connections) {
- if (dataSymbol.connections[n].oid
- && (dataSymbol.connections[n].fromAnchorPoint.symbol.oid == activity.oid || dataSymbol.connections[n].toAnchorPoint.symbol.oid)) {
- }
- }
- }*/
this.setSecondAnchorPointNoComplete(anchorPoint);
-
+ var updateConnection = null;
if (this.toAnchorPoint.symbol != null) {
- this.complete(sync);
+ // When IN mapping present and OUT mapping is added,
+ // same connection is modified viceversa
+ if (this.isDataFlow()) {
+ if (this.fromAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
+ var dataSymbol = this.fromAnchorPoint.symbol;
+ var activity = this.toAnchorPoint.symbol;
+ } else {
+ var dataSymbol = this.toAnchorPoint.symbol;
+ var activity = this.fromAnchorPoint.symbol;
+ }
+ for ( var n in dataSymbol.connections) {
+ // Identify if connection exist between same
+ // Data and Activity symbol
+ if (dataSymbol.connections[n].oid
+ && (dataSymbol.connections[n].fromAnchorPoint.symbol.oid == activity.oid || dataSymbol.connections[n].toAnchorPoint.symbol.oid)) {
+ // Use the existing connection
+ updateConnection = dataSymbol.connections[n];
+ // This will be the case always, just cross
+ // verification for IN-OUT mapping
+ if ((updateConnection.modelElement.inDataMapping && this.modelElement.outDataMapping)
+ || (updateConnection.modelElement.outDataMapping && this.modelElement.inDataMapping)) {
+ updateConnection.modelElement.inDataMapping = true;
+ updateConnection.modelElement.outDataMapping = true;
+ updateConnection.createUpdateCommand();
+ break;
+ }
+ }
+ }
+ }
+ // If update is not called, new connection is created
+ if (updateConnection == null) {
+ this.complete(sync);
+ }
}
};
@@ -445,6 +463,8 @@ define(
transferObject.segments = null;
} else {
transferObject.modelElement = transferObject.modelElement.createTransferObject();
+ if (this.modelElement)
+ transferObject.modelElement.oid = this.modelElement.oid;
}
return transferObject;
@@ -733,13 +753,33 @@ define(
"stroke-dasharray" : "-"
});
- //For In-Mapping path will be from Data to Activity
- //vice-versa for Out mapping
+ // For In-Mapping path will be from Data to Activity
+ // vice-versa for Out mapping
if (this.modelElement.inDataMapping
- || this.modelElement.outDataMapping) {
- this.path.attr("arrow-start", "none");
+ && this.modelElement.outDataMapping) {
+ this.path.attr("arrow-start", "block-wide-long");
this.path.attr("arrow-end", "block-wide-long");
- } else {
+ } else if (this.modelElement.inDataMapping) {
+ // When dataFlow modified from properties panel the
+ // From,To anchor point symbols to not change
+ if (this.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
+ this.path
+ .attr("arrow-start", "block-wide-long");
+ this.path.attr("arrow-end", "none");
+ } else {
+ this.path.attr("arrow-start", "none");
+ this.path.attr("arrow-end", "block-wide-long");
+ }
+ } else if (this.modelElement.outDataMapping) {
+ if (this.fromAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
+ this.path
+ .attr("arrow-start", "block-wide-long");
+ this.path.attr("arrow-end", "none");
+ } else {
+ this.path.attr("arrow-start", "none");
+ this.path.attr("arrow-end", "block-wide-long");
+ }
+ }else {
this.path.attr("arrow-start", "none");
this.path.attr("arrow-end", "none");
}
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js
index dbf9ec1..a32338c 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js
@@ -1429,12 +1429,14 @@ define(
anchorPoint)) {
this.currentConnection
.setSecondAnchorPoint(anchorPoint);
- this.currentConnection.select();
+ if (!this.currentConnection.isCompleted()) {
+ this.currentConnection.remove();
+ } else {
+ this.currentConnection.select();
+ }
this.currentConnection = null;
this.mode = this.NORMAL_MODE;
}
-
-
}
};