summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-20 08:02:34 (EDT)
committerManik Kishore2012-08-20 08:02:34 (EDT)
commitd302074366403ec9eb9b08d766b38e0456a26abe (patch)
treed8a9935bc44d8f73bf4dc5909fee88d62cc6fcd4
parent3486b28a2b28aa4611c479fad8a407f6ca9bdb7f (diff)
downloadorg.eclipse.stardust.ui.web-d302074366403ec9eb9b08d766b38e0456a26abe.zip
org.eclipse.stardust.ui.web-d302074366403ec9eb9b08d766b38e0456a26abe.tar.gz
org.eclipse.stardust.ui.web-d302074366403ec9eb9b08d766b38e0456a26abe.tar.bz2
Jira-ID: CRNT-25577
Removed the method createDataFlowConnection from ModelService.java. Added code to updateDataFlowConnection in ModelElementUnmarshaller git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58539 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java20
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java64
2 files changed, 22 insertions, 62 deletions
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 4de3844..ae79908 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
@@ -37,6 +37,7 @@ import org.eclipse.stardust.model.xpdl.carnot.ActivitySymbolType;
import org.eclipse.stardust.model.xpdl.carnot.ActivityType;
import org.eclipse.stardust.model.xpdl.carnot.ApplicationType;
import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelFactory;
+import org.eclipse.stardust.model.xpdl.carnot.DataMappingConnectionType;
import org.eclipse.stardust.model.xpdl.carnot.DataPathType;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
import org.eclipse.stardust.model.xpdl.carnot.DescriptionType;
@@ -190,6 +191,10 @@ public abstract class ModelElementUnmarshaller
{
updateControlFlowConnection((TransitionConnectionType) element, json);
}
+ else if (element instanceof DataMappingConnectionType)
+ {
+ updateDataFlowConnection((DataMappingConnectionType) element, json);
+ }
else
{
System.out.println("===> Unsupported Symbol " + element);
@@ -329,6 +334,21 @@ 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)));
+ }
+
+ /**
+ *
* @param element
* @param json
*/
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java
index 58695f9..ead3bc8 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java
@@ -749,68 +749,6 @@ public class ModelService
/**
*
- * @param connectionJson
- * @param processDefinition
- * @param sourceActivitySymbol
- * @param dataSymbol
- * @param maxOid
- */
- private void createDataFlowConnection(JsonObject connectionJson,
- ProcessDefinitionType processDefinition, ActivitySymbolType activitySymbol,
- DataSymbolType dataSymbol, long maxOid)
- {
-
- System.out.println("Create data flow connection");
-
- DataType data = dataSymbol.getData();
- ActivityType activity = activitySymbol.getActivity();
-
- DataMappingType dataMapping = AbstractElementBuilder.F_CWM.createDataMappingType();
- DataMappingConnectionType dataMappingConnection = AbstractElementBuilder.F_CWM
- .createDataMappingConnectionType();
-
- // TODO Add index
-
- dataMapping.setId(data.getId());
- dataMapping.setName(data.getName());
-
- dataMapping.setDirection(DirectionType.get(DirectionType.OUT));
- dataMapping.setData(data);
-
- // TODO Incomplete
-
- // if (activity.getImplementation().getLiteral().equals("Application"))
- // {
- // dataMapping.setContext(PredefinedConstants.APPLICATION_CONTEXT);
- // dataMapping.setApplicationAccessPoint(element.getProps().getEnds()
- // .getAccesspoint());
- // }
- // else
- // {
- dataMapping.setContext(PredefinedConstants.DEFAULT_CONTEXT);
- // }
-
- activity.getDataMapping().add(dataMapping);
-
- // TODO Obtain pool from call
-
- processDefinition.getDiagram().get(0).getPoolSymbols().get(0)
- .getDataMappingConnection().add(dataMappingConnection);
-
- dataMappingConnection.setElementOid(++maxOid);
- dataMappingConnection.setActivitySymbol(activitySymbol);
- dataMappingConnection.setDataSymbol(dataSymbol);
- activitySymbol.getDataMappings().add(dataMappingConnection);
- dataSymbol.getDataMappings().add(dataMappingConnection);
- dataMappingConnection.setSourceAnchor(mapAnchorOrientation(extractInt(
- connectionJson, FROM_ANCHOR_POINT_ORIENTATION_PROPERTY)));
- dataMappingConnection.setTargetAnchor(mapAnchorOrientation(extractInt(
- connectionJson, TO_ANCHOR_POINT_ORIENTATION_PROPERTY)));
-
- }
-
- /**
- *
* TODO From DynamicConnectionCommand. Refactor?
*
* @param activity
@@ -864,6 +802,8 @@ public class ModelService
public String updateConnection(String modelId, String processId, long connectionOid,
JsonObject connectionJson)
{
+ // TODO - Not used, ModelElementUnmarshaller contains relevant code to update
+ // connections , can be removed from here
JsonObject modelElementJson = connectionJson
.getAsJsonObject(ModelerConstants.MODEL_ELEMENT_PROPERTY);
ModelType model = getModelManagementStrategy().getModels().get(modelId);