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

Last edited by Andrea Pavlovic Nov 09, 2021
Page history

State

  • Overview
  • instance_state
  • available transitions

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).

To move an instance from one state to the other, a transition must be used. If and which state change a transitions will perform is visible in the definition of the transition in the universe - "preStateID" and "postStateID". These will be empty if no workflow/states are defined on an entity.

A visualization of a workflow might look like this:

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"}
}

available transitions

To find out, which transitions are allowed for the state (and user) the instance is in, use the Instance Transition List Endpoint.

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