I'm sick of having to edit the site xml to add a new exit, then a flowlink for it. I think exiting should be as simple as a method call, and exits should not be to an element by its id, but to a class by its FQN.

I wonder what others on this list think of the idea.

I think RIFE should use bytecode transformation to allow a simple method call to exit from one element to another.

class First extends Element {
  void processElement() {
    if (hasSubmission(..)) { .. do some form stuff }
    String someFormValue = ...;
    new Second().jump(someFormValue);
  }
}

class Second extends Element {
  String something;

  @Entry void jump(String thatValue) {
    something = thatValue;
  }

  void processElement() {
    print(something);
  }
}

I think this would be great. RIFE bytecode manipulation could make it so the jump() call actually exited after jump returned. Such behavior would happen for any call of a method labelled @Entry.

This could even be elegant for producing URL's, like:

Second second = new Second().jump("something");
t.setValue("user_url", second.getUrl());

For this to work, maybe jump() should not be bytecode-modified to halt execution, but instead to set a flag within RIFE engine to tell it to exit, once processElement returns.

Another idea could be to not use bytecode manipulation at all, but instead change "exit" method to accept any instance of Element.

What does everyone think of this?
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users

Reply via email to