[kepler-dev] Help on the "Is Present" actor

Edward A. Lee eal at eecs.berkeley.edu
Fri Mar 4 16:43:56 PST 2011


For the PN director, inputs are always present (or more precisely,
the actor blocks until they are). This is essential to preserve
determinacy. The IsPresent actor is meant to work with SR or
Continuous.

Edward


On 3/4/11 11:19 AM, jing wrote:
> Hi, devs:
>
> I am trying to develop a workflow which will use Database Query actor.
>
> I choose "array" as the input type of the Database Query actor. So the
> actor will output an array if it can get a result after running the
> given query. But it will output nothing (no token will be sent, i guess)
> if it can NOT get a result after running the given query.
>
> I try to differential these two scenarios. I think "Is Present" actor
> will be a good one. So I added the "Is Present" actor just after the
> Database Query actor and a Display actor to print out the result of the
> "Is Present" actor.
>
> I did two tests:
> 1. Sent a query which results the Database Query actor getting
> something. Then the Display showed "true" value. Things looked good.
> 2. Sent a query which results the Database Query actor getting nothing.
> Then nothing happened after finishing the execution. The Display wasn't
> opened at all. It seems the 'false" token from the "Is Present" actor
> wasn't sent to the Display.
>
> I looked the documentation of the "Is Present" and it says:
> The IsPresent actor outputs "true" or "false" depending on whether it
> has received a data token or not.
>
> This is exact what i want. I want it to output false when the actor
> doesn't receive a token from the Database Query actor. But it didn't.
> Did I miss anything?
>
> Any suggestion and comment will be highly appreciated. By the way, I am
> using the PN director.
>
> Thank you very much!
>
> Regards,
>
> Jing
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eal.vcf
Type: text/x-vcard
Size: 330 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20110304/be033a01/attachment.vcf>


More information about the Kepler-dev mailing list