summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-08-14 05:03:50 (EDT)
committerManik Kishore2012-08-14 05:03:50 (EDT)
commita687cb4c6a87f70651fa026a22529af6e0c3a6f0 (patch)
treea2c5be147275402f173df7a6e54d6c8706bfe62a
parentc7409cd61da217720efd0d358237b09fdc75dfdc (diff)
downloadorg.eclipse.stardust.ui.web-a687cb4c6a87f70651fa026a22529af6e0c3a6f0.zip
org.eclipse.stardust.ui.web-a687cb4c6a87f70651fa026a22529af6e0c3a6f0.tar.gz
org.eclipse.stardust.ui.web-a687cb4c6a87f70651fa026a22529af6e0c3a6f0.tar.bz2
CRNT-25760 Refactor/Clean up MB Facade
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58394 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java2
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java11
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/SwimlaneCommandHandler.java6
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/DataChangeCommandHandler.java2
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java23
5 files changed, 19 insertions, 25 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java
index 7e47960..4b27a48 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ActivityCommandHandler.java
@@ -79,7 +79,7 @@ public class ActivityCommandHandler
long maxOid = XpdlModelUtils.getMaxUsedOid(model);
String modelId = model.getId();
- ActivityType activity = new MBFacade(modelService.getModelManagementStrategy()).createActivity(modelId, processDefinition, activityType, participantFullID,
+ ActivityType activity = MBFacade.getInstance().createActivity(modelId, processDefinition, activityType, participantFullID,
activityId, activityName, applicationFullID, subProcessID, maxOid++);
ModelService.setDescription(activity, request.getAsJsonObject(ModelerConstants.MODEL_ELEMENT_PROPERTY));
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java
index 2b18347..0f84e9b 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/DataCommandHandler.java
@@ -17,10 +17,6 @@ import static org.eclipse.stardust.ui.web.modeler.marshaling.GsonUtils.extractSt
import javax.annotation.Resource;
-import org.springframework.context.ApplicationContext;
-
-import com.google.gson.JsonObject;
-
import org.eclipse.stardust.common.error.ObjectNotFoundException;
import org.eclipse.stardust.model.xpdl.builder.common.EObjectUUIDMapper;
import org.eclipse.stardust.model.xpdl.builder.utils.MBFacade;
@@ -35,6 +31,9 @@ import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils;
import org.eclipse.stardust.ui.web.modeler.edit.spi.CommandHandler;
import org.eclipse.stardust.ui.web.modeler.edit.spi.OnCommand;
import org.eclipse.stardust.ui.web.modeler.service.ModelService;
+import org.springframework.context.ApplicationContext;
+
+import com.google.gson.JsonObject;
/**
*
@@ -77,7 +76,7 @@ public class DataCommandHandler
try
{
- data = new MBFacade(modelService().getModelManagementStrategy()).getDataFromExistingModel(model.getId(), model, dataFullID);
+ data = MBFacade.getInstance().importData(model, dataFullID);
}
catch (ObjectNotFoundException x)
{
@@ -108,7 +107,7 @@ public class DataCommandHandler
ProcessDefinitionType processDefinition = ModelUtils.findContainingProcess(parentLaneSymbol);
Long dataOID = extractLong(request, ModelerConstants.OID_PROPERTY);
String dataFullID = extractString(request, ModelerConstants.DATA_FULL_ID_PROPERTY);
- DataType data = new MBFacade(modelService().getModelManagementStrategy()).getDataFromExistingModel(model.getId(), model, dataFullID);
+ DataType data = MBFacade.getInstance().importData(model, dataFullID);
DataSymbolType dataSymbol = MBFacade.getInstance().findDataSymbolRecursively(parentLaneSymbol,
dataOID);
synchronized (model)
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/SwimlaneCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/SwimlaneCommandHandler.java
index bb3f35b..999b35f 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/SwimlaneCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/SwimlaneCommandHandler.java
@@ -20,8 +20,6 @@ import static org.eclipse.stardust.ui.web.modeler.service.ModelService.Y_PROPERT
import javax.annotation.Resource;
-import com.google.gson.JsonObject;
-
import org.eclipse.stardust.model.xpdl.builder.utils.MBFacade;
import org.eclipse.stardust.model.xpdl.builder.utils.ModelerConstants;
import org.eclipse.stardust.model.xpdl.carnot.LaneSymbol;
@@ -33,6 +31,8 @@ import org.eclipse.stardust.ui.web.modeler.edit.spi.CommandHandler;
import org.eclipse.stardust.ui.web.modeler.edit.spi.OnCommand;
import org.eclipse.stardust.ui.web.modeler.service.ModelService;
+import com.google.gson.JsonObject;
+
/**
* @author Shrikant.Gangal
*/
@@ -64,7 +64,7 @@ public class SwimlaneCommandHandler
synchronized (model)
{
- LaneSymbol laneSymbol = new MBFacade(modelService.getModelManagementStrategy()).createLane(model.getId(), model,
+ LaneSymbol laneSymbol = MBFacade.getInstance().createLane(model.getId(), model,
processDefinition, laneId, laneName, xPos, yPos, width, height,
orientation, participantFullID);
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/DataChangeCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/DataChangeCommandHandler.java
index f47b32d..a514470 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/DataChangeCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/DataChangeCommandHandler.java
@@ -84,7 +84,7 @@ public class DataChangeCommandHandler
}
String structuredDataFullId = MBFacade.getInstance().stripFullId(extractString(request,
ModelerConstants.STRUCTURED_DATA_TYPE_FULL_ID));
- DataType data = new MBFacade(modelService().getModelManagementStrategy()).createStructuredData(model, stripFullId_, id, name,
+ DataType data = MBFacade.getInstance().createStructuredData(model, stripFullId_, id, name,
structuredDataFullId);
long maxOid = XpdlModelUtils.getMaxUsedOid(model);
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 136e82b..3305b6b 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
@@ -19,13 +19,8 @@ import static org.eclipse.stardust.ui.web.modeler.marshaling.GsonUtils.extractSt
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
-import java.util.Set;
import org.eclipse.emf.ecore.EObject;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
import org.eclipse.stardust.model.xpdl.builder.activity.BpmApplicationActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.activity.BpmSubProcessActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.strategy.ModelManagementStrategy;
@@ -35,9 +30,7 @@ import org.eclipse.stardust.model.xpdl.carnot.ActivityImplementationType;
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.DataPathType;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
-import org.eclipse.stardust.model.xpdl.carnot.DirectionType;
import org.eclipse.stardust.model.xpdl.carnot.EndEventSymbol;
import org.eclipse.stardust.model.xpdl.carnot.IIdentifiableModelElement;
import org.eclipse.stardust.model.xpdl.carnot.IModelElement;
@@ -51,6 +44,8 @@ import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil;
import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils;
import org.eclipse.stardust.model.xpdl.xpdl2.TypeDeclarationType;
+import com.google.gson.JsonObject;
+
/**
*
* @author Marc.Gille
@@ -242,14 +237,14 @@ public abstract class ModelElementUnmarshaller
String subprocessFullId = extractString(activityJson,
ModelerConstants.SUBPROCESS_ID);
- ProcessDefinitionType subProcessDefinition = new MBFacade(
- modelManagementStrategy()).getProcessDefinition(
- MBFacade.getInstance().getModelId(subprocessFullId),
- MBFacade.getInstance().stripFullId(subprocessFullId));
+ ProcessDefinitionType subProcessDefinition = MBFacade.getInstance()
+ .getProcessDefinition(MBFacade.getInstance().getModelId(subprocessFullId),
+ MBFacade.getInstance().stripFullId(subprocessFullId));
ModelType subProcessModel = ModelUtils.findContainingModel(subProcessDefinition);
- BpmSubProcessActivityBuilder subProcessActivity = newSubProcessActivity(ModelUtils.findContainingProcess(activity));
+ BpmSubProcessActivityBuilder subProcessActivity = newSubProcessActivity(ModelUtils
+ .findContainingProcess(activity));
- subProcessActivity.setActivity(activity);
+ subProcessActivity.setActivity(activity);
subProcessActivity.setSubProcessModel(subProcessModel);
subProcessActivity.invokingProcess(subProcessDefinition);
}
@@ -261,7 +256,7 @@ public abstract class ModelElementUnmarshaller
String applicationFullId = extractString(activityJson,
ModelerConstants.APPLICATION_FULL_ID_PROPERTY);
- ApplicationType application = new MBFacade(modelManagementStrategy()).getApplication(
+ ApplicationType application = MBFacade.getInstance().getApplication(
MBFacade.getInstance().getModelId(applicationFullId),
MBFacade.getInstance().stripFullId(applicationFullId));