Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A api
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • ironapi
  • api
  • Wiki
  • State

State · Changes

Page history
Update State authored Nov 09, 2021 by Andrea Pavlovic's avatar Andrea Pavlovic
Hide whitespace changes
Inline Side-by-side
State.md
View page @ 794bce1d
[[_TOC_]]
# Overview
For any instance, states and a corresponding a workflow may be defined. Using them it's possible to define who can do which action (transition) which which instance in which state.
E.g. a contract is entered by an employee, then has to be approved by a supervisor (and cannot be changed any longer at that point by the employee).
......@@ -8,4 +9,31 @@ To move an instance from one state to the other, a transition must be used. If a
A visualization of a workflow might look like this:
![core__project.svg](uploads/7718457dad2492faf0aa3d31d08198c1/core__project.svg)
\ No newline at end of file
![core__project.svg](uploads/7718457dad2492faf0aa3d31d08198c1/core__project.svg)
# instance_state
A entity will have an attribute "instance_state" and it's value is the id of the state the instance is in.
To get a full list of all states for an entity, query the system.state table with the id of the entity (can be found in the universe):
POST /data/system/state/query
```
{
"conds" : {"entity" : 156}
}
```
You may join instance_state on your base entity to get it's details or filter by it's name etc:
```
{
"attrs" : {"prefetch":"instance_state"}
}
```
```
{
"conds" : {"instance_state.name" : {"-ilike":"a%"}},
"attrs" : {"join":"instance_state"}
}
```
\ No newline at end of file
Clone repository
  • API
    • Available Endpoints
    • Changing Passwords
    • Form Input Types
    • Introduction
    • Logout
    • Plugins
    • Queries
    • Queries
      • Attributes
      • Context
      • Query Examples
      • Query Search Options
      • Referenced Instances
      • Saved Queries
    • Schema_Changes
    • Storing Files
View All Pages