summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-11-22 05:11:14 (EST)
committer Sven Rottstock2012-11-22 05:11:14 (EST)
commitf753a2d8603f0ed8297a6e22dd0276ee1f6f32a9 (patch)
tree0f0cee658651b0b367b5d3114a36b75f46cd4ed3
parentfd2300c5e9aaf24c2293140962d6ba5d24fddb68 (diff)
downloadorg.eclipse.stardust.ide-f753a2d8603f0ed8297a6e22dd0276ee1f6f32a9.zip
org.eclipse.stardust.ide-f753a2d8603f0ed8297a6e22dd0276ee1f6f32a9.tar.gz
org.eclipse.stardust.ide-f753a2d8603f0ed8297a6e22dd0276ee1f6f32a9.tar.bz2
CRNT-26237 Pepper: Activity Property: The Application and sub process from other model do not persist.
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@61021 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.java38
1 files changed, 37 insertions, 1 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 d000ac3..6efb199 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
@@ -42,7 +42,6 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.emf.ecore.xmi.XMLResource;
-
import org.eclipse.stardust.common.Direction;
import org.eclipse.stardust.common.StringUtils;
import org.eclipse.stardust.common.error.ObjectNotFoundException;
@@ -2672,6 +2671,43 @@ public class ModelBuilderFacade
return path;
}
+ public ProcessDefinitionType setSubProcess(ActivityType activity, String processFullId)
+ {
+ ProcessDefinitionType process = this.getProcessDefinition(getModelId(processFullId),
+ stripFullId(processFullId));
+
+ ModelType model = ModelUtils.findContainingModel(activity);
+ ModelType processModel = ModelUtils.findContainingModel(process);
+
+ if (model.equals(processModel))
+ {
+ activity.setImplementationProcess(process);
+ }
+ else
+ {
+ String fileConnectionId = WebModelerConnectionManager.createFileConnection(
+ model, processModel);
+
+ String bundleId = CarnotConstants.DIAGRAM_PLUGIN_ID;
+ URI uri = URI.createURI("cnx://" + fileConnectionId + "/");
+
+ ReplaceModelElementDescriptor descriptor = new ReplaceModelElementDescriptor(
+ uri, process, bundleId, null, true);
+
+ AttributeUtil.setAttribute(activity, IConnectionManager.URI_ATTRIBUTE_NAME,
+ descriptor.getURI().toString());
+
+ IdRef idRef = CarnotWorkflowModelFactory.eINSTANCE.createIdRef();
+ idRef.setRef(process.getId());
+ idRef.setPackageRef(ImportUtils.getPackageRef(descriptor, model,
+ processModel));
+ activity.setExternalRef(idRef);
+ activity.setImplementationProcess(process);
+ }
+ return process;
+ }
+
+
public ApplicationType setApplication(ActivityType activity, String applicationFullId)
{
ApplicationType application = getApplication(getModelId(applicationFullId),