summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2013-06-18 22:55:36 +0200
committerAndrew Branson <andrew.branson@cern.ch>2013-06-18 22:55:36 +0200
commit4d4cc2849855b4a80243f606399c70af52b9373c (patch)
treeccd1e14655e5d83f9bbdb2e323685f9e902874a6
parent57d822a6d14cef70258f4c5ad6962cd897a92086 (diff)
Errors were not stored when submitted to activities with no outcome
-rw-r--r--src/main/java/com/c2kernel/lifecycle/instance/Activity.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java
index 38ed626..952a4dd 100644
--- a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java
+++ b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java
@@ -536,9 +536,12 @@ public class Activity extends WfVertex
}
else
return null;
- } /**
- * Stores the request data as an outcome of the Item It does a great deal of storing outcomes in different configuration
- */ //requestdata is xmlstring
+ }
+
+ /**
+ * Stores the request data as an outcome of the Item It does a great deal of storing outcomes in different configuration
+ */ //requestdata is xmlstring
+
private String storeOutcome(int eventID, String requestData, boolean isError) throws InvalidDataException
{
EntityPath entityPath = getItemEntityPath();
@@ -546,7 +549,9 @@ public class Activity extends WfVertex
throw new InvalidDataException("Empty outcome", "");
if (entityPath != null)
{
- String schemaType; int schemaVersion;
+ String schemaType;
+ int schemaVersion;
+
if (isError) {
schemaType="Errors";
schemaVersion=0;
@@ -596,12 +601,13 @@ public class Activity extends WfVertex
{
int eventID = -1;
String schemaType = (String) getProperties().get("SchemaType");
- boolean hasOutcome = (transitionID == Transitions.DONE || transitionID == Transitions.COMPLETE || transitionID == Transitions.SUSPEND) && (schemaType != null && schemaType.length() > 0);
+ boolean hasOutcome = (transitionID == Transitions.DONE || transitionID == Transitions.COMPLETE) && (schemaType != null && schemaType.length() > 0);
+ boolean hasErrorOutcome = transitionID == Transitions.SUSPEND && requestData != null && requestData.length()>0;
Event event = auditEvent(transitionID, agent, hasOutcome);
if (event != null)
eventID = event.getID();
- if (hasOutcome)
- storeOutcome(eventID, requestData, transitionID == Transitions.SUSPEND);
+ if (hasOutcome || hasErrorOutcome)
+ storeOutcome(eventID, requestData, hasErrorOutcome);
EntityPath entityPath = getItemEntityPath();
TransactionManager storage = Gateway.getStorage();
if (entityPath != null)
@@ -609,6 +615,7 @@ public class Activity extends WfVertex
storage.commit(this);
}
}
+
public void pushJobsToAgents()
{
String agentRole = getCurrentAgentRole();