Skip to content

setState

Description

Change l'état du dossier.

L'action peut s'utiliser de deux manières différentes:

  1. Changement explicite d'état: on invoque l'action en indiquant vers quel état le dossier doit aller
  2. Changement implicite d'état: on invoque l'action en indiquant quelle transition réaliser; l'état de destination est donc déterminé en fonction de l'état courant et de la transition appelée

Il se peut que seule l'une ou l'autre des manières soit possible. Cela dépend du modèle d'états associé au dossier.

Schéma

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "This json schema gives prototype of action setState",
    "title": "Action setState",
    "type": "object",
    "properties": {
        "action": {
            "const": "setState",
            "description": "Name of the action",
            "type": "string"
        },
        "params": {
            "oneOf": [
                {
                    "properties": {
                        "context": {
                            "description": "Context of group onto tuple must be added. Should reference a `modelName[docId]` context.",
                            "type": "string"
                        },
                        "modelName": {
                            "description": "Name of model",
                            "type": "string"
                        },
                        "docId": {
                            "description": "Document id",
                            "type": [
                                "integer",
                                "string"
                            ]
                        },
                        "state": {
                            "description": "Name of the new state of document",
                            "type": "string"
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "context",
                                "state"
                            ]
                        },
                        {
                            "required": [
                                "modelName",
                                "docId",
                                "state"
                            ]
                        }
                    ]
                },
                {
                    "properties": {
                        "context": {
                            "description": "Context of group onto tuple must be added. Should reference a `modelName[docId]` context.",
                            "type": "string"
                        },
                        "modelName": {
                            "description": "Name of model",
                            "type": "string"
                        },
                        "docId": {
                            "description": "Document id",
                            "type": [
                                "integer",
                                "string"
                            ]
                        },
                        "transition": {
                            "description": "Name of the transition to fire",
                            "type": "string"
                        }
                    },
                    "oneOf": [
                        {
                            "required": [
                                "context",
                                "transition"
                            ]
                        },
                        {
                            "required": [
                                "modelName",
                                "docId",
                                "transition"
                            ]
                        }
                    ]
                }
            ],
            "description": "Parameters of current action",
            "type": "object"
        }
    },
    "required": [
        "action",
        "params"
    ],
    "$id": "https://ewt.epilogic.ch/action.setstate.schema.json"
}