You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/09/15 12:28:00 UTC

[jira] [Commented] (OFBIZ-12317) Groovy DSL add success(Map) method

    [ https://issues.apache.org/jira/browse/OFBIZ-12317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17415483#comment-17415483 ] 

ASF subversion and git services commented on OFBIZ-12317:
---------------------------------------------------------

Commit 5bd3ccfa40b1d26ba4858fc4ed40a79f78bcb888 in ofbiz-framework's branch refs/heads/trunk from Nicolas Malin
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=5bd3ccf ]

Improved: Groovy DSL add success(Map) method (OFBIZ-12317)

Improve the groovy dsl with a success method that return directly all fields

    Previously we used:
        Map result = success()
        result.myId = myId
        return result

    Now we can write:
        return success(myId: myId)

Or

    Previously we used:
        Map result = success('Wonderful !')
        result.myId = myId
        return result

    Now we can write:
        return success('Wonderful !', myId: myId)


> Groovy DSL add success(Map) method
> ----------------------------------
>
>                 Key: OFBIZ-12317
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12317
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Nicolas Malin
>            Priority: Major
>              Labels: DSL, groovy
>         Attachments: OFBIZ-12317.patch
>
>
> Currently when you realized a return success on groovy you can write it with or without a message like :
> {code:java}
> return success(){code}
> or
> {code:java}
> return success('Wonderfull ! '){code}
> But if you need return some values you need to follow this pattern
> {code:java}
> Map result = success()
> result.myId = myId
> return result{code}
> I proposed to extend sur groovy dsl to write directly
> {code:java}
> return success(myId: myId){code}
> or
> {code:java}
> return success('Wonderfull ! ', myId: myId){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)