summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-09-10 07:04:58 (EDT)
committerStephan Born2012-09-10 08:47:00 (EDT)
commit74975e1b83217ddeb9198caa175ce72883d37ded (patch)
treee867c7d00258b0b380064eef0a8b9f057089b03e
parentaaa27679542753f96f1abca41040772a38c13c04 (diff)
downloadorg.eclipse.stardust.ide-74975e1b83217ddeb9198caa175ce72883d37ded.zip
org.eclipse.stardust.ide-74975e1b83217ddeb9198caa175ce72883d37ded.tar.gz
org.eclipse.stardust.ide-74975e1b83217ddeb9198caa175ce72883d37ded.tar.bz2
CRNT-26096 Pepper: Provide methods in ModelBuilderFacade to transform a data into another
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@59042 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/AbstractDmsItemInitializer.java13
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/DataStructInitializer.java14
2 files changed, 24 insertions, 3 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/AbstractDmsItemInitializer.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/AbstractDmsItemInitializer.java
index a4968c8..9e0d1bc 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/AbstractDmsItemInitializer.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/AbstractDmsItemInitializer.java
@@ -13,10 +13,12 @@ package org.eclipse.stardust.model.xpdl.builder.initializer;
import java.util.Arrays;
import java.util.List;
+import org.eclipse.stardust.engine.core.struct.StructuredDataConstants;
import org.eclipse.stardust.model.xpdl.carnot.AttributeType;
import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelFactory;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
import org.eclipse.stardust.model.xpdl.carnot.spi.IDataInitializer;
+import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil;
import org.eclipse.stardust.model.xpdl.carnot.util.CarnotConstants;
@@ -27,7 +29,7 @@ import org.eclipse.stardust.model.xpdl.carnot.util.CarnotConstants;
public abstract class AbstractDmsItemInitializer implements IDataInitializer
{
protected abstract Class<?> getInterfaceType();
-
+
public List<AttributeType> initialize(DataType data, List<AttributeType> attributes)
{
AttributeType attrClassName = CarnotWorkflowModelFactory.eINSTANCE.createAttributeType();
@@ -39,6 +41,15 @@ public abstract class AbstractDmsItemInitializer implements IDataInitializer
attrBidirectional.setValue(Boolean.TRUE.toString());
attrBidirectional.setType(Boolean.TYPE.getName());
+ //If attributes originally from StructuredType
+ String typeDecl = AttributeUtil.getAttributeValue(attributes, StructuredDataConstants.TYPE_DECLARATION_ATT);
+ if (typeDecl != null) {
+ AttributeType attrTypeName = CarnotWorkflowModelFactory.eINSTANCE.createAttributeType();
+ attrTypeName.setName("carnot:engine:dms:resourceMetadataSchema");
+ attrTypeName.setValue(typeDecl);
+ data.getAttribute().add(attrTypeName);
+ }
+
return Arrays.asList(new AttributeType[] {attrClassName, attrBidirectional});
}
}
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/DataStructInitializer.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/DataStructInitializer.java
index 142e8ca..01f206e 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/DataStructInitializer.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/initializer/DataStructInitializer.java
@@ -13,16 +13,26 @@ package org.eclipse.stardust.model.xpdl.builder.initializer;
import java.util.List;
import org.eclipse.stardust.engine.core.struct.StructuredDataConstants;
+import org.eclipse.stardust.model.xpdl.carnot.AttributeType;
+import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelFactory;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
import org.eclipse.stardust.model.xpdl.carnot.spi.IDataInitializer;
import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil;
public class DataStructInitializer implements IDataInitializer
{
- public List initialize(DataType data, List attributes)
+ public List initialize(DataType data, List<AttributeType> attributes)
{
AttributeUtil.setAttribute(data, "carnot:engine:path:separator", StructuredDataConstants.ACCESS_PATH_SEGMENT_SEPARATOR); //$NON-NLS-1$
- AttributeUtil.setBooleanAttribute(data, "carnot:engine:data:bidirectional", true); //$NON-NLS-1$
+ AttributeUtil.setBooleanAttribute(data, "carnot:engine:data:bidirectional", true); //$NON-NLS-1$
+ //If attributes originally from DocumentData
+ String typeDecl = AttributeUtil.getAttributeValue(attributes, "carnot:engine:dms:resourceMetadataSchema");
+ if (typeDecl != null) {
+ AttributeType attrTypeName = CarnotWorkflowModelFactory.eINSTANCE.createAttributeType();
+ attrTypeName.setName(StructuredDataConstants.TYPE_DECLARATION_ATT);
+ attrTypeName.setValue(typeDecl);
+ data.getAttribute().add(attrTypeName);
+ }
return null;
}
} \ No newline at end of file