summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-05-25 03:37:24 (EDT)
committer Manik Kishore2012-05-28 23:59:03 (EDT)
commite92d490e1eb4715593e6bf4c7d71853303519f31 (patch)
treebe9e3136cc44b8e265670119b1cbadeede71492e
parent6c495443f787f4b6521140933c2a4c4ce04286d8 (diff)
downloadorg.eclipse.stardust.ide-e92d490e1eb4715593e6bf4c7d71853303519f31.zip
org.eclipse.stardust.ide-e92d490e1eb4715593e6bf4c7d71853303519f31.tar.gz
org.eclipse.stardust.ide-e92d490e1eb4715593e6bf4c7d71853303519f31.tar.bz2
Jira-ID: CRNT-23732
Condition performer- No error is shown in properties page if data path is not resolved git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@56579 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DataMappingValidator.java45
1 files changed, 43 insertions, 2 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DataMappingValidator.java b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DataMappingValidator.java
index 8d464b5..b5c8ea6 100644
--- a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DataMappingValidator.java
+++ b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DataMappingValidator.java
@@ -21,6 +21,7 @@ import org.eclipse.stardust.common.CompareHelper;
import org.eclipse.stardust.common.StringUtils;
import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.engine.core.struct.IXPathMap;
+import org.eclipse.stardust.engine.core.struct.TypedXPath;
import org.eclipse.stardust.engine.core.struct.spi.StructDataTransformerKey;
import org.eclipse.stardust.model.xpdl.carnot.AccessPointType;
import org.eclipse.stardust.model.xpdl.carnot.ActivityImplementationType;
@@ -157,9 +158,49 @@ public class DataMappingValidator implements IModelElementValidator
}
IXPathMap xPathMap = StructuredTypeUtils.getXPathMap(dataMapping.getData());
- if(!xPathMap.containsXPath(dataPath))
+ if (dataPath.indexOf("[") > -1)
{
- throw new ValidationException(Validation_Messages.MSG_DATAMAPPING_NoValidDataPath, dataPath);
+ checkNestedPath(dataPath, xPathMap);
+ }
+ else
+ {
+ if (!xPathMap.containsXPath(dataPath))
+ {
+ throw new ValidationException(
+ Validation_Messages.MSG_DATAMAPPING_NoValidDataPath, dataPath);
+ }
+ }
+ }
+ }
+ }
+
+ private void checkNestedPath(String dataPath, IXPathMap xPathMap)
+ {
+ String[] pathSegs = dataPath.split("/");
+ String path = "";
+ for (int i = 0; i < pathSegs.length; i++)
+ {
+ path = path + pathSegs[i];
+ path = path.replaceAll("\\[[^\\]]*\\]|\\..*/", "");
+ if (!xPathMap.containsXPath(path))
+ {
+ throw new ValidationException(
+ Validation_Messages.MSG_DATAMAPPING_NoValidDataPath, dataPath);
+ }
+ else
+ {
+ if (pathSegs[i].indexOf("[") > -1)
+ {
+ TypedXPath xPath = xPathMap.getXPath(path);
+ if (!xPath.isList())
+ {
+ throw new ValidationException(
+ Validation_Messages.MSG_DATAMAPPING_NoValidDataPath, dataPath);
+ }
+ }
+ if (i < pathSegs.length)
+ {
+ path = path + "/";
}
}
}