summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-10-23 08:11:28 (EDT)
committerStephan Born2012-10-23 08:11:28 (EDT)
commit8d64cbada093a7915c6bf1e94617291bff9dd3e5 (patch)
tree6dbd7294d8602bb96eb20d791e0dd8738236c1b7
parente22f94b6d2dd370cf609890b3f690dd4a2964753 (diff)
downloadorg.eclipse.stardust.ide-8d64cbada093a7915c6bf1e94617291bff9dd3e5.zip
org.eclipse.stardust.ide-8d64cbada093a7915c6bf1e94617291bff9dd3e5.tar.gz
org.eclipse.stardust.ide-8d64cbada093a7915c6bf1e94617291bff9dd3e5.tar.bz2
CRNT-26529 Pepper: Implement - XPDL reference in case external data gets selected
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@60250 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.java52
1 files changed, 52 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 bdabfcf..2e043c1 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
@@ -2475,5 +2475,57 @@ public class ModelBuilderFacade
return false;
}
+ public void updateTeamLead(OrganizationType organization, String participantFullID)
+ {
+ ModelType model = ModelUtils.findContainingModel(organization);
+ if (participantFullID != null)
+ {
+
+ String participantModelID = getModelId(participantFullID);
+ if (StringUtils.isEmpty(participantModelID))
+ {
+ participantModelID = model.getId();
+ }
+ ModelType participantModel = model;
+ if (!participantModelID.equals(model.getId()))
+ {
+ participantModel = getModelManagementStrategy().getModels().get(
+ participantModelID);
+ }
+
+ IModelParticipant modelParticipant = findParticipant(
+ getModelManagementStrategy().getModels().get(participantModelID),
+ stripFullId(participantFullID));
+
+ if (!participantModelID.equals(model.getId()))
+ {
+ String fileConnectionId = WebModelerConnectionManager.createFileConnection(model,
+ participantModel);
+
+ String bundleId = CarnotConstants.DIAGRAM_PLUGIN_ID;
+ URI uri = URI.createURI("cnx://" + fileConnectionId + "/");
+
+ ModelType loadModel = getModelManagementStrategy().loadModel(participantModelID + ".xpdl");
+ IModelParticipant participantCopy = findParticipant(loadModel, stripFullId(participantFullID));
+ if(participantCopy == null)
+ {
+ ElementCopier copier = new ElementCopier(loadModel, null);
+ participantCopy = (IModelParticipant) copier.copy(modelParticipant);
+ }
+
+ ReplaceModelElementDescriptor descriptor = new ReplaceModelElementDescriptor(
+ uri, participantCopy, bundleId, null, true);
+ PepperIconFactory iconFactory = new PepperIconFactory();
+ descriptor.importElements(iconFactory, model, true);
+ modelParticipant = findParticipant(model, stripFullId(participantFullID));
+ }
+ organization.setTeamLead((RoleType) modelParticipant);
+ }
+
+ }
+
+
+
+
}