summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-09-27 07:45:46 (EDT)
committer Stephan Born2012-09-27 07:45:46 (EDT)
commitd17bad10c739844d862e6cbf24dfc184db6ff179 (patch)
treed6bffa7c65962b81fe2ada4f271329843f8d8e5d
parentb7e2d789c09bfa88be80bda9a26b683eb0ad0fbc (diff)
downloadorg.eclipse.stardust.ide-d17bad10c739844d862e6cbf24dfc184db6ff179.zip
org.eclipse.stardust.ide-d17bad10c739844d862e6cbf24dfc184db6ff179.tar.gz
org.eclipse.stardust.ide-d17bad10c739844d862e6cbf24dfc184db6ff179.tar.bz2
CRNT-26235 Pepper: Further enhancements of ModelBuilder API
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@59568 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
index a49b74c..ee61a75 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
@@ -2288,5 +2288,41 @@ public class ModelBuilderFacade
return path;
}
+ public ApplicationType setApplication(ActivityType activity,
+ String applicationFullId)
+ {
+ ApplicationType application = getApplication(getModelId(applicationFullId),
+ stripFullId(applicationFullId));
+
+ ModelType model = ModelUtils.findContainingModel(activity);
+ ModelType applicationModel = ModelUtils.findContainingModel(application);
+
+ if (model.equals(applicationModel))
+ {
+ activity.setApplication(application);
+ }
+ else
+ {
+ String fileConnectionId = WebModelerConnectionManager.createFileConnection(
+ model, applicationModel);
+
+ String bundleId = CarnotConstants.DIAGRAM_PLUGIN_ID;
+ URI uri = URI.createURI("cnx://" + fileConnectionId + "/");
+
+ ReplaceModelElementDescriptor descriptor = new ReplaceModelElementDescriptor(
+ uri, application, bundleId, null, true);
+
+ AttributeUtil.setAttribute(activity, IConnectionManager.URI_ATTRIBUTE_NAME,
+ descriptor.getURI().toString());
+
+ IdRef idRef = CarnotWorkflowModelFactory.eINSTANCE.createIdRef();
+ idRef.setRef(application.getId());
+ idRef.setPackageRef(ImportUtils.getPackageRef(descriptor, model,
+ applicationModel));
+ activity.setExternalRef(idRef);
+ }
+ return application;
+ }
+
}