Something's fishy here.
Such a model should work fine in PN.
Note that hasToken() _alaways_ returns true in PN.
The get() method blocks when there is no input.

Looks like something is terminating the threads
using a TerminateProcessException. How is your model
supposed to be stopped?

Edward


On 6/21/11 1:18 AM, Vincenzo Forchi wrote:
Hi All,

I have a problem with the PN director on kepler 2.2. I have a simple
workflow: string constant -> file reader -> custom actor.
The string constant fires only once, but my acotr is triggered twice,
and the second times it fails because there is no token on the input
port. I defined the token consumption rate for the input port, I have
overridden prefire to return true only if a token is present on the
input port, but the actor is still fired twice.

This is a snippet from my fire method:

System.out.println(myPort.hasToken(0));
String xml = ((StringToken) myPort.get(0)).stringValue();

This is the command line output, I caught the exception and printed the
stack trace

[run] true
[run] ERROR (org.kepler.gui.MenuMapper:getActionFor:269) Exception
trying to create an Action for classname:
<org.kepler.gui.RunWithFeedbackChkBoxAction>:
[run] java.lang.IllegalArgumentException: RunWithFeedbackChkBoxAction
constructor could not get actions for DEBUG->ANIMATE EXECUTION or
DEBUG->STOP ANIMATING (java.lang.reflect.InvocationTargetException)
[run] ERROR (org.kepler.gui.MenuMapper:getActionFor:269) Exception
trying to create an Action for classname:
<org.kepler.gui.RunWithFeedbackChkBoxAction>:
[run] java.lang.IllegalArgumentException: RunWithFeedbackChkBoxAction
constructor could not get actions for DEBUG->ANIMATE EXECUTION or
DEBUG->STOP ANIMATING (java.lang.reflect.InvocationTargetException)
[run] ptolemy.actor.process.TerminateProcessException:
[run] at
ptolemy.domains.pn.kernel.PNQueueReceiver.get(PNQueueReceiver.java:198)
[run] at ptolemy.actor.IOPort.get(IOPort.java:885)
[run] at MyClass.fire(MyClass.java:119)
[run] at ptolemy.actor.process.ProcessThread.run(ProcessThread.java:229)

The very same code works flawlessly with the DDF director: any ideas?

Thanks and cheers,
Vincenzo

<<attachment: eal.vcf>>

_______________________________________________
Kepler-users mailing list
[email protected]
http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users

Reply via email to