[ 
https://issues.apache.org/struts/browse/WW-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]


    Status: Resolved  (was: Closed)

> Chaining not depend on just the previous action
> -----------------------------------------------
>
>                 Key: WW-56
>                 URL: https://issues.apache.org/struts/browse/WW-56
>             Project: Struts 2
>          Issue Type: New Feature
>    Affects Versions: WW 1.2
>            Reporter: Patrick Lightbody
>            Assignee: Matt Baldree
>            Priority: Minor
>             Fix For: WW 1.3
>
>
> It would be nice if chaining didn't depend on only the previous action. 
> Specifically, I'd like for a way to place an action in the chain that didn't 
> have common setters/getters of the actions before and after in the chain, but 
> still not break the chain. Here's an example:
> EditMetadata.action=MetadataValidator
> EditMetadata.error=edit.jsp
> EditMetadata.input=edit.jsp
> EditMetadata.success=EditMetadataBeginTx.action
> EditMetadataStartTx.action=transaction.BeginTx
> EditMetadataStartTx.success=EditMetadataSave.action
> EditMetadataSave.action=DocumentStorer
> EditMetadataSave.success=EditMetadataSaveCommitTx.action
> EditMetadataSave.error=EditMetadataSaveRollbackTx.action
> EditMetadataSaveCommitTx.action=transaction.CommitTx
> EditMetadataSaveCommitTx.success=Details.action
> EditMetadataSaveRollbackTx.action=transaction.RollbackTx
> EditMetadataSaveRollbackTx.success=edit.jsp
> Now MetadataValidator, Details, and DocumentStorer all have a common 
> superclass so chaining is simple. But in order to make my TX utility actions 
> to work in this chain (as chaining is now) these TX classes need to have all 
> (or some) of the same bean attributes. What I'd like is for some way to have 
> the action get executed by then when the chain goes from BeginTx -> 
> DocumentStorer, the setters in DocumentStorer somehow pick up the old getters 
> in MetadataValidator.
> Some of this may actually work already since the request is applied each time 
> to a new action in the chain, and as long as there is no dependency on the 
> attributes having been changed by previous actions in the chain, all is well. 
> But I feel that is a bit hokey and is prone to break when not paying 
> attention. One idea I had was to keep a list of the actions in the chain and 
> continuely apply their attributes to each new action in the chain.
> So if the chain is 10 actions long, there BeanUtils would copy the attributes 
> 46 times instead of 10 times (1+2+3+...+10). Behavior wouldn't change since 
> the attribute most recent in the chain would be the last to be applied?
> I think action chaining in WebWork could be a very, VERY powerful feature if 
> implemented properly. I'd like to see chaining work outside the 
> ServletDispatcher so that Mike could take advantage of chaining in JIRA if he 
> wanted to, or that I could test chained actions in my unit tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to