To correctly get the instances which are available for an attribute of a transition which is a reference, the query context must be defined.
Example: to find out which entites (attribute "entity") a user may set as the base entity for a new saved query (transition "add" on "extensions.query"), this will find the answer:
POST #/data/system/entity/query
{
"context": {
"module" : "extensions",
"entity" : "query",
"transition" : "add",
"attribute" : "entity"
}
}
If, in this list, the instance with id 5 is listed, this will be a valid request:
POST /data/extensions/query/transitions/add
{
"entity" : 5,
#other parameters
}
This is necessary because
- depending on the workflow, some references may not be available
- the user may not have access to all references
Remember that this is just one of the options a query takes, it can still be combined with all the others (page, conds, attrs etc).
{
"context": {
"module": "core",
"entity": "unit",
"transition": "site_admin_create",
"attribute": "parent"
},
"conds": {
"name": {
"-like": "S%"
}
}
}