summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntje Fuhrmann2013-03-06 09:01:50 (EST)
committerSven Rottstock2013-03-11 04:55:40 (EDT)
commit001a00bb042f3b571d363d1fcf7b57d7f16fc595 (patch)
tree9d40f173ff0d8ee0619cd556adc1943247054004
parent1c545efda6dc65c605d84446d6275331adf12374 (diff)
downloadorg.eclipse.stardust.engine-001a00bb042f3b571d363d1fcf7b57d7f16fc595.zip
org.eclipse.stardust.engine-001a00bb042f3b571d363d1fcf7b57d7f16fc595.tar.gz
org.eclipse.stardust.engine-001a00bb042f3b571d363d1fcf7b57d7f16fc595.tar.bz2
Jira-ID: CRNT-28240
Activity cannot be completed after sub-process implementation is changed. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/engine@63540 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/LargeStringHolderBigDataHandler.java27
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java33
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/setup/DataClusterHelper.java8
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/upgrade/jobs/R7_1_0from7_0_xRuntimeJob.java38
4 files changed, 46 insertions, 60 deletions
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/LargeStringHolderBigDataHandler.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/LargeStringHolderBigDataHandler.java
index 4551bdd..d49675c 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/LargeStringHolderBigDataHandler.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/LargeStringHolderBigDataHandler.java
@@ -633,25 +633,34 @@ public class LargeStringHolderBigDataHandler implements BigDataHandler
if (data instanceof IStructuredDataValue)
{
boolean tryParseDouble = true;
-
+
StructuredDataValueBean sdv = (StructuredDataValueBean) data;
ModelManager modelManager = ModelManagerFactory.getCurrent();
long modelOid = sdv.getProcessInstance().getProcessDefinition().getModel()
.getModelOID();
- IData theData = modelManager.findDataForStructuredData(modelOid, sdv.getXPathOID());
-
- IXPathMap xPathMap = DataXPathMap.getXPathMap(theData);
- TypedXPath typedXPath = xPathMap.getXPath(sdv.getXPathOID());
- String xsdTypeName = typedXPath.getXsdTypeName();
- tryParseDouble = "decimal".equals(xsdTypeName);
+ IData theData = modelManager.findDataForStructuredData(modelOid,
+ sdv.getXPathOID());
+
+ if (theData != null)
+ {
+ IXPathMap xPathMap = DataXPathMap.getXPathMap(theData);
+ TypedXPath typedXPath = xPathMap.getXPath(sdv.getXPathOID());
+ String xsdTypeName = typedXPath.getXsdTypeName();
+ tryParseDouble = "decimal".equals(xsdTypeName);
+ }
+ else
+ {
+ tryParseDouble = true;
+ }
if (tryParseDouble)
{
try
{
- // As xsd:decimal is stored as string it is tried to convert to double
+ // As xsd:decimal is stored as string it is tried to convert to
+ // double
double parsedDouble = Double.parseDouble((String) value);
- if ( !Double.isNaN(parsedDouble))
+ if (!Double.isNaN(parsedDouble))
{
data.setDoubleValue(parsedDouble);
}
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java
index 9ee08fa..0ac1d4b 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java
@@ -50,9 +50,6 @@ import org.eclipse.stardust.engine.core.spi.extensions.model.AccessPoint;
import org.eclipse.stardust.engine.core.spi.extensions.model.BridgeObject;
import org.eclipse.stardust.engine.core.spi.extensions.model.ExtendedDataValidator;
import org.eclipse.stardust.engine.core.spi.extensions.runtime.*;
-import org.eclipse.stardust.engine.core.struct.DataXPathMap;
-import org.eclipse.stardust.engine.core.struct.IXPathMap;
-import org.eclipse.stardust.engine.core.struct.TypedXPath;
import org.eclipse.stardust.engine.core.struct.beans.IStructuredDataValue;
import org.eclipse.stardust.engine.runtime.utils.TimestampProviderUtils;
@@ -182,7 +179,6 @@ public class ProcessInstanceBean extends AttributedIdentifiablePersistentBean
private transient Map<String,IDataValue> dataValueCache;
private transient Map<Long, IStructuredDataValue> structuredDataValueCache;
- private transient Map<Pair<String, String>, IStructuredDataValue> structuredDataValueCacheById;
private transient PropertyIndexHandler propIndexHandler = new PropertyIndexHandler();
@@ -885,22 +881,6 @@ public class ProcessInstanceBean extends AttributedIdentifiablePersistentBean
return structuredDataValueCache.get(xPathOid);
}
- public IStructuredDataValue getCachedStructuredDataValue(String dataId,
- String attribute)
- {
- if (getOID() != getScopeProcessInstanceOID())
- {
- return ((ProcessInstanceBean) getScopeProcessInstance())
- .getCachedStructuredDataValue(dataId, attribute);
- }
- if (structuredDataValueCacheById == null)
- {
- return null;
- }
-
- return structuredDataValueCacheById.get(new Pair(dataId, attribute));
- }
-
public Map getExistingDataValues(boolean includePredefined)
{
HashMap result = new HashMap();
@@ -1300,22 +1280,9 @@ public class ProcessInstanceBean extends AttributedIdentifiablePersistentBean
{
this.structuredDataValueCache = CollectionUtils.newHashMap();
}
- if(structuredDataValueCacheById == null)
- {
- this.structuredDataValueCacheById = CollectionUtils.newHashMap();
- }
structuredDataValueCache.put(value.getXPathOID(), value);
- ModelManager modelManager = ModelManagerFactory.getCurrent();
- long modelOid = value.getProcessInstance().getProcessDefinition().getModel()
- .getModelOID();
- IData theData = modelManager.findDataForStructuredData(modelOid, value.getXPathOID());
-
- IXPathMap xPathMap = DataXPathMap.getXPathMap(theData);
- TypedXPath typedXPath = xPathMap.getXPath(value.getXPathOID());
-
- structuredDataValueCacheById.put(new Pair(theData.getId(), typedXPath.getXPath()), value);
}
public AbstractProperty createProperty(String name, Serializable value)
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/setup/DataClusterHelper.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/setup/DataClusterHelper.java
index 07756a1..ca8106f 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/setup/DataClusterHelper.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/setup/DataClusterHelper.java
@@ -19,7 +19,6 @@ import java.util.Set;
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.Pair;
import org.eclipse.stardust.common.StringUtils;
-import org.eclipse.stardust.common.Unknown;
import org.eclipse.stardust.common.error.InternalException;
import org.eclipse.stardust.common.log.LogManager;
import org.eclipse.stardust.common.log.Logger;
@@ -119,9 +118,10 @@ public class DataClusterHelper
{
ProcessInstanceBean pi = (ProcessInstanceBean) rawPi;
- // if
- IStructuredDataValue cachedSdv = pi.getCachedStructuredDataValue(
- dataValue.getData().getId(), dataSlot.getAttributeName());
+ Long xPathOID = DataXPathMap.getXPathMap(dataValue.getData())
+ .getXPathOID(dataSlot.getAttributeName());
+ IStructuredDataValue cachedSdv = pi
+ .getCachedStructuredDataValue(xPathOID);
// if cached value is available then it has been changed potentially
if (cachedSdv instanceof BigData)
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/upgrade/jobs/R7_1_0from7_0_xRuntimeJob.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/upgrade/jobs/R7_1_0from7_0_xRuntimeJob.java
index 8ad0888..1948df9 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/upgrade/jobs/R7_1_0from7_0_xRuntimeJob.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/upgrade/jobs/R7_1_0from7_0_xRuntimeJob.java
@@ -219,43 +219,53 @@ public class R7_1_0from7_0_xRuntimeJob extends DbmsAwareRuntimeUpgradeJob
private Double getDecimalValue(IData theData, long xpathOid, String value)
{
- try
+ try
{
- IXPathMap xPathMap = DataXPathMap.getXPathMap(theData);
- TypedXPath typedXPath = xPathMap.getXPath(xpathOid);
- String xsdTypeName = typedXPath.getXsdTypeName();
- boolean tryParseDouble = "decimal".equals(xsdTypeName);
-
- if(tryParseDouble)
+ boolean tryParseDouble = false;
+ if (theData != null)
+ {
+ IXPathMap xPathMap = DataXPathMap.getXPathMap(theData);
+ TypedXPath typedXPath = xPathMap.getXPath(xpathOid);
+ String xsdTypeName = typedXPath.getXsdTypeName();
+ tryParseDouble = "decimal".equals(xsdTypeName);
+ }
+ else
+ {
+ tryParseDouble = true;
+ }
+
+ if (tryParseDouble)
{
try
{
return Double.parseDouble(value);
}
catch (NumberFormatException x)
- {}
+ {
+ }
}
}
- catch(Exception e)
+ catch (Exception e)
{
- boolean ignoreXsdErrors = Parameters.instance().getBoolean(IGNORE_MISSING_XPATH, false);
-
+ boolean ignoreXsdErrors = Parameters.instance().getBoolean(IGNORE_MISSING_XPATH,
+ false);
+
StringBuffer errorMsg = new StringBuffer();
errorMsg.append("Could not analyse structured data: ");
errorMsg.append(theData.getId());
errorMsg.append(" for xpath oid ");
errorMsg.append(xpathOid);
- if(ignoreXsdErrors)
+ if (ignoreXsdErrors)
{
errorMsg.append(" - ignoring record.");
trace.warn(errorMsg.toString());
}
else
- {
+ {
throw new PublicException(errorMsg.toString());
}
}
-
+
return null;
}