Created
October 26, 2013 22:42
-
-
Save mamund/7175429 to your computer and use it in GitHub Desktop.
Example of expressing "workflow" (non-CRUD) operations in Cj. Note the first ITEM has one possible "workflow" link (approve") while the second ITEM has three possible "workflow" links (upgrade, downgrade, cancellation).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"collection" : | |
{ | |
"version" : "1.0", | |
"href" : "...", | |
"links" : | |
[ | |
{"rel" : "home", "href" : "..."}, | |
{"rel" : "profile", "href" : "..."} | |
], | |
"items" : | |
[ | |
{ | |
"href" : "...", | |
"data" : | |
[ | |
{"name" : "givenName", "value" : "Rus"}, | |
{"name" : "familyName", "value" : "Data"}, | |
{"name" : "email", "value" : "[email protected]"}, | |
{"name" : "status", "value" : "pending"} | |
], | |
"links" : | |
[ | |
{"rel" : "http://example.org/rels/approve", "href" : "...", "prompt" : "Start credit approval process"} | |
] | |
}, | |
{ | |
"href" : "...", | |
"data" : | |
[ | |
{"name" : "givenName", "value" : "Sam"}, | |
{"name" : "familyName", "value" : "Iam"}, | |
{"name" : "email", "value" : "[email protected]"}, | |
{"name" : "status", "value" : "approved"} | |
], | |
"links" : | |
[ | |
{"rel" : "http://example.org/rels/upgrade", "href" : "...", "prompt" : "Start credit upgrade process"}, | |
{"rel" : "http://example.org/rels/downgrade", "href" : "...", "prompt" : "Start credit downgrade process"}, | |
{"rel" : "http://example.org/rels/cancellation", "href" : "...", "prompt" : "Start credit cancellation process"} | |
] | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment