[kepler-dev] question about getting the Manager responsible for executing a workflow

Karen L Schuchardt Karen.Schuchardt at pnl.gov
Tue Mar 27 13:36:18 PDT 2007


Hi all,

I have a class that implements ExecutionListener.  My class also 
implements AbstractSettableAttribute and is an object within a 
workflow.  I would like it to get access to the Manager responsible for 
executing the workflow so it can call addExecutionListener and take 
action as events occur.

In an earlier version of Kepler, I was able to "hack" the validate() 
method of my class (subclass of AbstractSettableAttribtue) to add all 
the listeners there.  However this method no longer seems to be called 
at prerun time.  If I try to do it in the constructor of my object, the 
Manager is null.  That is:
CompositeActor topLevel = (CompositeActor)getContainer();
System.out.println("CONT: " + topLevel);
Manager manager = topLevel.getManager();
System.out.println("MAN: " + manager);
will result in null being printed for the manager.

What is the proper way to get a hold of the Manager so that I can become 
a listener before the workflow I'm part of  executes?  Or should I be 
thinking of doing this in a different way?  Suggestions welcome.
I tried to look at examples of other classes that call 
addExecutionListener but these all seem to be applications that have 
access to more information.

Thanks,
Karen


More information about the Kepler-dev mailing list