[This followup was posted to gmane.comp.java.keel.devel and a copy was sent to 
the cited author.]

Hi all,

this is my first contact with sequences and I think that there is a 
problem with transfering data from one model of a sequence to its next 
model.

This is a section of my system.xconf snippet:

<sequence id="testapp.sequence">
  <model name="testapp.first-step" clearParams="false"/>
  <model name="testapp.second-step" clearParams="false"/>
  <model name="testapp.show-result"/>
</sequence>

All models in this sequence except for the last one doesn't have any 
user interaction. During the execution of model "testapp.first-step" a 
POJO will be created. My goal is to transfer this POJO as a parameter to 
the model "testapp.second-step" where some calculation should take 
place. Finally the model "testapp.show-result" shall display the result 
of the calculation.

This is the execute method of model "testapp.first-step".

  req.setParameter("pojo", new MyPojo(SomeInitialParameters));
  return null;

And in model "testapp.second-step" I try this:

  MyPojo myPojo = (MyPojo) req.getParameter("pojo");
  // Do some calculation with myPojo and store the result
  req.setParameter("result", new MyResult(SomeInitialParameters));
  return null;

Finally the code of model "testapp.show-result":

  ModelResponse res = req.createResponse();
  MyResult result = (MyResult)req.getParameter("result");
  res.addOutput("Value 1", result.getValue1());
  //... more output added here
  return res;

The problem: although I set "clearParams" in the sequence configuration 
to "false" I'm not able to retrieve a MyPojo instance during the 
execution of "testapp.second-step" (return value: null).

What went wrong?

By the way: if I use the ModelRequest's context get- and put-methods 
instead of it's parameters everything is going to be alright. But I want 
to avoid using such a "global data storage" as a model's interface.

Thanks in advance
Joern

http://keelframework.org/documentation
Keelgroup mailing list
[EMAIL PROTECTED]
http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com

Reply via email to