diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-09-20 13:39:01 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-09-20 13:39:49 +0200 |
| commit | c543e99e6b02a25c6dc745081f3915897420b225 (patch) | |
| tree | 3264be6ff581f59af64734851178382722b2551e /src/main/java/com/c2kernel/lifecycle/instance/Workflow.java | |
| parent | e5353d60af8e80444721384cb7cb7b2c3465b225 (diff) | |
Keep a History object in the Workflow to avoid recreating it on repeated
executions.
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/Workflow.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/Workflow.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java b/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java index 321e53e..13a7db6 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/Workflow.java @@ -8,6 +8,7 @@ import com.c2kernel.common.ObjectAlreadyExistsException; import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.entity.agent.Job;
+import com.c2kernel.events.History;
import com.c2kernel.graph.model.GraphPoint;
import com.c2kernel.graph.model.TypeNameAndConstructionInfo;
import com.c2kernel.lifecycle.instance.predefined.PredefinedStepContainer;
@@ -23,6 +24,7 @@ import com.c2kernel.utils.Logger; */
public class Workflow extends CompositeActivity implements C2KLocalObject
{
+ public History history;
/** TypeNameAndConstructionInfo[] variables added by Steve */
private final TypeNameAndConstructionInfo[] mVertexTypeNameAndConstructionInfo =
{
@@ -53,6 +55,15 @@ public class Workflow extends CompositeActivity implements C2KLocalObject PredefinedStepContainer act = new PredefinedStepContainer();
addChild(act, new GraphPoint(300, 100));
}
+
+ public History getHistory() {
+ if (history == null) {
+ Integer i = (Integer) (getProperties().get("ItemSystemKey"));
+ if (i != null)
+ history = new History(i, this);
+ }
+ return history;
+ }
/**
* Method getVertexTypeNameAndConstructionInfo.
|
