[kepler-dev] Origin of incoming data in an Actor

Matt Jones jones at nceas.ucsb.edu
Sat Jul 17 13:46:07 PDT 2010


Tokens can be complex structures -- so, rather than using a String, use, for
example, a record token that contains your information flag, plus the string
or other data you want to operate on:

{flag="myInformation", data="myDataValue"}

Alternatively, you could use arrays and other compound data structures too.
 See the documentation on record tokens and arrays for details, which is
in the 'Data Types' section in the Kepler User Guide, available from the
Kepler 'Help' menu, or from the Kepler web site.

Matt

On Sat, Jul 17, 2010 at 12:02 PM, Ivens <ivensportugal at gmail.com> wrote:

> Hi Matt,
>
> I liked the idea of encoding information in tokens.
> But is there way to do that without altering the original information?
>
> avoiding:
>
> value = "myInformation" + value.toString();
>
> Thanks,
> Ivens
>
> On Sat, Jul 17, 2010 at 4:52 PM, Matt Jones <jones at nceas.ucsb.edu> wrote:
>
>> Hi Ivens,
>>
>> When you find a token on your input port, you can inspect its type.  There
>> is no additional information about where the token originated, as each actor
>> should be able to handle any data source that emits the proper types of
>> tokens.  You could, of course, encode data in the tokens that are output by
>> your upstream actors that you can use in your conditional logic within your
>> actor.
>>
>> Matt
>>
>> On Sat, Jul 17, 2010 at 9:46 AM, Ivens <ivensportugal at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am coding an Actor in Java/Eclipse.
>>> That actor will have 1 input multiport and 1 output multiport.
>>>
>>> The problem is:
>>> depending on the source of the data, i will take different action.
>>>
>>> is there a method that return anything related to the source actor of the
>>> data?
>>>
>>> Thanks in advance,
>>> Ivens
>>>
>>> _______________________________________________
>>> Kepler-dev mailing list
>>> Kepler-dev at kepler-project.org
>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20100717/099376bf/attachment.html>


More information about the Kepler-dev mailing list