Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in Each or For Methods #3

Open
mikestowe opened this issue Apr 5, 2017 · 2 comments
Open

Add in Each or For Methods #3

mikestowe opened this issue Apr 5, 2017 · 2 comments
Assignees

Comments

@mikestowe
Copy link
Owner

Allow Each or For to be an acceptable phrase for DoOn to allow for the ability to tackle multiple records/ batch transactions...

Perhaps something like:

"doOn" : "each $body.users.userId"

"doOn" : "each $body.users.userId && $body.users.isActive == true"

OR

"doOn" : "for $body.users.userId"

"doOn" : "for $body.users.userId && $body.users.isActive == true"

Concerns: how do we debug this or identify where an error occurs if it occurs in this cycle. Does a failed transaction cease all remaining links in the chain, or do they progress? While a huge benefit, this could also open a can of worms...

@mikestowe mikestowe self-assigned this Apr 5, 2017
@vrrobz
Copy link

vrrobz commented Apr 5, 2017

Maybe add an onError parameter that makes a separate call or errs out. By default, it just does nothing.

@mikestowe
Copy link
Owner Author

mikestowe commented Jun 8, 2017

Good call - you should be able to do that by nesting chains (being an array, it will run this as a subset following the link, but skip to the next link (outside of the nested array) if it isn't applicable:

{
    "doOn" : "always",
    "..." : "..."
},
    [
      {
        "doOn": "4** || 5**",
        "href": "$headers.link",
        "method": "get",
        "data": {},
        "return": [
            "email", "_links"
        ]
    }
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants