cleaned up, fixed a couple of small bugs

mp2079 [2003-05-15 19:21:41]
cleaned up, fixed a couple of small bugs
Filename
littlejil/LittleJILExpanderPlugin.java
littlejil/LittleJILLoaderServletComponent.java
littlejil/PluginUtil.java
littlejil/TaskAllocatorPlugin.java
littlejil/TaskExecutorClassPlugin.java
littlejil/TaskExecutorInternalPlugin.java
littlejil/TaskExecutorSimulatePlugin.java
littlejil/TaskExecutorWorkletPlugin.java
littlejil/TaskExpanderPlugin.java
diff --git a/littlejil/LittleJILExpanderPlugin.java b/littlejil/LittleJILExpanderPlugin.java
index a7ff3ef..c6cdb0f 100644
--- a/littlejil/LittleJILExpanderPlugin.java
+++ b/littlejil/LittleJILExpanderPlugin.java
@@ -49,7 +49,6 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
     public static final Verb DUMMY_TASK = new Verb("DUMMY_TASK");


-
     /**
      * Used by the binding utility through reflection to set my DomainService
      */
@@ -71,10 +70,10 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
     }

     private static class ResourceTablePredicate implements UnaryPredicate {
-           public boolean execute(Object o) {
-               return (o instanceof LittleJILResourceTable);
-           }
-       }
+        public boolean execute(Object o) {
+            return (o instanceof LittleJILResourceTable);
+        }
+    }

     private static class PostHandlerRequestPredicate implements UnaryPredicate {
         public boolean execute(Object o) {
@@ -119,16 +118,12 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
             stepsTable = (LittleJILStepsTable) stepsTableSubscription.first();
         }

-        resourceTable = (LittleJILResourceTable) resourceTableSubscription.first();
-        assert(resourceTable != null);
-
-        /*// TODO: temporary
         if (resourceTableSubscription.size() == 0) {
             resourceTable = new LittleJILResourceTable();
             blackboard.publishAdd(resourceTable);
         } else {
             resourceTable = (LittleJILResourceTable) resourceTableSubscription.first();
-        }*/
+        }

         // process any diagrams found
         for (Enumeration e = diagramSubscription.getAddedList(); e.hasMoreElements();) {
@@ -179,7 +174,7 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {

                 logger.debug("found handler binding in blackboard for task: " + task.getVerb());

-                NewTask handlerTask = (NewTask) makeTask((Step)binding.getTarget());
+                NewTask handlerTask = (NewTask) makeTask((Step) binding.getTarget());

                 // insert it into the task's workflow (ie, at the same level as the given task)
                 NewWorkflow parentWorkflow = (NewWorkflow) task.getWorkflow();
@@ -195,8 +190,8 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
                     constraint.setConstrainedTask(handlerTask);
                 }
                 else {*/
-                    constraint.setConstrainingTask(handlerTask);
-                    constraint.setConstrainedTask(task);
+                constraint.setConstrainingTask(handlerTask);
+                constraint.setConstrainedTask(task);
                 //}

                 constraint.setConstrainingAspect(AspectType.END_TIME);
@@ -294,9 +289,9 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
             ((NewTask) task).setPreference(pref);

             // add this task to the task->steps table
+            logger.debug("adding task " + task + " to steps table");
             stepsTable.put(task, step);
-        }
-        else {
+        } else {

             // only for RESTART handlers, if the task has pre-reqs, we call makeTaskWithRequisites()
             if (request.getType() == ExceptionHandlerRequest.RESTART &&
@@ -319,7 +314,7 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {

         if (request != null && request.getType() == ExceptionHandlerRequest.COMPLETE) {
             // create a "dummy" task, that will always be "executed" by the ExecutorPlugin, and put in the workflow
-            NewTask dummyTask= factory.newTask();
+            NewTask dummyTask = factory.newTask();
             dummyTask.setVerb(DUMMY_TASK);

             ScoringFunction scorefcn = ScoringFunction.createStrictlyAtValue
@@ -332,8 +327,7 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
             dummyTask.setWorkflow(workflow);

             lastTask = dummyTask;
-        }
-        else {
+        } else {
             // get subsets of this step and create tasks for those, and put them in the workflow
             // NOTE: tasks are returned in the correct order (according to Little-JIL API docs)
             boolean continueFlag = false;   // (only if request is ContinueRequest) indicates that tasks should be now added
@@ -379,13 +373,11 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
                         Object o = resourceTable.getResource(step.getDiagram(), cardinalityParam.getName());
                         if (o == null) {
                             logger.warn("Cardinality resource " + cardinalityParam.getName() + " not found!");
-                        }
-                        else if (!(o instanceof Collection)) {
+                        } else if (!(o instanceof Collection)) {
                             logger.warn("Cardinality resource " + cardinalityParam.getName() + " found, but not a Collection");
-                        }
-                        else {
+                        } else {
                             collection = (Collection) o;
-                            logger.info("found resource iterator of size "+ collection.size());
+                            logger.info("found resource iterator of size " + collection.size());
                             iterator = collection.iterator();
                         }
                     }
@@ -396,7 +388,7 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
                     count = (count < collection.size() ? count : collection.size());
                 }

-                for (int i=0;i<count ;i++) {
+                for (int i = 0; i < count; i++) {

                     NewTask subtask = makeSubTask(substep, substepBinding, task, workflow);

@@ -454,8 +446,7 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
             //logger.debug("publishing expansion " + expansion);
             blackboard.publishAdd(expansion);

-        }
-        else if (request != null && request.getType() == ExceptionHandlerRequest.TRY) {
+        } else if (request != null && request.getType() == ExceptionHandlerRequest.TRY) {
             // check: if this was a TRY request and we haven't added any tasks, it means there weren't any left
             // and we should post an exception

@@ -465,12 +456,10 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
         }


-
         return task;
     }


-
     /**
      * Encapsulates a task with pre or post requisistes into a "parent" task that contains as sub-tasks
      * the pre-req, the actual task, and the post-req in sequential order
@@ -506,8 +495,7 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {
             }

             logger.debug("created parent task " + parentTask.getVerb());
-        }
-        else {
+        } else {
             logger.debug("processing ExceptionHandlerRequest for task " + parentTask.getVerb());

             // remove the task's current expansion
@@ -596,47 +584,49 @@ public class LittleJILExpanderPlugin extends ComponentPlugin {

         // set the parameter bindings for this task
         LittleJILStepsTable.Entry entry = stepsTable.getEntry(subtask);
-        assert(entry != null);  // all tasks should have an entry
-
-        // initialize the subtasks's in parameters... note that these values might get
-        // updated later by the TaskExpander (if for example the parameters that they are getting
-        // values from are updated by one of the subtasks)
-        for (Enumeration parameterBindings = substepBinding.parameterBindings(); parameterBindings.hasMoreElements();) {
-            ParameterBinding binding = (ParameterBinding) parameterBindings.nextElement();
-            if (binding.getBindingMode() == ParameterBinding.COPY_IN ||
-                    binding.getBindingMode() == ParameterBinding.COPY_IN_AND_OUT) {
-
-                ParameterDeclaration childDeclaration = binding.getDeclarationInChild();
-                ParameterDeclaration parentDeclaration = binding.getDeclarationInParent();
-
-                if (parentDeclaration.getParameterValue() == null) {
-
-                    // instantiate it a new parameter value
-                    logger.debug("instantiating a new object for parent parameter " + parentDeclaration.getName());
-                    try {
-                        Class c = Class.forName(parentDeclaration.getParameterClassName());
-
-                        // HACK to have an "interesting" value in some cases
-                        Object o = null;
-                        if (c == String.class) {
-                            o = "42";
-                        }
-                        else {
-                            o = c.newInstance();
+
+        if (entry != null) {
+
+            // initialize the subtasks's in parameters... note that these values might get
+            // updated later by the TaskExpander (if for example the parameters that they are getting
+            // values from are updated by one of the subtasks)
+            for (Enumeration parameterBindings = substepBinding.parameterBindings(); parameterBindings.hasMoreElements();) {
+                ParameterBinding binding = (ParameterBinding) parameterBindings.nextElement();
+                if (binding.getBindingMode() == ParameterBinding.COPY_IN ||
+                        binding.getBindingMode() == ParameterBinding.COPY_IN_AND_OUT) {
+
+                    ParameterDeclaration childDeclaration = binding.getDeclarationInChild();
+                    ParameterDeclaration parentDeclaration = binding.getDeclarationInParent();
+
+                    if (parentDeclaration.getParameterValue() == null) {
+
+                        // instantiate it a new parameter value
+                        logger.debug("instantiating a new object for parent parameter " + parentDeclaration.getName());
+                        try {
+                            Class c = Class.forName(parentDeclaration.getParameterClassName());
+
+                            // HACK to have an "interesting" value in some cases
+                            Object o = null;
+                            if (c == String.class) {
+                                o = "42";
+                            } else {
+                                o = c.newInstance();
+                            }
+
+                            parentDeclaration.setParameterValue(o);
+                        } catch (Exception e) {
+                            logger.warn("Could not instantiate parameter: " + e);
                         }

-                        parentDeclaration.setParameterValue(o);
-                    } catch (Exception e) {
-                        logger.warn("Could not instantiate parameter: " + e);
                     }

+                    childDeclaration.setParameterValue(parentDeclaration.getParameterValue());
                 }
-
-                childDeclaration.setParameterValue(parentDeclaration.getParameterValue());
             }
-        }

-        entry.setParameterBindings(PluginUtil.collectionFromEnumeration(substepBinding.parameterBindings()));
+            entry.setParameterBindings(PluginUtil.collectionFromEnumeration(substepBinding.parameterBindings()));
+
+        }

         logger.debug("adding task " + subtask.getVerb() + " to workflow of task " + parentTask.getVerb());
         subtask.setParentTask(parentTask);
diff --git a/littlejil/LittleJILLoaderServletComponent.java b/littlejil/LittleJILLoaderServletComponent.java
index 298fdf2..fabbcc7 100644
--- a/littlejil/LittleJILLoaderServletComponent.java
+++ b/littlejil/LittleJILLoaderServletComponent.java
@@ -1,6 +1,7 @@
 package psl.workflakes.littlejil;

 import psl.ai2tv.workflow.assets.*;
+import psl.workflakes.littlejil.assets.*;

 import java.io.*;
 import java.util.Vector;
@@ -26,6 +27,8 @@ public class LittleJILLoaderServletComponent extends BaseServletComponent implem
     private static final Logger logger = Logger.getLogger(LittleJILLoaderServletComponent.class);
     private RootFactory factory;

+    private ExecAgentAsset lastAsset;   // last asset posted to blackboard
+
     protected String getPath() {
         return "/littlejil";
     }
@@ -46,13 +49,36 @@ public class LittleJILLoaderServletComponent extends BaseServletComponent implem

     public void setPrototypeRegistryService(PrototypeRegistryService prototypeRegistryService) {

-        factory.addPropertyGroupFactory(new PropertyGroupFactory());
+        factory.addPropertyGroupFactory(new psl.ai2tv.workflow.assets.PropertyGroupFactory());
+        factory.addPropertyGroupFactory(new psl.workflakes.littlejil.assets.PropertyGroupFactory());

         // set the Prototypes for Assets
+        {
+            ExecClassAgentAsset prototype = (ExecClassAgentAsset)
+                    factory.createPrototype(ExecClassAgentAsset.class, "ExecClassAgentProto");
+
+            prototypeRegistryService.cachePrototype("ExecClassAgent", prototype);
+        }
+
+        {
+            ExecWorkletAgentAsset prototype = (ExecWorkletAgentAsset)
+                    factory.createPrototype(ExecWorkletAgentAsset.class, "ExecWorkletAgentProto");
+
+            prototypeRegistryService.cachePrototype("ExecWorkletAgent", prototype);
+        }
+
+        {
+            ExecAgentAsset prototype = (ExecAgentAsset)
+                    factory.createPrototype(ExecAgentAsset.class, "ExecAgentProto");
+
+            prototypeRegistryService.cachePrototype("ExecAgent", prototype);
+        }
+
+        // set the prototypes for AI2TV assets
         ReportAsset reportProto = (ReportAsset) factory.createPrototype(ReportAsset.class, "ReportProto");
         prototypeRegistryService.cachePrototype("ReportProto", reportProto);

-        ClientAsset clientProto = (ClientAsset)factory.createPrototype(ClientAsset.class, "ClientProto");
+        ClientAsset clientProto = (ClientAsset) factory.createPrototype(ClientAsset.class, "ClientProto");
         prototypeRegistryService.cachePrototype("ClientProto", clientProto);

     }
@@ -61,8 +87,19 @@ public class LittleJILLoaderServletComponent extends BaseServletComponent implem

         public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

+            ServletOutputStream out = response.getOutputStream();
+
+            out.println("<html><style>body { font-family: \"Verdana\"; font-size:10pt; }</style><body>");
+            out.println("<h2>Welcome to the Little-JIL tester</h2>");
+
+
             String diagramName = request.getParameter("diagramName");
+            String type = request.getParameter("type");
             String msg = "";
+
+            // for ai2tv fake diagram run
+            blackboard.openTransaction();
+
             if (request.getParameter("ai2tv") != null) {

                 final ClientAsset client = (ClientAsset) factory.createInstance("ClientProto");
@@ -72,56 +109,108 @@ public class LittleJILLoaderServletComponent extends BaseServletComponent implem
                 ReportAsset reportAsset = (ReportAsset) factory.createInstance("ReportProto");
                 NewBucketPG bucketPG = (NewBucketPG) factory.createPropertyGroup("BucketPG");
                 bucketPG.setSampleTime(System.currentTimeMillis());
-                bucketPG.setGroup(new Vector() { { add(client);} });
+                bucketPG.setGroup(new Vector() {
+                    {
+                        add(client);
+                    }
+                });
                 reportAsset.setBucketPG(bucketPG);

-                blackboard.openTransaction();
                 blackboard.publishAdd(reportAsset);
-                blackboard.closeTransaction();

                 logger.debug("published report asset");
                 msg = "Published report asset";

+                out.println("<b>" + msg + "</b><br>");
+                out.println("<a href=\"javascript:history.go(-1)\">Back</a>");

-            }
-            else if (diagramName != null) {
+            } else if (diagramName != null && type != null) {
+
+                // depending on type, add the right ExecAgentAsset type
+                // and remove the one that was there before
+
+                if (lastAsset != null) {
+                    blackboard.publishRemove(lastAsset);
+                    lastAsset = null;
+                }
+
+                ExecAgentAsset asset = null;
+                if (type.equals("simulate")) {
+                    asset = (ExecAgentAsset) factory.createInstance("ExecAgent");
+                    NewExecutorPG executorPG = (NewExecutorPG) factory.createPropertyGroup("ExecutorPG");
+                    executorPG.setCapabilities("any");
+
+                    asset.setExecutorPG(executorPG);
+
+                } else if (type.equals("class")) {
+
+                    asset = (ExecClassAgentAsset) factory.createInstance("ExecClassAgent");
+                    NewExecutorPG executorPG = (NewExecutorPG) factory.createPropertyGroup("ExecutorPG");
+                    executorPG.setCapabilities("any");

-                Diagram diagram = null;
-                try {
-                    ObjectInputStream objIn = new ObjectInputStream(
-                            new BufferedInputStream(new FileInputStream(diagramName)));
+                    NewClassPG classPG = (NewClassPG) factory.createPropertyGroup("ClassPG");
+                    classPG.setClassName(request.getParameter("className"));
+                    asset.setExecutorPG(executorPG);
+                    ((ExecClassAgentAsset) asset).setClassPG(classPG);

-                    Program program = (Program) objIn.readObject();
-                    diagram = program.getRootDiagram();
+                } else if (type.equals("worklet")) {
+                    asset = (ExecWorkletAgentAsset) factory.createInstance("ExecWorkletAgent");
+                    NewExecutorPG executorPG = (NewExecutorPG) factory.createPropertyGroup("ExecutorPG");
+                    executorPG.setCapabilities("any");
+                    asset.setExecutorPG(executorPG);
+                }
+
+                if (asset == null) {
+                    msg = "Please select a valid running option (no asset created)";
+                } else {
+                    lastAsset = asset;
+                    blackboard.publishAdd(asset);
+
+                    Diagram diagram = null;
+                    try {
+                        ObjectInputStream objIn = new ObjectInputStream(
+                                new BufferedInputStream(new FileInputStream(diagramName)));
+
+                        Program program = (Program) objIn.readObject();
+                        diagram = program.getRootDiagram();

-                    blackboard.openTransaction();
-                    blackboard.publishAdd(diagram);
-                    blackboard.closeTransaction();
+                        blackboard.publishAdd(diagram);

-                    logger.debug("published diagram");
-                    msg = "Published diagram";
+                        logger.debug("published diagram");
+                        msg = "Published diagram";

-                } catch (Exception e) {
-                    msg = "Could not load diagram: " + e;
+                    } catch (Exception e) {
+                        msg = "Could not load diagram: " + e;
+                    }
                 }
+
+                out.println("<b>" + msg + "</b><br>");
+                out.println("<a href=\"javascript:history.go(-1)\">Back</a>");
+
+            }
+            else {
+
+                out.println("<form action=\"" + request.getRequestURI() + "\" method=GET>");
+                out.println("Diagram name: <input type=text name=diagramName value=\"" +
+                        (diagramName == null ? "" : diagramName) + "\"> ");
+                out.println("<br>");
+                out.println("<br><input type=radio name=\"type\" value=\"simulate\">Simulate workflow</input>");
+                out.println("<br><input type=radio name=\"type\" value=\"class\">Use class</input>");
+                out.println("<input name=\"className\"/>");
+                out.println("<br><input type=radio name=\"type\" value=\"worklet\">Use Worklets</input>");
+                out.println("<br><br><input type=submit value=\"Run diagram\">");
+                out.println("<br><br><input type=submit name=\"ai2tv\" value=\"Run fake AI2TV workflow\"></input>");
+                out.println("</form>");
             }

-            ServletOutputStream out = response.getOutputStream();
-            out.println("<html><style>HTML { font-family: \"Verdana\"; font-size:10pt; }</style><body>");
-            out.println("<h2>Welcome to the Little-JIL loader</h2>");
-            out.println("<b>" + msg + "</b><br>");
-            out.println("<form action=\"" + request.getRequestURI() + "\" method=GET>");
-            out.println("Diagram name: <input type=text name=diagramName value=\"" +
-                    (diagramName == null ? "" : diagramName) + "\"> " +
-                    "<input type=submit>");
-            out.println("<br><br><input type=submit name=\"ai2tv\" value=\"Test ai2tv diagram\">");
-            out.println("</form>");
+            blackboard.closeTransaction();

+            out.println("</body></html>");

         }
     }

-    // from BlackboardClient... weird!
+    // from BlackboardClient, have to implement... weird!
     public long currentTimeMillis() {
         return System.currentTimeMillis();
     }
diff --git a/littlejil/PluginUtil.java b/littlejil/PluginUtil.java
index c3511ff..3aa96ee 100644
--- a/littlejil/PluginUtil.java
+++ b/littlejil/PluginUtil.java
@@ -24,7 +24,7 @@ public class PluginUtil {

         Vector v = new Vector();

-        while (e.hasMoreElements()) {
+        while (e != null && e.hasMoreElements()) {
             v.addElement(e.nextElement());
         }

diff --git a/littlejil/TaskAllocatorPlugin.java b/littlejil/TaskAllocatorPlugin.java
index 9d2c96f..1f5ee76 100644
--- a/littlejil/TaskAllocatorPlugin.java
+++ b/littlejil/TaskAllocatorPlugin.java
@@ -44,8 +44,8 @@ public class TaskAllocatorPlugin extends ComponentPlugin {
     public void setPrototypeRegistryService(PrototypeRegistryService prototypeRegistryService) {
         this.prototypeRegistry = prototypeRegistryService;

-        // create asset prototype
-        factory.addPropertyGroupFactory(new PropertyGroupFactory());
+        // TEMPORARY -- create asset prototype
+        /*factory.addPropertyGroupFactory(new PropertyGroupFactory());
         {
             ExecClassAgentAsset prototype = (ExecClassAgentAsset)
                     factory.createPrototype(ExecClassAgentAsset.class, "ExecClassAgentProto");
@@ -58,7 +58,7 @@ public class TaskAllocatorPlugin extends ComponentPlugin {
                     factory.createPrototype(ExecWorkletAgentAsset.class, "ExecWorkletAgentProto");

             prototypeRegistry.cachePrototype("ExecWorkletAgent", prototype);
-        }
+        }*/


     }
diff --git a/littlejil/TaskExecutorClassPlugin.java b/littlejil/TaskExecutorClassPlugin.java
index c0361fd..c0291ea 100644
--- a/littlejil/TaskExecutorClassPlugin.java
+++ b/littlejil/TaskExecutorClassPlugin.java
@@ -29,6 +29,10 @@ public class TaskExecutorClassPlugin extends AbstractTaskExecutorPlugin {
         instances = new Hashtable();
     }

+    public void setupSubscriptions() {
+        super.setupSubscriptions();
+    }
+

     public void executeTask(Allocation allocation, Hashtable inParams) {

@@ -102,10 +106,6 @@ public class TaskExecutorClassPlugin extends AbstractTaskExecutorPlugin {

             logger.info("executing method " + method);

-            // for TESTING
-            /*laser.littlejil.types.SimpleDuration v = new laser.littlejil.types.SimpleDuration();
-            v.setSeconds((int)(Math.random()*100));*/
-
             if (method.equals("FindBase")) {

                 // set the "base"
@@ -137,17 +137,8 @@ public class TaskExecutorClassPlugin extends AbstractTaskExecutorPlugin {
                 logger.debug("AdaptClients got clientInfo vector: " + clientInfo);

             }
-            else {  // for TESTING
-
-                // expect a List named "in", add something and put the list as "result"
-                List in = (List) inParams.get("in");
-                if (in == null) {
-                    throw new Exception("expected 'in' parameter");
-                }
-
-                in.add(new Integer(random.nextInt(100)));
-
-                outParams.put("result", in);
+            else {
+                // do nothing
             }

         }
diff --git a/littlejil/TaskExecutorInternalPlugin.java b/littlejil/TaskExecutorInternalPlugin.java
deleted file mode 100644
index 8c45463..0000000
--- a/littlejil/TaskExecutorInternalPlugin.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package psl.workflakes.littlejil;
-
-import psl.workflakes.littlejil.assets.ExecClassAgentAsset;
-
-import org.cougaar.planning.ldm.plan.Allocation;
-import org.cougaar.planning.ldm.plan.Task;
-
-import java.util.*;
-
-/**
- * This plugin executes tasks by invoking a method on a class.
- * Classes that are used to execute tasks need to implement the ExecutableTask interface.
- * Invokations are executed asynchronously.
- *
- * @author matias
- */
-
-public class TaskExecutorInternalPlugin extends AbstractTaskExecutorPlugin {
-
-    private Hashtable instances;    // instances of classes ready to use
-                                    // NOTE: these classes must be threadsafe!!
-
-    public TaskExecutorInternalPlugin() {
-        super(ExecClassAgentAsset.class);
-
-        instances = new Hashtable();
-    }
-
-
-    public void executeTask(Allocation allocation, Hashtable inParams) {
-
-        ExecutableTaskThread thread = new ExecutableTaskThread(allocation, inParams);
-
-        logger.debug("starting execute thread for task " + allocation.getTask().getVerb() + "...");
-        thread.start();
-
-    }
-
-    /**
-     * This thread class is used to execute tasks asynchronously
-     */
-    private class ExecutableTaskThread extends Thread {
-
-        private Allocation allocation;
-        private Hashtable inParams, outParams;
-
-        public ExecutableTaskThread(Allocation allocation, Hashtable inParams) {
-            super("ExecutableTaskThread");
-            this.allocation = allocation;
-            this.inParams = inParams;
-
-        }
-
-        public void run() {
-
-            Task task = allocation.getTask();
-
-            try {
-
-                ExecClassAgentAsset execAgent = (ExecClassAgentAsset) allocation.getAsset();
-                String className = execAgent.getClassPG().getClassName();
-
-                ExecutableTask executable = (ExecutableTask) instances.get(className);
-                if (executable == null) {
-                    logger.debug("instantiating class " + className);
-                    Class execClass = Class.forName(className);
-                    executable = (ExecutableTask) execClass.newInstance(); //new DummyExecutableTask();
-                    instances.put(className, executable);
-                }
-
-                Hashtable outParams = new Hashtable();
-
-                String name = task.getVerb().toString();
-                PluginUtil.Timing.addTimestamp("exec " + name);
-                executable.execute(name, inParams, outParams);
-                PluginUtil.Timing.addTimestamp("exec " + name);
-
-                // task executed successfully
-                logger.debug("executable for task " + task.getVerb() + " executed successfully");
-                taskSucceeded(allocation, outParams);
-
-            }
-            catch (Throwable e) {
-                // an error occurred
-                logger.warn("executable for task " + task.getVerb() + " failed with exception " + e);
-                taskFailed(allocation);
-                return;
-            }
-
-        }
-
-    }
-
-    public static class DummyExecutableTask implements ExecutableTask {
-
-        private static Random random = new Random();
-
-        public void execute(String method, Hashtable inParams, Hashtable outParams) throws Exception {
-
-            logger.info("executing method " + method);
-
-            // for TESTING
-            /*laser.littlejil.types.SimpleDuration v = new laser.littlejil.types.SimpleDuration();
-            v.setSeconds((int)(Math.random()*100));*/
-
-            if (method.equals("FindBase")) {
-
-                // set the "base"
-                outParams.put("base", String.valueOf(random.nextInt(100)));
-
-            }
-            else if (method.equals("EvaluateClient")) {
-
-                String base = (String) inParams.get("base");
-                Vector clientInfo = (Vector) inParams.get("clientInfo");
-
-                if (base == null || clientInfo == null ) {
-                    throw new Exception("expected 'base' and 'clientInfo' parameters");
-                }
-
-                logger.debug("EvaluateClient got base=" + base);
-
-                // add to the clientInfo list
-                clientInfo.add(new Integer(random.nextInt(100)));
-                outParams.put("clientInfo", clientInfo);
-            }
-            else if (method.equals("AdaptClients")) {
-
-                Vector clientInfo = (Vector) inParams.get("clientInfo");
-                if (clientInfo == null)  {
-                    throw new Exception("expected 'clientInfo' parameter");
-                }
-
-                logger.debug("AdaptClients got clientInfo vector: " + clientInfo);
-
-            }
-            else {  // for TESTING
-
-                // expect a List named "in", add something and put the list as "result"
-                List in = (List) inParams.get("in");
-                if (in == null) {
-                    throw new Exception("expected 'in' parameter");
-                }
-
-                in.add(new Integer(random.nextInt(100)));
-
-                outParams.put("result", in);
-            }
-
-        }
-
-    }
-}
\ No newline at end of file
diff --git a/littlejil/TaskExecutorSimulatePlugin.java b/littlejil/TaskExecutorSimulatePlugin.java
index 50b66d4..22f140d 100644
--- a/littlejil/TaskExecutorSimulatePlugin.java
+++ b/littlejil/TaskExecutorSimulatePlugin.java
@@ -27,6 +27,10 @@ public class TaskExecutorSimulatePlugin extends AbstractTaskExecutorPlugin {
         super(ExecAgentAsset.class);
     }

+    public void setupSubscriptions() {
+        super.setupSubscriptions();
+    }
+
     protected void executeTask(Allocation allocation, Hashtable inParams) {

          (new ExecutionThread(allocation)).start();
diff --git a/littlejil/TaskExecutorWorkletPlugin.java b/littlejil/TaskExecutorWorkletPlugin.java
index 46e9cdd..91fb0fa 100644
--- a/littlejil/TaskExecutorWorkletPlugin.java
+++ b/littlejil/TaskExecutorWorkletPlugin.java
@@ -69,6 +69,9 @@ public class TaskExecutorWorkletPlugin extends AbstractTaskExecutorPlugin {

     }

+    public void setupSubscriptions() {
+        super.setupSubscriptions();
+    }

     protected void executeTask(Allocation allocation, Hashtable inParams) {

diff --git a/littlejil/TaskExpanderPlugin.java b/littlejil/TaskExpanderPlugin.java
index 8627813..4cee08e 100644
--- a/littlejil/TaskExpanderPlugin.java
+++ b/littlejil/TaskExpanderPlugin.java
@@ -285,25 +285,26 @@ public class TaskExpanderPlugin extends ComponentPlugin {
      */
     private void setInParams(Task task) {
         LittleJILStepsTable.Entry entry = stepsTable.getEntry(task);
-        assert(entry != null);

-        Collection paramBindings = entry.getParameterBindings();
+        if (entry != null) {
+            Collection paramBindings = entry.getParameterBindings();

-        for (Iterator i = paramBindings.iterator(); i.hasNext();) {
-            ParameterBinding binding = (ParameterBinding) i.next();
-            if (binding.getBindingMode() == ParameterBinding.COPY_IN ||
-                    binding.getBindingMode() == ParameterBinding.COPY_IN_AND_OUT) {
+            for (Iterator i = paramBindings.iterator(); i.hasNext();) {
+                ParameterBinding binding = (ParameterBinding) i.next();
+                if (binding.getBindingMode() == ParameterBinding.COPY_IN ||
+                        binding.getBindingMode() == ParameterBinding.COPY_IN_AND_OUT) {

-                ParameterDeclaration childDeclaration = binding.getDeclarationInChild();
-                ParameterDeclaration parentDeclaration = binding.getDeclarationInParent();
+                    ParameterDeclaration childDeclaration = binding.getDeclarationInChild();
+                    ParameterDeclaration parentDeclaration = binding.getDeclarationInParent();

-                assert(parentDeclaration.getParameterValue() != null);
+                    assert(parentDeclaration.getParameterValue() != null);

-                if (parentDeclaration.getParameterValue() != childDeclaration.getParameterValue()) {
-                    childDeclaration.setParameterValue(parentDeclaration.getParameterValue());
+                    if (parentDeclaration.getParameterValue() != childDeclaration.getParameterValue()) {
+                        childDeclaration.setParameterValue(parentDeclaration.getParameterValue());

-                    logger.debug("in param " + childDeclaration.getName() +
-                            " set to " + childDeclaration.getParameterValue());
+                        logger.debug("in param " + childDeclaration.getName() +
+                                " set to " + childDeclaration.getParameterValue());
+                    }
                 }
             }
         }