summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lifecycle/instance/Activity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/Activity.java')
-rw-r--r--src/main/java/com/c2kernel/lifecycle/instance/Activity.java48
1 files changed, 33 insertions, 15 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java
index 95e0ede..3dd94b0 100644
--- a/src/main/java/com/c2kernel/lifecycle/instance/Activity.java
+++ b/src/main/java/com/c2kernel/lifecycle/instance/Activity.java
@@ -1,5 +1,6 @@
package com.c2kernel.lifecycle.instance;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.Map;
import java.util.Vector;
@@ -21,6 +22,7 @@ import com.c2kernel.lifecycle.instance.stateMachine.Transition;
import com.c2kernel.lookup.AgentPath;
import com.c2kernel.lookup.InvalidAgentPathException;
import com.c2kernel.lookup.ItemPath;
+import com.c2kernel.lookup.Path;
import com.c2kernel.lookup.RolePath;
import com.c2kernel.persistency.ClusterStorageException;
import com.c2kernel.persistency.outcome.Outcome;
@@ -203,7 +205,16 @@ public class Activity extends WfVertex
DateUtility.setToNow(mStateDate);
//refresh all the job lists
- pushJobsToAgents(itemPath);
+ String agentRole = getCurrentAgentRole();
+ if (agentRole != null && agentRole.length()>0) {
+ try {
+ RolePath myRole = Gateway.getLookup().getRolePath(agentRole);
+ pushJobsToAgents(itemPath, myRole);
+ } catch (ObjectNotFoundException ex) { // non-existent role
+ Logger.msg(7, "Activity.pushJobsToAgents() - Activity role '"+agentRole+" not found.");
+ }
+ }
+
return outcome;
}
@@ -451,22 +462,29 @@ public class Activity extends WfVertex
}
return jobs;
}
-
- public void pushJobsToAgents(ItemPath itemPath)
- {
- String agentRole = getCurrentAgentRole();
- if (agentRole == null || agentRole.length()==0) return;
- RolePath myRole;
- try {
- myRole = Gateway.getLookup().getRolePath(agentRole);
- } catch (ObjectNotFoundException ex) { // non-existent role
- Logger.msg(7, "Activity.pushJobsToAgents() - Activity role '"+agentRole+" not found.");
- return;
- }
- if (myRole.hasJobList())
- new JobPusher(this, itemPath, myRole).start();
+ public void pushJobsToAgents(ItemPath itemPath) {
+ String agentRole = getCurrentAgentRole();
+ if (agentRole != null && agentRole.length()>0) {
+ try {
+ RolePath myRole = Gateway.getLookup().getRolePath(agentRole);
+ pushJobsToAgents(itemPath, myRole);
+ } catch (ObjectNotFoundException ex) { // non-existent role
+ Logger.msg(7, "Activity.pushJobsToAgents() - Activity role '"+agentRole+" not found.");
+ }
+ }
+ }
+
+ public void pushJobsToAgents(ItemPath itemPath, RolePath role)
+ {
+ if (role.hasJobList())
+ new JobPusher(this, itemPath, role).start();
+ Iterator<Path> childRoles = role.getChildren();
+ while (childRoles.hasNext()) {
+ RolePath childRole = (RolePath)childRoles.next();
+ pushJobsToAgents(itemPath, childRole);
+ }
}
/**