From 04048a6c4026b47fc6c372e792ffb60726baee56 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 24 Oct 2013 13:12:52 +0200 Subject: Clear of exceptions --- .../lifecycle/instance/CompositeActivity.java | 35 +++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java b/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java index f7d39ae..2f475c7 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/CompositeActivity.java @@ -5,14 +5,13 @@ import java.util.ArrayList; import com.c2kernel.common.AccessRightsException; import com.c2kernel.common.InvalidDataException; import com.c2kernel.common.InvalidTransitionException; -import com.c2kernel.common.ObjectAlreadyExistsException; import com.c2kernel.common.ObjectNotFoundException; +import com.c2kernel.common.PersistencyException; import com.c2kernel.entity.agent.Job; import com.c2kernel.graph.model.GraphModel; import com.c2kernel.graph.model.GraphPoint; import com.c2kernel.graph.model.GraphableVertex; import com.c2kernel.lookup.AgentPath; -import com.c2kernel.scripting.ScriptingEngineException; import com.c2kernel.utils.Logger; /** @@ -21,9 +20,9 @@ import com.c2kernel.utils.Logger; */ public class CompositeActivity extends Activity { - /** - * @see java.lang.Object#Object() - */ + + public static final int START = 0; + public static final int COMPLETE = 1; /* * -------------------------------------------- * ----------------CONSTRUCTOR----------------- @@ -275,10 +274,14 @@ public class CompositeActivity extends Activity /** * @throws InvalidDataException + * @throws ObjectNotFoundException + * @throws AccessRightsException + * @throws InvalidTransitionException + * @throws PersistencyException * @see com.c2kernel.lifecycle.instance.WfVertex#run() */ @Override - public void run(AgentPath agent, int itemSysKey) throws InvalidDataException + public void run(AgentPath agent, int itemSysKey) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException { super.run(agent, itemSysKey); if (getChildrenGraphModel().getStartVertex() != null && !getStateMachine().getState(state).isFinished()) @@ -289,10 +292,10 @@ public class CompositeActivity extends Activity } @Override - public void runNext(AgentPath agent, int itemSysKey) throws InvalidDataException + public void runNext(AgentPath agent, int itemSysKey) throws InvalidDataException, AccessRightsException, InvalidTransitionException, ObjectNotFoundException, PersistencyException { if (!getStateMachine().getState(state).isFinished()) - getMachine().traverse(Transitions.COMPLETE); + request(agent, itemSysKey, CompositeActivity.COMPLETE, null); super.runNext(agent, itemSysKey); } @@ -393,10 +396,11 @@ public class CompositeActivity extends Activity } /** + * @throws InvalidDataException * */ @Override - public void reinit(int idLoop) + public void reinit(int idLoop) throws InvalidDataException { super.reinit(idLoop); if (getChildrenGraphModel().getStartVertex() != null && !getStateMachine().getState(state).isFinished()) @@ -404,16 +408,11 @@ public class CompositeActivity extends Activity } @Override - public void request(AgentPath agent, int itemSysKey, int transitionID, String requestData) throws AccessRightsException, InvalidTransitionException, InvalidDataException, ObjectAlreadyExistsException + public void request(AgentPath agent, int itemSysKey, int transitionID, String requestData) throws AccessRightsException, InvalidTransitionException, InvalidDataException, ObjectNotFoundException, PersistencyException { - if (getChildrenGraphModel().getStartVertex() != null && !getStateMachine().getState(state).isFinished() && transitionID == Transitions.START) - try - { - ((WfVertex) getChildrenGraphModel().getStartVertex()).run(agent); - } catch (ScriptingEngineException e) - { - Logger.error(e); - } + if (getChildrenGraphModel().getStartVertex() != null && !getStateMachine().getState(state).isFinished() && transitionID == CompositeActivity.START) + ((WfVertex) getChildrenGraphModel().getStartVertex()).run(agent, itemSysKey); + super.request(agent, itemSysKey, transitionID, requestData); } -- cgit v1.2.3