From 8b32fe15554c0103585321c3d397f6e46dd451b4 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 17 Sep 2013 08:54:33 +0200 Subject: Merge and tidy after 2.4 --- .../java/com/c2kernel/lifecycle/instance/Activity.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/Activity.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java index 71909a5..6e03d01 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java @@ -101,6 +101,10 @@ public class Activity extends WfVertex this.state = state; } + public boolean isFinished() throws InvalidDataException { + return getStateMachine().getState(state).isFinished(); + } + /** cf Item request * @throws ObjectNotFoundException @@ -303,10 +307,10 @@ public class Activity extends WfVertex * @throws InvalidDataException * @throws ObjectNotFoundException */ @Override - public void reinit(int idLoop) + public void reinit(int idLoop) throws InvalidDataException { Vertex[] outVertices = getOutGraphables(); - state = getStateMachine().getInitialState().getId(); + setState(getStateMachine().getInitialState().getId()); if (outVertices.length > 0) { WfVertex nextAct = (WfVertex) outVertices[0]; @@ -382,15 +386,15 @@ public class Activity extends WfVertex /** * returns the lists of jobs for the activity and children (cf com.c2kernel.entity.Job) */ - public ArrayList calculateJobs(AgentPath agent, int itemSysKey, boolean recurse) + public ArrayList calculateJobs(AgentPath agent, int itemSysKey, boolean recurse) throws ObjectNotFoundException, InvalidDataException { return calculateJobsBase(agent, itemSysKey, false); } // - public ArrayList calculateAllJobs(AgentPath agent, int itemSysKey, boolean recurse) + public ArrayList calculateAllJobs(AgentPath agent, int itemSysKey, boolean recurse) throws ObjectNotFoundException, InvalidDataException { return calculateJobsBase(agent, itemSysKey, true); } - private ArrayList calculateJobsBase(AgentPath agent, int itemSysKey, boolean includeInactive) + private ArrayList calculateJobsBase(AgentPath agent, int itemSysKey, boolean includeInactive) throws ObjectNotFoundException, InvalidDataException { Logger.msg(7, "calculateJobs - " + getPath()); ArrayList jobs = new ArrayList(); -- cgit v1.2.3