Hi Jean-Marie,

the reason why this happens is that RIFE dynamically uses the outputs at any given time. For example, when you generate an exit to go to a first element the output values can be different than the output values for another exit link. There are several other mechanics at work, like outjecting the getter values at outputs or propagating the value of outputs that are really global vars to the other elements in the same request. As such, RIFE thus uses your getter as the provider of the output state (just as bean properties do) and invokes it when needed. Maybe there could be some optimizations performed to reduce these calls a bit at the end of the element processing, but you should never rely on an assumption that a getter can only be called once.

However, using you example, it behaves exactly as you describe: when you send the increase submission in the second element it doesn't execute the first one anymore and just stays at the second step, without reinitializing the value. I used this template for second.html:

<p><r:v name="count"/></p>
<form name="increase" action="${v SUBMISSION:FORM:increase/}" method="post">
        <r:v name="SUBMISSION:PARAMS:increase"/>
        <input type="text" name="increment" />
        <input type="submit" value="Login" />
</form>

Hope this helps.

Geert


On 12 Jan 2007, at 13:08, Jean-Marie Galliot wrote:

Could you explain why getCounter() is called three times?

Also, what I am trying to do is having this element Start initializing and
transmitting a value to element Second.
For the time being it'a a simple integer but it will be eventually a bean.

Then, the subsequent requests will be processed by element Second. At each request, the value originally initialized by the element Start will evolve, so It will use a datalink from element Second to itself to keep the state
like you suggested in the example : statefull components.

But the problem is :

Apparently, each time the element Second is processed (and not only the first time) the method getCounter of element Start is called and the value
is set into element Second.

I can understand why but how can we accomplish this simple behavior :

Element second is initialized with a value from Element Start. But after
that, the value is modified iteratively in element Second by the very
process of subsequent requests, without the value being reinitialized each
time by the element Start?

I can imagine two datalinks with two distincts variables. Then element
Second has to decide that the second variable (the one coming from himself)
has precedence over the one coming from element Start. But it looks
unnatural.

Can you help?

Tks
--
View this message in context: http://www.nabble.com/Datalink- semantics-tf2965628.html#a8297299
Sent from the RIFE - users mailing list archive at Nabble.com.

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to