[CONTROLLER-2068] Processing routed RPC - buy-car RPC Created: 20/Jan/23 Updated: 20/Jan/23 |
|
| Status: | Open |
| Project: | controller |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Medium |
| Reporter: | Šimon Ukuš | Assignee: | Robert Varga |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
This relates to CONTROLLER-2065. The process of modeling, implementing and using routed RPCs is documented here. The buy-car RPC declaration declares that its context-reference is person-context from module people@2014-08-18:
rpc buy-car {
description
"buy a new car";
input {
leaf person {
ext:context-reference "person:person-context";
type person:person-ref;
description "A reference to a particular person.";
}
leaf car-id {
type car:car-id;
description "identifier of car.";
}
leaf person-id {
type person:person-id;
description "identifier of person.";
}
}
}
So, when calling this RPC the body of the request could look like this
{
"input": {
"person": "/people:people/people:person[id=\"0\"]",
"car-id": "0",
"person-id": "0"
}
}
This is executed successfully with return status 204 No Content. As stated in the previously mentioned documentation on routed RPCs, there should be an implementation of an RPC for a particular context instance. It also states, that "If user invokes RPC with a context instance that has no registered implementation, the RPC invocation will fail with the exception DOMRpcImplementationNotAvailableException." This is rooted in the processing of a*routed RPC*, thus lets see how it works.
Summary of peculiarities:
|