diff options
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/Activity.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/Activity.java | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java index 70b991d..4dfe6ca 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java @@ -26,14 +26,14 @@ import java.util.Map; import java.util.Vector;
import com.c2kernel.common.AccessRightsException;
-import com.c2kernel.common.CannotManage;
+import com.c2kernel.common.CannotManageException;
import com.c2kernel.common.GTimeStamp;
import com.c2kernel.common.InvalidCollectionModification;
-import com.c2kernel.common.InvalidData;
-import com.c2kernel.common.InvalidTransition;
-import com.c2kernel.common.ObjectAlreadyExists;
+import com.c2kernel.common.InvalidDataException;
+import com.c2kernel.common.InvalidTransitionException;
+import com.c2kernel.common.ObjectAlreadyExistsException;
import com.c2kernel.common.ObjectCannotBeUpdated;
-import com.c2kernel.common.ObjectNotFound;
+import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.common.PersistencyException;
import com.c2kernel.entity.agent.Job;
import com.c2kernel.events.Event;
@@ -103,13 +103,13 @@ public class Activity extends WfVertex return new Next(this, vertex);
}
- public StateMachine getStateMachine() throws InvalidData {
+ public StateMachine getStateMachine() throws InvalidDataException {
if (machine == null) {
String name = (String)getProperties().get("StateMachineName");
int version = getVersionNumberProperty("StateMachineVersion");
try {
machine = LocalObjectLoader.getStateMachine(name, version);
- } catch (ObjectNotFound ex) {
+ } catch (ObjectNotFoundException ex) {
if (name.equals(getDefaultSMName()) && version == 0) { // default state machine not imported yet. Fake it.
try {
String marshalledSM = Gateway.getResource().getTextResource(null, "boot/SM/"+getDefaultSMName()+".xml");
@@ -119,24 +119,24 @@ public class Activity extends WfVertex return bootstrap;
} catch (Exception ex2) {
Logger.error(ex2);
- throw new InvalidData("Could not bootstrap default state machine from resources.");
+ throw new InvalidDataException("Could not bootstrap default state machine from resources.");
}
}
Logger.error(ex);
- throw new InvalidData("Error loading state machine '"+name+"' v"+version);
+ throw new InvalidDataException("Error loading state machine '"+name+"' v"+version);
}
}
return machine;
}
/** return the current State of the State machine (Used in Serialisation) */
- public int getState() throws InvalidData
+ public int getState() throws InvalidDataException
{
if (state == -1)
state = getStateMachine().getInitialStateCode();
return state;
}
- public String getStateName() throws InvalidData
+ public String getStateName() throws InvalidDataException
{
return getStateMachine().getState(getState()).getName();
}
@@ -147,19 +147,19 @@ public class Activity extends WfVertex this.state = state;
}
- public boolean isFinished() throws InvalidData {
+ public boolean isFinished() throws InvalidDataException {
return getStateMachine().getState(getState()).isFinished();
}
/** cf Item request
- * @throws ObjectNotFound
+ * @throws ObjectNotFoundException
* @throws PersistencyException
- * @throws ObjectAlreadyExists
+ * @throws ObjectAlreadyExistsException
* @throws ObjectCannotBeUpdated
- * @throws CannotManage
+ * @throws CannotManageException
* @throws InvalidCollectionModification */
- public String request(AgentPath agent, ItemPath itemPath, int transitionID, String requestData) throws AccessRightsException, InvalidTransition, InvalidData, ObjectNotFound, PersistencyException, ObjectAlreadyExists, ObjectCannotBeUpdated, CannotManage, InvalidCollectionModification
+ public String request(AgentPath agent, ItemPath itemPath, int transitionID, String requestData) throws AccessRightsException, InvalidTransitionException, InvalidDataException, ObjectNotFoundException, PersistencyException, ObjectAlreadyExistsException, ObjectCannotBeUpdated, CannotManageException, InvalidCollectionModification
{
// Find requested transition
@@ -178,7 +178,7 @@ public class Activity extends WfVertex if (requestData != null && requestData.length()>0)
storeOutcome = true;
else if (transition.getOutcome().isRequired())
- throw new InvalidData("Transition requires outcome data, but none was given");
+ throw new InvalidDataException("Transition requires outcome data, but none was given");
}
// Get new state
@@ -237,7 +237,7 @@ public class Activity extends WfVertex try {
RolePath myRole = Gateway.getLookup().getRolePath(agentRole);
pushJobsToAgents(itemPath, myRole);
- } catch (ObjectNotFound ex) { // non-existent role
+ } catch (ObjectNotFoundException ex) { // non-existent role
Logger.msg(7, "Activity.pushJobsToAgents() - Activity role '"+agentRole+" not found.");
}
}
@@ -248,13 +248,13 @@ public class Activity extends WfVertex protected String runActivityLogic(AgentPath agent, ItemPath itemPath,
int transitionID, String requestData) throws
- InvalidData,
+ InvalidDataException,
InvalidCollectionModification,
- ObjectAlreadyExists,
+ ObjectAlreadyExistsException,
ObjectCannotBeUpdated,
- ObjectNotFound,
+ ObjectNotFoundException,
PersistencyException,
- CannotManage
+ CannotManageException
{
// Overriden in predefined steps
return requestData;
@@ -323,14 +323,14 @@ public class Activity extends WfVertex return loop2;
}
/** sets the next activity available if possible
- * @throws ObjectNotFound
+ * @throws ObjectNotFoundException
* @throws AccessRightsException
- * @throws InvalidTransition
+ * @throws InvalidTransitionException
* @throws PersistencyException
- * @throws ObjectAlreadyExists
+ * @throws ObjectAlreadyExistsException
* @throws ObjectCannotBeUpdated */
@Override
- public void runNext(AgentPath agent, ItemPath itemPath) throws InvalidData
+ public void runNext(AgentPath agent, ItemPath itemPath) throws InvalidDataException
{
setActive(false);
try
@@ -368,7 +368,7 @@ public class Activity extends WfVertex }
}
}
- catch (InvalidData s)
+ catch (InvalidDataException s)
{
setActive(true);
throw s;
@@ -383,10 +383,10 @@ public class Activity extends WfVertex return null;
}
/** reinitialises the Activity and propagate (for Loop)
- * @throws InvalidData
- * @throws ObjectNotFound */
+ * @throws InvalidDataException
+ * @throws ObjectNotFoundException */
@Override
- public void reinit(int idLoop) throws InvalidData
+ public void reinit(int idLoop) throws InvalidDataException
{
Vertex[] outVertices = getOutGraphables();
setState(getStateMachine().getInitialState().getId());
@@ -406,16 +406,16 @@ public class Activity extends WfVertex }
/**
* called by precedent Activity runNext() for setting the activity able to be executed
- * @throws InvalidData
- * @throws ObjectAlreadyExists
+ * @throws InvalidDataException
+ * @throws ObjectAlreadyExistsException
* @throws AccessRightsException
- * @throws InvalidTransition
- * @throws ObjectNotFound
+ * @throws InvalidTransitionException
+ * @throws ObjectNotFoundException
* @throws PersistencyException
* @throws ObjectCannotBeUpdated
*/
@Override
- public void run(AgentPath agent, ItemPath itemPath) throws InvalidData
+ public void run(AgentPath agent, ItemPath itemPath) throws InvalidDataException
{
Logger.debug(8, getPath() + " run " + getState());
@@ -433,16 +433,16 @@ public class Activity extends WfVertex }
/**
* sets the activity available to be executed on start of Workflow or composite activity (when it is the first one of the (sub)process
- * @throws InvalidData
- * @throws ObjectAlreadyExists
- * @throws ObjectNotFound
+ * @throws InvalidDataException
+ * @throws ObjectAlreadyExistsException
+ * @throws ObjectNotFoundException
* @throws AccessRightsException
- * @throws InvalidTransition
+ * @throws InvalidTransitionException
* @throws PersistencyException
* @throws ObjectCannotBeUpdated
*/
@Override
- public void runFirst(AgentPath agent, ItemPath itemPath) throws InvalidData
+ public void runFirst(AgentPath agent, ItemPath itemPath) throws InvalidDataException
{
Logger.debug(8, getPath() + " runfirst");
run(agent, itemPath);
@@ -475,19 +475,19 @@ public class Activity extends WfVertex /**
* returns the lists of jobs for the activity and children (cf com.c2kernel.entity.Job)
- * @throws InvalidData
- * @throws ObjectNotFound
+ * @throws InvalidDataException
+ * @throws ObjectNotFoundException
* @throws InvalidAgentPathException
*/
- public ArrayList<Job> calculateJobs(AgentPath agent, ItemPath itemPath, boolean recurse) throws InvalidAgentPathException, ObjectNotFound, InvalidData
+ public ArrayList<Job> calculateJobs(AgentPath agent, ItemPath itemPath, boolean recurse) throws InvalidAgentPathException, ObjectNotFoundException, InvalidDataException
{
return calculateJobsBase(agent, itemPath, false);
} //
- public ArrayList<Job> calculateAllJobs(AgentPath agent, ItemPath itemPath, boolean recurse) throws InvalidAgentPathException, ObjectNotFound, InvalidData
+ public ArrayList<Job> calculateAllJobs(AgentPath agent, ItemPath itemPath, boolean recurse) throws InvalidAgentPathException, ObjectNotFoundException, InvalidDataException
{
return calculateJobsBase(agent, itemPath, true);
}
- private ArrayList<Job> calculateJobsBase(AgentPath agent, ItemPath itemPath, boolean includeInactive) throws ObjectNotFound, InvalidData, InvalidAgentPathException
+ private ArrayList<Job> calculateJobsBase(AgentPath agent, ItemPath itemPath, boolean includeInactive) throws ObjectNotFoundException, InvalidDataException, InvalidAgentPathException
{
Logger.msg(7, "calculateJobs - " + getPath());
ArrayList<Job> jobs = new ArrayList<Job>();
@@ -510,7 +510,7 @@ public class Activity extends WfVertex try {
RolePath myRole = Gateway.getLookup().getRolePath(agentRole);
pushJobsToAgents(itemPath, myRole);
- } catch (ObjectNotFound ex) { // non-existent role
+ } catch (ObjectNotFoundException ex) { // non-existent role
Logger.msg(7, "Activity.pushJobsToAgents() - Activity role '"+agentRole+" not found.");
}
}
|
