Results 1 to 9 of 9

Thread: I need to select FlowFactoryBean with portlet preference...

  1. #1
    Join Date
    Sep 2004
    Posts
    346

    Default I need to select FlowFactoryBean with portlet preference...

    I need to select FlowFactoryBean with portlet preference... Is that possible.

    The reason I want do this for a portlet application that runs different flows dependent on the preference setting to avoid creating multiple portlets with all the redundant config. I just want one portlet that does different but similar things depending on the selected preference. I intend for these preferences to be read only but of course I could change that as per the portlet spec...

    If it's not currently possible then please point me in the path that I can address that functionality.

  2. #2
    Join Date
    Sep 2004
    Posts
    346

    Default I don't think this will work...

    I don't think this will work... Since I think these objects will be singletons...

    So I guess this would have to be done at portlet initialization though
    init-param

    But I don't want to have to do the same thing over and over again in xml specified by contextConfigLocation. So what I need is a way to not have to do that...

    A suggestion would be appreciated...

  3. #3
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    So if I understand this correctly, you want to configure your portlet with the id of the flow it should use? I would say: just configure all your flows as in a normal case in the application context. Then have a custom PortletFlowController that looks at the config info to determine what flow to run.

    Note that the fact that the flow definitions (created by the FlowFactoryBean) are singletons is of little importance. The flow definition is just a static object that can be shared by any numer of threads. The runtime information will be held in a FlowExecution/RequestContext!

    Erwin

  4. #4
    Join Date
    Sep 2004
    Posts
    346

    Default I still think singletons are an issue.

    PorletFlowControllers use flowExecutionManager to execute the flow. These are also singletons and are assigned to a flow right?

  5. #5
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    The FlowExecutionManagers are singletons, because they are 'owned' by the singleton controllers (e.g. PortletFlowController).

    I'm not sure what you mean with "are assigned to a flow right". The FlowExecutionManager starts and manages a FlowExecution for a Flow, it is not "assigned" to any particular flow, so a single FlowExecutionManager could be managing several FlowExecutions concurrently.

    Erwin

  6. #6
    Join Date
    Sep 2004
    Posts
    346

    Default Well in code..

    Well in PortletFlowController code I see:

    public void setFlow(Flow flow) {
    this.flowExecutionManager.setFlow(flow);
    }

    so the flow is assigned the the flowExecutionManager assigned to the PortletFlowController.

    and in FlowExecutionManager there is only one flow member variable so I don't see what you mean by a flow execution manager having multiple flows... Please explain...

  7. #7
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    The flow set by FlowExecutionManager.setFlow() is the "default top-level" flow. From the JavaDoc:

    public void setFlow(Flow flow)
    Set the flow whose executions will be managed if there is no alternate flow id specified in a "_flowId" event parameter.
    The FlowExecutionManager doesn't keep track of a particular flow execution, so it is perfectly capable of managing several different flow executions, for different flows, concurrently.

    Erwin

  8. #8
    Join Date
    Sep 2004
    Posts
    346

    Default Ok... Finally I understand... But...

    Ok... Finally I understand... But I can't find a way to pass _flowId as a request parameter through custom PortletFlowController.. Can you help? request doesn't have any methods to allow you to set parameters... And that's the only way it seems to set flow... Seems like workflow code would need to change to look for _flowId in either request attributes or params...

  9. #9
    Join Date
    Sep 2004
    Posts
    346

    Default Re: Ok... Finally I understand... But...

    Quote Originally Posted by garpinc2
    Ok... Finally I understand... But I can't find a way to pass _flowId as a request parameter through custom PortletFlowController.. Can you help? request doesn't have any methods to allow you to set parameters... And that's the only way it seems to set flow... Seems like workflow code would need to change to look for _flowId in either request attributes or params...
    I opened JIRA on this issue:

    http://opensource.atlassian.com/proj...rowse/SPR-1079

Similar Threads

  1. Replies: 37
    Last Post: Aug 10th, 2009, 03:35 PM
  2. hibernate pagination
    By oliverchua in forum Data
    Replies: 8
    Last Post: Sep 23rd, 2005, 06:06 PM
  3. Replies: 2
    Last Post: Aug 26th, 2005, 12:54 AM
  4. bind problems: list, select
    By pir8ped in forum Web
    Replies: 2
    Last Post: Jun 28th, 2005, 12:51 AM
  5. Portlet Form Controllers
    By johnalewis in forum Web
    Replies: 4
    Last Post: Mar 11th, 2005, 10:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •