From c543e99e6b02a25c6dc745081f3915897420b225 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 20 Sep 2013 13:39:01 +0200 Subject: Keep a History object in the Workflow to avoid recreating it on repeated executions. --- src/main/java/com/c2kernel/lifecycle/instance/Workflow.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/Workflow.java') 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. -- cgit v1.2.3