Add the ability to copy ECA action result Map to the service result Map
----------------------------------------------------------------------- Key: OFBIZ-1237 URL: https://issues.apache.org/jira/browse/OFBIZ-1237 Project: OFBiz Issue Type: Improvement Components: framework Reporter: Adrian Crum Priority: Minor Attachments: ServiceEcaAction.patch The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1237: ------------------------------- Attachment: ServiceEcaAction.patch Attached patch adds a "result-to-result" attribute to the <action> element. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Priority: Minor > Attachments: ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526971 ] Anil K Patel commented on OFBIZ-1237: ------------------------------------- Tested, Works. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Priority: Minor > Attachments: ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1237: ------------------------------- Attachment: ServiceEcaAction.patch Patch updated to latest revision. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Priority: Minor > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David E. Jones reassigned OFBIZ-1237: ------------------------------------- Assignee: David E. Jones > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David E. Jones closed OFBIZ-1237. --------------------------------- Resolution: Fixed Fix Version/s: SVN trunk Thanks for getting this going Adrian. I applied your patch in SVN rev 579424, but with a few changes as described in the commit log: "Added result-to-result feature for seca rules, based on patch from Adrian Crum but changed to be more consistent with context-to-result, AND to only copy over values that are valid for the service that triggered the eca; Jira #OFBIZ-1237" > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
Sorry for the delay on this Adrian, it's now in SVN. I made some changes to pre-validate what gets copied to the main service result, and made it more consistent with context-to-result. Please let me know if that caused any problems with where you are using this (I know I could grab that other patch, but this issue seemed to be the blocker so I'm hitting it and I need to move on). -David Adrian Crum (JIRA) wrote: > [ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] > > Adrian Crum updated OFBIZ-1237: > ------------------------------- > > Attachment: ServiceEcaAction.patch > > Patch updated to latest revision. > >> Add the ability to copy ECA action result Map to the service result Map >> ----------------------------------------------------------------------- >> >> Key: OFBIZ-1237 >> URL: https://issues.apache.org/jira/browse/OFBIZ-1237 >> Project: OFBiz >> Issue Type: Improvement >> Components: framework >> Reporter: Adrian Crum >> Priority: Minor >> Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch >> >> >> The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. > |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum reopened OFBIZ-1237: -------------------------------- > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1237: ------------------------------- Attachment: ServiceEcaAction.patch David, Thank you very much for taking the time to work on this! When you moved the result.putAll(...) code block farther up, you broke the code below it that compares the contents of the actionResult Map to the result Map. The attached patch puts the code block back where I had it originally. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531098 ] David E. Jones commented on OFBIZ-1237: --------------------------------------- Adrian, that patch changes quite a bit more than that, and makes the general operation of result-to-result to be very different from context-to-result. For example, making it run only on success is not really a valid assumption and limits the usefulness of the result-to-result feature, because you could never cause a service call to fail, and that is rather handy. In the permission case maybe you want to restrict it more than the default, rather than open it up more. You mentioned "broke the code"... could you be more specific about what you are seeing happening with this in how you are trying to use it and why that doesn't work for you? Thanks for your patience and persistence... > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531107 ] Adrian Crum commented on OFBIZ-1237: ------------------------------------ David, What I meant by "broke the code" - In my original patch, the result-to-result copy was done after the (result != null && !success) code block (line 157). Your version does the copy before the code block. So... if the actionResult Map's contents have been copied to the service result Map - then the code block breaks - because both Maps contain the same thing. To be more specific: If line 133 is executed, then things like line 177 and line 186 won't work - because the source and destination objects are identical. I originally had it copy only on success because otherwise the results of lines 157 to 189 would be overwritten by the copy. I'll be first to admit that I'm a little over my head working on the service engine, and I'm myopic in these efforts (I'm trying to get the permission checking ECA thing to work). Not only do I appreciate your assistance, I really *need* it. This patch and the related patches I've contributed are tested and working on our production server - for whatever that's worth. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1237: ------------------------------- Attachment: ServiceEcaAction.patch Updated patch to latest SVN. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538397 ] David E. Jones commented on OFBIZ-1237: --------------------------------------- I reviewed this patch and you comments, and I'm a little confused so here they are one at a time: > To be more specific: If line 133 is executed, then things like line 177 and line 186 won't work - because the source and destination objects are identical. Do you mean the condition currently on line 179? As I see it the worst case scenario there is that the error message list is copied again. > I originally had it copy only on success because otherwise the results of lines 157 to 189 would be overwritten by the copy. By having it run before this other error handling that error handling code will copy over what happens before. ============================= In general I guess the real question is: are you having any problems with this in the security or permission code you are working on? If so let me know and I'll look into it and see if a better way of coding this up can help. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538543 ] Adrian Crum commented on OFBIZ-1237: ------------------------------------ David, Thank you for taking another look at this. I keep the patch updated because we use it here on our local copy. The recent Generics work threw off the line numbers from my original comment. Now we're looking at lines 136, 180, and 189. So, line 136 copies the ECA action result to the original service's result. Then in lines 180 and 189 we try to get the error messages from the original service. Oops, they are not there because we just copied over them. Maybe that's where the confusion is coming in. I'm trying to preserve the original behavior of concatanating the error messages even when result-to-result is set true. This is important in the permission service scenario - you want to see the list of ALL the permissions that failed - the original permission service PLUS the ECA action permission service. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538686 ] David E. Jones commented on OFBIZ-1237: --------------------------------------- In 589977 I changed the code so the order doesn't really matter much. The main thing I'm trying to avoid, that using your patch directly would cause, is so that this only runs on success. If we do a result-to-result it should probably copy everything, success or failure, just like result-to-context and such. It seems to be working, but of course feedback is always helpful. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538829 ] Adrian Crum commented on OFBIZ-1237: ------------------------------------ David, Thank you very much for working on this! When the patch from OFBIZ-1245 is applied to the latest revision, the permission service ECAs work perfectly! This issue can be closed. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David E. Jones closed OFBIZ-1237. --------------------------------- Resolution: Fixed That's great Adrian. Thanks for your patience. > Add the ability to copy ECA action result Map to the service result Map > ----------------------------------------------------------------------- > > Key: OFBIZ-1237 > URL: https://issues.apache.org/jira/browse/OFBIZ-1237 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Adrian Crum > Assignee: David E. Jones > Priority: Minor > Fix For: SVN trunk > > Attachments: ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch, ServiceEcaAction.patch > > > The service dispatcher uses the result Map from the initial service invoked and it ignores the result Map of any ECAs that are invoked. So, any values that an ECA service attempts to return are ignored. It would be preferable to have an action attribute that permits copying the action's result Map to the service's result Map. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |