Announcement Announcement Module
Collapse
No announcement yet.
What about a default action bean? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • What about a default action bean?

    Hi all,

    I was wondering if a default action bean would be a good idea. Something like this:

    Code:
    <flow start-state="authorize.subflow" bean="myDefaultActionBean">
        ....
        <action-state id="parse"> <!-- the bean above would be called here -->
        <transition on="success" to="browse.view"/>
        </action-state>
    
        <action-state id="anotherState"> <!-- and the usual declaration would override the default bean -->
        <action bean="anotherAction"/>
        <transition on="success" to="browse.view"/>
        </action-state>
    That would save some typing if you use the same bean for the entire flow. And would not break any previous implementation.

    Any comments?

    Thanks for your help.

    Mauricio
    ------------
    visit http://www.helianto.org !

  • #2
    Hi Mauricio,

    Originally posted by iserv
    I was wondering if a default action bean would be a good idea. Something like this:
    Code:
    <flow start-state="authorize.subflow" bean="myDefaultActionBean">
    ...
    Any comments?
    I agree that it's a good idea. Anything that saves unnecessary typing is a good thing.

    So I guess we can count this as 2 votes.

    Though I would suggest "default-action" instead of "bean" as the flow element's XML attribute.

    regards,

    Sam

    Comment


    • #3
      Going further

      Thanks for the support Sam,

      but it seems the idea did not come at the right time to capture more minds. But I would like to go a little bit further. If we can add an "include' element to the flow DTD, that would not only save typing but improve testing. Suppose you have a sort of template flow, like that:

      Code:
      <action-state id="parse'>
          <!-- action element not in place here due to proposed default-action functionality -->
          <transition on="success" to="list"/>
      </action-state>
      
      <action-state id="list'>
          <!-- action element not in place here due to proposed default-action functionality -->
          <transition on="success" to="browse"/>
      </action-state>
      that you can replace by (not an in-line subflow):

      Code:
      <include resource="classpath:/flows/parseTemplate.xml" />
      You might keep a collection of template flows already tested (with stub actions). In addition, you already have "var" and "global-transitions" to help with that.

      Sorry if I am going too far with this, but I would like to understand if itīs worth spending some time to achieve such goal.

      Mauricio

      Comment

      Working...
      X