summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-10-25 10:22:57 (EDT)
committerSven Rottstock2012-10-25 10:22:57 (EDT)
commitaf8bf63f9c371dc990c2e58903901af2bf164711 (patch)
treeb7ab24b1eeca78559eed88d9322635a5be55c9bb
parentdeb7071e5d210229213b3095cb3f8c5df17b12eb (diff)
downloadorg.eclipse.stardust.ui.web-af8bf63f9c371dc990c2e58903901af2bf164711.zip
org.eclipse.stardust.ui.web-af8bf63f9c371dc990c2e58903901af2bf164711.tar.gz
org.eclipse.stardust.ui.web-af8bf63f9c371dc990c2e58903901af2bf164711.tar.bz2
CRNT-26128 Pepper: Refactor XpdlModelIoUtils - Get rid of the static maps
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@60327 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/ModelChangeCommandHandler.java9
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/DefaultModelManagementStrategy.java2
2 files changed, 6 insertions, 5 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/ModelChangeCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/ModelChangeCommandHandler.java
index ab70053..522470e 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/ModelChangeCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/model/element/ModelChangeCommandHandler.java
@@ -28,6 +28,7 @@ import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.model.xpdl.builder.common.AbstractElementBuilder;
import org.eclipse.stardust.model.xpdl.builder.common.EObjectUUIDMapper;
import org.eclipse.stardust.model.xpdl.builder.strategy.ModelManagementStrategy;
+import org.eclipse.stardust.model.xpdl.builder.utils.ModelBuilderFacade;
import org.eclipse.stardust.model.xpdl.builder.utils.ModelerConstants;
import org.eclipse.stardust.model.xpdl.builder.utils.XpdlModelUtils;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
@@ -77,9 +78,11 @@ public class ModelChangeCommandHandler
*/
private JsonObject createModel(String commandId, JsonObject request)
{
- ModelType model = newBpmModel().withIdAndName(
- request.get(ModelerConstants.ID_PROPERTY).getAsString(),
- request.get(ModelerConstants.NAME_PROPERTY).getAsString()).build();
+ ModelBuilderFacade facade = new ModelBuilderFacade(modelService().getModelManagementStrategy());
+ String modelID = request.get(ModelerConstants.ID_PROPERTY).getAsString();
+ String modelName = request.get(ModelerConstants.NAME_PROPERTY).getAsString();
+ ModelType model = facade.createModel(modelID, modelName);
+
EObjectUUIDMapper mapper = modelService().uuidMapper();
mapper.map(model);
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/DefaultModelManagementStrategy.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/DefaultModelManagementStrategy.java
index 397379d..05f571e 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/DefaultModelManagementStrategy.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/DefaultModelManagementStrategy.java
@@ -97,8 +97,6 @@ public class DefaultModelManagementStrategy extends
List<Document> candidateModelDocuments = getDocumentManagementService().getFolder(
MODELS_DIR).getDocuments();
- XpdlModelIoUtils.clearModelsMap();
-
for (Document modelDocument : candidateModelDocuments)
{
ModelType xpdlModel = null;