summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-09-14 05:03:01 (EDT)
committer Stephan Born2012-09-14 05:03:01 (EDT)
commit54ed9aad96ccbd9586ac580ce36056a5c89df656 (patch)
treeb0dce12f860fbf19628438dd82b813cada26985f
parent27a5b1a95659355d9393fa17526d21c370d69cc3 (diff)
downloadorg.eclipse.stardust.ide-54ed9aad96ccbd9586ac580ce36056a5c89df656.zip
org.eclipse.stardust.ide-54ed9aad96ccbd9586ac580ce36056a5c89df656.tar.gz
org.eclipse.stardust.ide-54ed9aad96ccbd9586ac580ce36056a5c89df656.tar.bz2
CamelApplication and WebserviceApplication can now be created with ModelBuilderFacade.createApplication(...)
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@59205 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/BpmModelBuilder.java12
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java8
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java2
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/variable/CamelApplicationBuilder.java69
4 files changed, 89 insertions, 2 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/BpmModelBuilder.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/BpmModelBuilder.java
index 7c6b125..42b90ab 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/BpmModelBuilder.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/BpmModelBuilder.java
@@ -39,10 +39,12 @@ import org.eclipse.stardust.model.xpdl.builder.utils.XpdlModelUtils;
import org.eclipse.stardust.model.xpdl.builder.variable.BpmDocumentVariableBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.BpmPrimitiveVariableBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.BpmStructVariableBuilder;
+import org.eclipse.stardust.model.xpdl.builder.variable.CamelApplicationBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.ExternalWebApplicationApplicationBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.MessageTransformationApplicationBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.PrimitiveAccessPointBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.StructAccessPointBuilder;
+import org.eclipse.stardust.model.xpdl.builder.variable.WebserviceApplicationBuilder;
import org.eclipse.stardust.model.xpdl.carnot.ActivityType;
import org.eclipse.stardust.model.xpdl.carnot.EventHandlerType;
import org.eclipse.stardust.model.xpdl.carnot.IAccessPointOwner;
@@ -90,6 +92,16 @@ public abstract class BpmModelBuilder
return StructAccessPointBuilder.newAccessPoint(anOwner);
}
+ public static CamelApplicationBuilder newCamelApplication(ModelType model)
+ {
+ return CamelApplicationBuilder.newCamelApplication(model);
+ }
+
+ public static WebserviceApplicationBuilder newWebserviceApplication(ModelType model)
+ {
+ return WebserviceApplicationBuilder.newWebserviceApplication(model);
+ }
+
public static MessageTransformationApplicationBuilder newMessageTransformationApplication(ModelType model)
{
return MessageTransformationApplicationBuilder.newMessageTransformationApplication(model);
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 e7235dc..f3d1577 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
@@ -28,6 +28,7 @@ import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newStructV
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newStructuredAccessPoint;
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newSubProcessActivity;
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newWebserviceApplication;
+import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newCamelApplication;
import java.util.ArrayList;
import java.util.Calendar;
@@ -988,7 +989,12 @@ public class ModelBuilderFacade
return newWebserviceApplication(model).withIdAndName(applicationID,
applicationName).build();
}
-
+ if (applicationTypeID
+ .equalsIgnoreCase(ModelerConstants.CAMEL_APPLICATION_TYPE_ID))
+ {
+ return newCamelApplication(model).withIdAndName(applicationID,
+ applicationName).build();
+ }
return null;
}
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java
index 110484c..4e593f7 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java
@@ -128,7 +128,7 @@ public class ModelerConstants
public static final String TO_MODEL_ELEMENT_TYPE = "toModelElementType";
public static final String WEB_SERVICE_APPLICATION_TYPE_ID = "webservice";
public static final String MESSAGE_TRANSFORMATION_APPLICATION_TYPE_ID = "messageTransformationBean";
- public static final String CAMEL_APPLICATION_TYPE_ID = "camelBean";
+ public static final String CAMEL_APPLICATION_TYPE_ID = "camelSpringProducerApplication";
public static final String MAIL_APPLICATION_TYPE_ID = "mailBean";
public static final String INTERACTIVE_APPLICATION_TYPE_KEY = "interactive";
public static final String CONTEXTS_PROPERTY = "contexts";
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/variable/CamelApplicationBuilder.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/variable/CamelApplicationBuilder.java
new file mode 100644
index 0000000..5cc17e7
--- /dev/null
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/variable/CamelApplicationBuilder.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SunGard CSA LLC and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SunGard CSA LLC - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.stardust.model.xpdl.builder.variable;
+
+import org.eclipse.stardust.model.xpdl.builder.common.AbstractElementBuilder;
+import org.eclipse.stardust.model.xpdl.builder.common.AbstractModelElementBuilder;
+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.ApplicationType;
+import org.eclipse.stardust.model.xpdl.carnot.ApplicationTypeType;
+import org.eclipse.stardust.model.xpdl.carnot.ModelType;
+import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil;
+
+public class CamelApplicationBuilder extends AbstractModelElementBuilder<ApplicationType, CamelApplicationBuilder>
+{
+
+ public CamelApplicationBuilder(ModelType model)
+ {
+ super(F_CWM.createApplicationType());
+
+ forModel(model);
+
+ ApplicationTypeType applicationMetaType = XpdlModelUtils.findIdentifiableElement(
+ model.getApplicationType(), ModelerConstants.CAMEL_APPLICATION_TYPE_ID);
+ if (null == applicationMetaType)
+ {
+ applicationMetaType = AbstractElementBuilder.F_CWM.createApplicationTypeType();
+ applicationMetaType.setId(ModelerConstants.CAMEL_APPLICATION_TYPE_ID);
+ applicationMetaType.setName("Camel Producer Application");
+ applicationMetaType.setIsPredefined(true);
+ applicationMetaType.setSynchronous(true);
+ AttributeUtil.setAttribute(applicationMetaType, "carnot:engine:validator", "org.eclipse.stardust.engine.extensions.camel.app.CamelProducerSpringBeanValidator");
+ AttributeUtil.setAttribute(applicationMetaType, "carnot:engine:accessPointProvider", "org.eclipse.stardust.engine.extensions.camel.app.CamelProducerSpringBeanAccessPointProvider");
+ AttributeUtil.setAttribute(applicationMetaType, "carnot:engine:applicationInstance", "org.eclipse.stardust.engine.extensions.camel.app.CamelProducerSpringBeanApplicationInstance");
+ long maxElementOid = XpdlModelUtils.getMaxUsedOid(model);
+ applicationMetaType.setElementOid(++maxElementOid);
+ model.getApplicationType().add(applicationMetaType);
+ }
+ element.setType(applicationMetaType);
+ }
+
+ @Override
+ protected String getDefaultElementIdPrefix()
+ {
+ return "Application";
+ }
+
+ public static CamelApplicationBuilder newCamelApplication(ModelType model)
+ {
+ return new CamelApplicationBuilder(model);
+ }
+
+ @Override
+ protected ApplicationType finalizeElement()
+ {
+ super.finalizeElement();
+ model.getApplication().add(element);
+ return element;
+ }
+
+}