# Liste de commandes

## `login`

La commande `login` vous permet d'ajouter vos informations d'identification WorkflowGen pour autoriser l'interface de ligne de commande (CLI). La CLI supporte l'authentification de base et l'authentification OpenID Connect.

#### Authentification de base ou intégrée

```
wfg login [WORKFLOWGEN_URL] -u [WORKFLOWGEN_USERNAME] -p [WORKFLOWGEN_PASSWORD] --password-file [PASSWORD_PATH] -c [CONTEXT_NAME]
```

{% hint style="info" %}
L'authentification de base ou intégrée est disponible depuis la version 7.0.0 de WorkflowGen.
{% endhint %}

**Authentification Auth0**

```
wfg login [WORKFLOWGEN_URL] --authentication-mode AUTH0 --domain [DOMAIN] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
L'authentification Auth0 est disponible depuis la version 7.11.0 de WorkflowGen.
{% endhint %}

**Authentification MSIDV2 (Microsoft Identity Platform v2)**

```
wfg login [WORKFLOWGEN_URL] --authentication-mode MSIDV2 --tenant-id [TENANT_ID] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
L'authentification MSIDV2 est disponible depuis la version 7.16.0 de WorkflowGen.
{% endhint %}

{% hint style="warning" %}
Pour le mode **MSIDV2**, vous devez préalablement avoir enregistré une nouvelle application dédiée (`application côté serveur`) dans votre Azure Active Directory et sur votre serveur WorkflowGen en suivant les directives tel qu'indiquées dans le chapitre [Configuration d'Azure Active Directory pour les scripts côté serveur](https://docs.advantys.com/workflowgen-pour-azure/configuration-dazure-active-directory-pour-les-scripts-cote-serveur).\
\
Toutes les opérations invoquées à partir de la CLI WorkflowGen utiliseront donc le compte de l'utilisateur spécifié dans le champ `Nom d’utilisateur d'impersonnification` de l'application `Client Non Interactif` associée à la CLI WorkflowGen dans WorkflowGen.&#x20;
{% endhint %}

**Authentification Okta**

```
wfg login [WORKFLOWGEN_URL] --authentication-mode OKTA --metadata-url [METADATA_URL] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
L'authentification Okta est disponible depuis la version 7.13.0 de WorkflowGen.
{% endhint %}

**Authentification AD FS**

```
wfg login [WORKFLOWGEN_URL] --authentication-mode ADFS --domain [DOMAIN] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
L'authentification AD FS est disponible depuis la version 7.11.0 de WorkflowGen.
{% endhint %}

#### Arguments

| **Nom** | **Type** | **Description** | **Comportement** |
| ------- | -------- | --------------- | ---------------- |
| `url`   | Chaîne   | URL WorkflowGen | Requis           |

#### Options

| **Alias**               | **Type** | **Description**                                                                                  | **Valeur par défaut**                      | **Comportement** |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------ | ---------------- |
| `--username` ou `-u`    | Chaîne   | Nom d'utilisateur WorkflowGen                                                                    | Aucune                                     | Requis           |
| `--password` ou `-p`    | Chaîne   | Mot de passe WorkflowGen                                                                         | Aucune                                     | Facultatif       |
| `-- password-file`      | Chaîne   | Chemin du fichier contenant le mot de passe WorkflowGen                                          | Aucune                                     | Facultatif       |
| `--webforms` ou `-w`    | Chaîne   | Chemin des formulaires Web                                                                       | `C:\inetpub\wwwroot\wfgen\wfapps\webforms` | Facultatif       |
| `--context` ou `-c`     | Chaîne   | Nom du contexte                                                                                  | `DEFAULT`                                  | Facultatif       |
| `--authentication-mode` | Chaîne   | Mode d'authentification (`BASIC`, `AUTH0`, `MSIDV2`, `ADFS`, `OKTA`)                             | `BASIC`                                    | Facultatif       |
| `--client-id`           | Chaîne   | L'identifiant public du client                                                                   | Aucune                                     | Facultatif       |
| `--domain`              | Chaîne   | Le domaine pour `ADFS` ou `AUTH0`                                                                | Aucune                                     | Facultatif       |
| `--tenant-id`           | Chaîne   | L'ID de locataire pour `MSIDV2`                                                                  | Aucune                                     | Facultatif       |
| `--metadata-url`        | Chaîne   | L'URL de métadonnées pour `OKTA`                                                                 | Aucune                                     | Facultatif       |
| `--client-secret`       | Chaîne   | Donnée seulement connue de l’application et du serveur d’autorisation                            | Aucune                                     | Facultatif       |
| `--client-secret-file`  | Chaîne   | Fichier contenant le secret client seulement connu de l’application et du serveur d’autorisation | Aucune                                     | Facultatif       |
| `--port`                | Chaîne   | Le port de WorkflowGen                                                                           | Aucune                                     | Facultatif       |

#### 📌 **Exemples de login de base**

```
wfg login http://localhost/wfgen -u wfgen_admin -p myPassword
```

```
wfg login http://localhost/wfgen -u wfgen_admin --password-file ./path/to/password.txt
```

#### 📌 **Exemples de login Auth0**

```
wfg login http://localhost/wfgen --authentication-mode AUTH0 --domain myDomain.auth0.com --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode AUTH0 --domain myDomain.auth0.com --client-id myClientId --client-secret myClientSecret
```

#### 📌 **Exemples de login MSIDV2**

```
wfg login http://localhost/wfgen --authentication-mode MSIDV2 --tenant-id myTenantId --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode MSIDV2 --tenant-id myTenantId --client-id myClientId --client-secret myClientSecret
```

#### 📌 **Exemples de login Okta**

```
wfg login http://localhost/wfgen --authentication-mode OKTA --metadata-url https://MyOktaDomain/.well-known/openid-configuration --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode OKTA --metadata-url https://MyOktaDomain/.well-known/openid-configuration --client-id myClientId --client-secret myClientSecret
```

#### 📌 **Exemples de login AD FS**

```
wfg login http://localhost/wfgen --authentication-mode ADFS --domain myAdfsDomain --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode ADFS --domain myAdfsDomain --client-id myClientId --client-secret myClientSecret
```

## `config`

La commande `config` vous permet de configurer la CLI.

{% hint style="info" %}
Disponible depuis la version 7.0.0 de WorkflowGen.
{% endhint %}

### `current-context`

Affiche le contexte actuel.

#### **Utilisation**

```
wfg config current-context
```

### `delete-context`

Supprime le contexte spécifié de la configuration.

#### **Utilisation**

```
wfg config delete-context [CONTEXT_NAME]
```

{% hint style="info" %}
`[CONTEXT_NAME]` représente le nom donné au contexte CLI qui contient vos informations de serveur et d'utilisateur.
{% endhint %}

#### **Argument**

| **Nom** | **Type** | **Description**             | **Comportement** |
| ------- | -------- | --------------------------- | ---------------- |
| `name`  | Chaîne   | Nom du contexte à supprimer | Requis           |

#### 📌 Exemple

```
wfg config delete-context WFGEN_PROD
```

### `delete-server`

Supprime le serveur spécifié de la configuration.

#### **Utilisation**

```
wfg config delete-server [SERVER_NAME] --force
```

#### **Argument**

| **Nom** | **Type** | **Description**            | **Comportement** |
| ------- | -------- | -------------------------- | ---------------- |
| `name`  | Chaîne   | Nom du serveur à supprimer | Requis           |

#### **Option**

| **Alias**         | **Type** | **Description**                                                    | **Valeur par défaut** | **Comportement** |
| ----------------- | -------- | ------------------------------------------------------------------ | --------------------- | ---------------- |
| `--force` ou `-f` | Booléen  | Force la suppression du serveur et supprime les contextes associés | `false`               | Facultatif       |

#### 📌 Exemple

```
wfg config delete-server WFGEN_PROD_SERVER --force
```

### `delete-user`

Supprime l'utilisateur spécifié de la configuration.

#### **Utilisation**

```
wfg config delete-user [NAME] --force
```

#### **Argument**

| **Nom** | **Type** | **Description**                  | **Comportement** |
| ------- | -------- | -------------------------------- | ---------------- |
| `name`  | Chaîne   | Nom de l'utilisateur à supprimer | Requis           |

#### **Option**

| **Alias**         | **Type** | **Description**                                                          | **Valeur par défaut** | **Comportement** |
| ----------------- | -------- | ------------------------------------------------------------------------ | --------------------- | ---------------- |
| `--force` ou `-f` | Booléen  | Force la suppression de l'utilisateur et supprime les contextes associés | `false`               | Facultatif       |

#### 📌 Exemple

```
wfg config delete-user ADMIN_PROD_ACCOUNT --force
```

### `get-contexts`

Décrit un ou plusieurs contextes.

#### Utilisation

```
wfg config get-contexts [CONTEXT_NAME1] [CONTEXT_NAME2] [CONTEXT_NAME3]
```

{% hint style="info" %}
`[CONTEXT_NAME]` représente le nom donné au contexte CLI qui contient vos informations de serveur et d'utilisateur.
{% endhint %}

#### **Argument**

| **Nom** | **Type** | **Description**                        | **Comportement** |
| ------- | -------- | -------------------------------------- | ---------------- |
| `names` | Chaîne   | Nom(s) du ou des contexte(s) à obtenir | Facultatif       |

#### 📌 Exemple

```
wfg config get-contexts WFGEN_PROD
```

### `get-servers`

Affiche les serveurs définis dans la configuration.

#### **Utilisation**

```
wfg config get-servers
```

### `get-users`

Affiche les utilisateurs définis dans la configuration.

#### **Utilisation**

```
wfg config get-users
```

### `rename-context`

Renomme un contexte dans la configuration.

#### **Utilisation**

```
wfg config rename-context [CONTEXT_OLD_NAME] [CONTEXT_NEW_NAME]
```

{% hint style="info" %}
`[CONTEXT_NAME]` représente le nom donné au contexte CLI qui contient vos informations de serveur et d'utilisateur.
{% endhint %}

#### **Arguments**

| **Nom**    | **Type** | **Description**            | **Comportement** |
| ---------- | -------- | -------------------------- | ---------------- |
| `old-name` | Chaîne   | Nom du contexte à renommer | Requis           |
| `new-name` | Chaîne   | Nouveau nom du contexte    | Requis           |

#### 📌 Exemple

```
wfg config rename-context WFGEN_PROD WFGEN_DEV
```

### `rename-server`

Renomme un serveur dans la configuration.

#### **Utilisation**

```
wfg config rename-server [SERVER_OLD_NAME] [SERVER_NEW_NAME]
```

#### **Arguments**

| **Nom**    | **Type** | **Description**           | **Comportement** |
| ---------- | -------- | ------------------------- | ---------------- |
| `old-name` | Chaîne   | Nom du serveur à renommer | Requis           |
| `new-name` | Chaîne   | Nouveau nom du serveur    | Requis           |

#### 📌 Exemple

```
wfg config rename-server WFGEN_PROD_SERVER WFGEN_DEV_SERVER
```

### `rename-user`

Renomme un utilisateur dans la configuration.

#### **Utilisation**

```
wfg config rename-user [USER_OLD_NAME] [USER_NEW_NAME]
```

#### **Arguments**

| **Nom**         | **Type** | **Description**              | **Comportement** |
| --------------- | -------- | ---------------------------- | ---------------- |
| `USER_OLD_NAME` | Chaîne   | Nom d'utilisateur à renommer | Requis           |
| `USER_NEW_NAME` | Chaîne   | Nouveau nom d'utilisateur    | Requis           |

#### 📌 Exemple

```
wfg config rename-user ADMIN_PROD_ACCOUNT ADMIN_DEV_ACCOUNT
```

### `set-context`

Définit une entrée de contexte dans la configuration.

#### **Utilisation**

```
wfg config set-context [CONTEXT_NAME] --server [SERVER_NAME] --user [USER_NAME]
```

{% hint style="info" %}
`[CONTEXT_NAME]` représente le nom donné au contexte CLI qui contient vos informations de serveur et d'utilisateur.
{% endhint %}

#### **Argument**

| **Nom** | **Type** | **Description** | **Comportement** |
| ------- | -------- | --------------- | ---------------- |
| `name`  | Chaîne   | Nom du contexte | Requis           |

#### **Options**

| **Alias**          | **Type** | **Description**   | **Valeur par défaut** | **Comportement** |
| ------------------ | -------- | ----------------- | --------------------- | ---------------- |
| `--server` ou `-s` | Chaîne   | Nom du serveur    | Aucune                | Requis           |
| `--user` ou `-u`   | Chaîne   | Nom d'utilisateur | Aucune                | Requis           |

#### 📌 Exemple

```
wfg config set-context WFGEN_PROD --server WFGEN_PROD_SERVER --user ADMIN_PROD_ACCOUNT
```

### `set-server`

Définit une entrée de serveur dans la configuration.

#### Utilisation

```
wfg config set-server [SERVER_NAME] --url [URL] --version [SERVER_VERSION]
```

#### **Argument**

| **Nom** | **Type** | **Description** | **Comportement** |
| ------- | -------- | --------------- | ---------------- |
| `name`  | Chaîne   | Nom du serveur  | Requis           |

#### **Options**

| **Alias**            | **Type** | **Description**                        | **Valeur par défaut** | **Comportement** |
| -------------------- | -------- | -------------------------------------- | --------------------- | ---------------- |
| `--url` ou `-u`      | Chaîne   | URL WorkflowGen                        | Aucune                | Facultatif       |
| `--webforms` ou `-w` | Chaîne   | Chemin des formulaires Web WorkflowGen | Aucune                | Facultatif       |
| `--version` ou `-v`  | Chaîne   | Version de WorkflowGen                 | Aucune                | Facultatif       |

#### 📌 Exemple

```
wfg config set-server WFGEN_PROD_SERVER --url http://localhost/wfgen/admin --version 7.22.0
```

### `set-user`

Définit une entrée utilisateur dans la configuration.

#### Utilisation

```
wfg config set-user [USER_NAME] --username [USER_USERNAME] --password [USER_PASSWORD]
```

#### **Argument**

| **Nom** | **Type** | **Description**   | **Comportement** |
| ------- | -------- | ----------------- | ---------------- |
| `name`  | Chaîne   | Nom d'utilisateur | Requis           |

#### **Options**

| **Alias**            | **Type** | **Description**               | **Valeur par défaut** | **Comportement** |
| -------------------- | -------- | ----------------------------- | --------------------- | ---------------- |
| `--username` ou `-u` | Chaîne   | Nom d'utilisateur WorkflowGen | Aucune                | Requis           |
| `--password` ou `-w` | Chaîne   | Mot de passe WorkflowGen      | Aucune                | Requis           |

#### 📌 Exemple

```
wfg config set-user ADMIN_PROD_ACCOUNT --username wfgen_admin --password QWRtaW4xMjMh
```

### `use-context`

Définit le contexte actuel dans la configuration.

#### Utilisation

```
wfg config use-context [CONTEXT_NAME]
```

{% hint style="info" %}
`[CONTEXT_NAME]` représente le nom donné au contexte CLI qui contient vos informations de serveur et d'utilisateur.
{% endhint %}

#### **Argument**

| **Nom** | **Type** | **Description** | **Comportement** |
| ------- | -------- | --------------- | ---------------- |
| `name`  | Chaîne   | Nom du contexte | Requis           |

#### 📌 Exemple

```
wfg config use-context WFGEN_PROD
```

## `project`

La commande `project` vous permet d'exporter ou d'importer un projet WorkflowGen entier à partir d'un manifeste.

{% hint style="info" %}
Disponible depuis la version 7.17.0 de WorkflowGen.
{% endhint %}

### `init`

La commande `init` vous permet de générer un fichier `manifest.json` de manière interactive.

#### Utilisation

```
wfg project init --path projectPath
```

#### Options

| **Alias**         | **Type** | **Description**                                            | **Valeur par défaut** | **Comportement** |
| ----------------- | -------- | ---------------------------------------------------------- | --------------------- | ---------------- |
| `--path` ou `-p`  | Chaîne   | Chemin du répertoire où le projet sera initialisé          | Répertoire actuel     | Facultatif       |
| `--bare`          | Booléen  | Générer un fichier `manifest.json` avec le contenu minimal | `false`               | Facultatif       |
| `--force` ou `-f` | Booléen  | Forcer la génération du `manifest.json`                    | `false`               | Facultatif       |

#### 📌 Exemples

```
wfg project init --path ./MyProject
```

```
wfg project init --path ./MyProject --bare --force
```

### `export`

Exporte un projet de votre serveur WorkflowGen vers un référentiel local.

#### **Utilisation**

```
wfg project export --path [PROJECT_PATH]
```

#### **Option**

| **Alias**        | **Type** | **Description**                                                                           | **Valeur par défaut** | **Comportement** |
| ---------------- | -------- | ----------------------------------------------------------------------------------------- | --------------------- | ---------------- |
| `--path` ou `-p` | Chaîne   | Chemin d'accès au dossier dans lequel se trouvent le manifeste et les fichiers du projet. | Répertoire actuel     | Facultatif       |

#### 📌 Exemple

```
wfg project export --path ./MyProject
```

### `import`

Importe un projet d'un référentiel local vers votre serveur WorkflowGen.

#### **Utilisation**

```
wfg project import --source [PATH] --force
```

#### **Options**

| **Alias**          | **Type** | **Description**                                                     | **Valeur par défaut** | **Comportement** |
| ------------------ | -------- | ------------------------------------------------------------------- | --------------------- | ---------------- |
| `--source` ou `-s` | Chaîne   | Chemin du projet                                                    | Répertoire actuel     | Facultatif       |
| `--force` ou `-f`  | Booléen  | Met à jour les listes globales et applications existantes du projet | `false`               | Facultatif       |

#### 📌 Exemple

```
wfg project import --source c:\repository
```

### `show`

Affiche le contenu d'un lien de manifeste vers un projet.

#### Utilisation

```
wfg project show --path [PROJECT_PATH]
```

#### **Option**

| **Alias**        | **Type** | **Description**  | **Valeur par défaut** | **Comportement** |
| ---------------- | -------- | ---------------- | --------------------- | ---------------- |
| `--path` ou `-p` | Chaîne   | Chemin du projet | Répertoire actuel     | Facultatif       |

#### 📌 Exemple

```
wfg project show --path c:\repository
```

## `process`

La commande `process` vous permet d'exporter (`export`), d'importer (`import`), d'afficher (`get`), de mettre à jour (`update`) ou de supprimer (`delete`) un processus.

{% hint style="info" %}
Disponible depuis la version 7.17.0 de WorkflowGen.
{% endhint %}

### `export`

Exporte un processus spécifique de votre serveur WorkflowGen vers un référentiel local.

#### **Utilisation**

```
wfg process export [PROCESS_NAME] [PROCESS_VERSION] --destination [PATH]
```

#### **Arguments**

| **Nom**   | **Type** | **Description**      | **Comportement** |
| --------- | -------- | -------------------- | ---------------- |
| `name`    | Chaîne   | Nom du processus     | Requis           |
| `version` | Int      | Version du processus | Requis           |

#### **Option**

| **Alias**               | **Type** | **Description**      | **Valeur par défaut** | **Comportement** |
| ----------------------- | -------- | -------------------- | --------------------- | ---------------- |
| `--destination` ou `-d` | Chaîne   | Chemin d'exportation | Répertoire actuel     | Facultatif       |

#### 📌 Exemple

```
wfg process export SIMPLE_APPROVAL 1
```

### `import`

Importe un processus spécifique d'un référentiel local vers votre serveur WorkflowGen.

#### **Utilisation**

```
wfg process import [PROCESS_PATH] --useVersionNumber --state [STATE]
```

#### **Argument**

| **Nom**     | **Type** | **Description**                    | **Comportement** |
| ----------- | -------- | ---------------------------------- | ---------------- |
| `file-path` | Chaîne   | Chemin du fichier XML de processus | Requis           |

#### Options

| **Alias**              | **Type** | **Description**                                                                                       | **Valeur par défaut** | **Comportement** |
| ---------------------- | -------- | ----------------------------------------------------------------------------------------------------- | --------------------- | ---------------- |
| `--use-version-number` | Booléen  | Utiliser la version de processus du fichier XML                                                       | `false`               | Facultatif       |
| `--state` ou `-s`      | Chaîne   | Spécifie avec quel statut le processus sera importé                                                   | `TEST`                | Facultatif       |
| `--folder`             | String   | Nom de destination du dossier de processus dans lequel importer le processus; le dossier doit exister | `DEFAULT`             | Facultatif       |

{% hint style="info" %}

#### **`UseVersionNumber`**

* `<use-version-number = true>` tentera d'ajouter le processus avec le numéro de version dans le fichier XML, s'il n'existe pas déjà.<br>
* `<use-version-number = false>` ajoutera le processus avec le dernier numéro de version plus un (p.ex. si la dernière version actuelle est `3`, définir ce paramètre sur `false` importera le processus en tant que version `4`).

#### **`state`**

L'état (`state`) peut être l'un des suivants :

* `TEST` (par défaut)
* `ACTIVE`
* `DEV`
* `ARCHIVE`
  {% endhint %}

#### 📌 Exemple

```
wfg process import c:\repository\SIMPLE_APPROVALv1.xml
```

### `get`

Affiche un ou plusieurs processus.

#### Utilisation

```
wfg process get [PROCESS_NAME] [PROCESS_VERSION] --output
```

#### **Arguments**

| **Nom**   | **Type** | **Description**      | **Comportement**                         |
| --------- | -------- | -------------------- | ---------------------------------------- |
| `name`    | Chaîne   | Nom du processus     | Facultatif                               |
| `version` | Int      | Version du processus | Facultatif (sauf si un nom est spécifié) |

#### **Option**

| **Alias**          | **Type** | **Description**                                                 | **Valeur par défaut** | **Comportement** |
| ------------------ | -------- | --------------------------------------------------------------- | --------------------- | ---------------- |
| `--output` ou `-o` | Chaîne   | Définit la valeur de sortie. Valeurs valides : `json`, `table`. | `table`               | Facultatif       |

#### 📌 Exemple

```
wfg process get SIMPLE_APPROVAL 1 -o json
```

### `update`

Met à jour les informations pour un seul processus.

#### **Utilisation**

```
wfg process update [PROCESS_NAME] [PROCESS_VERSION] -d [DESCRIPTION] -s [STATE]
```

#### **Arguments**

| **Nom**   | **Type** | **Description**      | **Comportement** |
| --------- | -------- | -------------------- | ---------------- |
| `name`    | Chaîne   | Nom du processus     | Requis           |
| `version` | Int      | Version du processus | Requis           |

#### Options

| **Alias**               | **Type** | **Description**                                                    | **Valeur par défaut** | **Comportement** |
| ----------------------- | -------- | ------------------------------------------------------------------ | --------------------- | ---------------- |
| `--description` ou `-d` | Chaîne   | Spécifie la description avec laquelle le processus sera mis à jour | Aucune                | Facultatif       |
| `--state` ou `-s`       | Chaîne   | Spécifie avec quel statut le processus sera mis à jour             | Aucune                | Facultatif       |

{% hint style="info" %}

#### **`state`**

L'état (`state`) peut être l'un des suivants :

* `TEST`
* `ACTIVE`
* `DEV`
* `ARCHIVE`
  {% endhint %}

#### 📌 Exemple

```
wfg process update SIMPLE_APPROVAL 1 -s DEV
```

### `delete`

Supprime un seul processus par nom et version.

#### **Utilisation**

```
wfg process delete [PROCESS_NAME] [PROCESS_VERSION]
```

#### Arguments

| **Nom**   | **Type** | **Description**      | **Comportement** |
| --------- | -------- | -------------------- | ---------------- |
| `name`    | Chaîne   | Nom du processus     | Requis           |
| `version` | Int      | Version du processus | Requis           |

#### 📌 Exemple

```
wfg process delete SIMPLE_APPROVAL 1
```

### `test`

Exécute des cas de test de vos processus

**Utilisation**

```
wfg process test [PATH_TEST_FILES] --verbosity [LEVEL] --doctor
```

**Arguments**

| **Nom**      | **Type** | **Description**                         | **Comportement** |
| ------------ | -------- | --------------------------------------- | ---------------- |
| `test-files` | Chaîne   | Chemin(s) vers le(s) fichier(s) de test | Requis           |

**Option**

| **Nom**               | **Type** | **Description**                                                                                                                                      | **Comportement** |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `--verbosity` ou `-v` | Chaîne   | <p>Établit le niveau de verbosité. </p><p>Valeurs possibles : <code>q\[uiet]</code>,<code>n\[ormal]</code> (par défaut),<code>d\[etailed]</code></p> | Facultatif       |
| `--doctor`            | Chaîne   | Vérifiez si les cas de test sont conformes. Uniquement disponible à partir de WorkflowGen version 8.0.3.                                             | Facultatif       |

📌 **Exemple**

```
wfg process test c:\repository\SIMPLE_APPROVALv1_Test.json c:\repository\SIMPLE_REQUESTv1_Test.json --verbosity quiet
```

📌 **Exemple d'un fichier de test**

```
{
    "processName": "SIMPLE_APPROVAL",
    "processVersion": 1,
    "tests": [
        {
            "describe": "First test",
            "requestParameters": [],
            "actions": [
                {
                    "name": "INITIATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "REQUEST_SUBJECT",
                            "textValue": "OK"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED"
                    }
                },
                {
                    "name": "VALIDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "APPROVAL_DECISION",
                            "textValue": "YES"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED",
                        "data": [
                            {
                                "name": "APPROVAL_DECISION",
                                "textValue": "YES"
                            }
                        ]
                    }
                }
        },
        {
            "describe": "Second test",
            "requestParameters": [],
            "actions": [
                {
                    "name": "INITIATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "REQUEST_SUBJECT",
                            "textValue": "OK"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED"
                    }
                },
                {
                    "name": "VALIDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "APPROVAL_DECISION",
                            "textValue": "NO"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED",
                        "data": [
                            {
                                "name": "APPROVAL_DECISION",
                                "textValue": "NO"
                            }
                        ]
                    }
                },
                {
                    "name": "UPDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "REQUEST_SUBJECT",
                            "textValue": "OK2"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED"
                    }
                },
                {
                    "name": "VALIDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "APPROVAL_DECISION",
                            "textValue": "YES"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED",
                        "data": [
                            {
                                "name": "APPROVAL_DECISION",
                                "textValue": "YES"
                            }
                        ]
                    }
                }
        }
    ],
    "deleteRequest": false
}
```

## `global-list`

La commande `global-list` vous permet d'exporter (`export`), d'importer (`import`), d'afficher (`get`) ou de supprimer (`delete`) une liste globale.

{% hint style="info" %}
Disponible depuis la version 7.17.0 de WorkflowGen.
{% endhint %}

### `export`

Exporte une liste globale spécifique de votre serveur WorkflowGen vers un référentiel local.

#### **Utilisation**

```
wfg global-list export [GLOBAL_LIST_NAME] --destination [PATH]
```

#### **Argument**

| **Nom** | **Type** | **Description**         | **Comportement** |
| ------- | -------- | ----------------------- | ---------------- |
| `name`  | Chaîne   | Nom de la liste globale | Requis           |

#### Option

| **Alias**               | **Type** | **Description**      | **Valeur par défaut** | **Comportement** |
| ----------------------- | -------- | -------------------- | --------------------- | ---------------- |
| `--destination` ou `-d` | Chaîne   | Chemin d'exportation | Répertoire actuel     | Facultatif       |

#### 📌 Exemple

```
wfg global-list export Country
```

### `import`

Importe une liste globale spécifique de votre référentiel local vers votre serveur WorkflowGen.

{% hint style="warning" %}
**Problème connu (#3373) :** Voir les [notes de version WorkflowGen 7.22.2](https://discuss.workflowgen.com/t/workflowgen-7-22-2).
{% endhint %}

#### **Utilisation**

```
wfg global-list import [GLOBAL_LIST_PATH] --force
```

#### **Argument**

| **Nom**     | **Type** | **Description**                                   | **Comportement** |
| ----------- | -------- | ------------------------------------------------- | ---------------- |
| `file-path` | Chaîne   | Le chemin vers le fichier XML de la liste globale | Requis           |

#### Option

| **Alias**         | **Type** | **Description**                       | **Valeur par défaut** | **Comportement** |
| ----------------- | -------- | ------------------------------------- | --------------------- | ---------------- |
| `--force` ou `-f` | Booléen  | Met à jour la liste globale spécifiée | `false`               | Facultatif       |

#### 📌 Exemple

```
wfg global-list import c:\repository\Country
```

### `get`

Affiche une ou plusieurs listes globales.

#### **Utilisation**

```
wfg global-list get [GLOBAL_LIST_NAME] --output
```

#### **Arguments**

| **Nom** | **Type** | **Description**                         | **Comportement** |
| ------- | -------- | --------------------------------------- | ---------------- |
| `names` | Chaîne   | Nom(s) de la ou des liste(s) globale(s) | Facultatif       |

#### **Option**

| **Alias**          | **Type** | **Description**                                                 | **Valeur par défaut** | **Comportement** |
| ------------------ | -------- | --------------------------------------------------------------- | --------------------- | ---------------- |
| `--output` or `-o` | Chaîne   | Définit la valeur de sortie. Valeurs valides : `json`, `table`. | `table`               | Facultatif       |

#### 📌 Exemple

```
wfg global-list get Country Clients --output json
```

### `delete`

Supprime une seule liste globale par nom.

#### **Utilisation**

```
wfg global-list delete [GLOBAL_LIST_NAME]
```

#### **Arguments**

| **Nom** | **Type** | **Description**         | **Comportement** |
| ------- | -------- | ----------------------- | ---------------- |
| `name`  | Chaîne   | Nom de la liste globale | Requis           |

#### 📌 Exemple

```
wfg global-list delete Country
```

## `application`

La commande `application` vous permet d'exporter (`export`), d'importer, d'afficher (`get`), d'afficher les paramètres (`get-parameters`) ou de supprimer (`delete`) une application.

{% hint style="info" %}
Disponible depuis la version 7.14.0 de WorkflowGen.
{% endhint %}

### `export`

Exporte une application spécifique de votre serveur WorkflowGen vers un référentiel local.

#### **Utilisation**

```
wfg application export [APPLICATION_NAME] --destination [PATH]
```

#### **Arguments**

| **Nom** | **Type** | **Description**      | **Comportement** |
| ------- | -------- | -------------------- | ---------------- |
| `name`  | Chaîne   | Nom de l'application | Requis           |

#### Option

| **Alias**               | **Type** | **Description**      | **Valeur par défaut** | **Comportement** |
| ----------------------- | -------- | -------------------- | --------------------- | ---------------- |
| `--destination` ou `-d` | Chaîne   | Chemin d'exportation | Répertoire actuel     | Facultatif       |

#### 📌 Exemple

```
wfg application export XMLTODATABASE
```

### `import`

Importe une application spécifique de votre référentiel local vers votre serveur WorkflowGen.

#### **Utilisation**

```
wfg application import [APPLICATION_PATH] --force
```

#### **Arguments**

| **Nom**     | **Type** | **Description**                                              | **Comportement** |
| ----------- | -------- | ------------------------------------------------------------ | ---------------- |
| `file-path` | Chaîne   | Le chemin complet contenant le fichier JSON de l'application | Requis           |

#### **Option**

| **Alias**         | **Type** | **Description**                    | **Valeur par défaut** | **Comportement** |
| ----------------- | -------- | ---------------------------------- | --------------------- | ---------------- |
| `--force` ou `-f` | Booléen  | Met à jour l'application spécifiée | `false`               | Facultatif       |

#### 📌 Exemple

```
wfg application import c:\repository\XMLTODATABASE.xml
```

### `get`

Affiche une ou plusieurs applications.

#### **Utilisation**

```
wfg application get [APPLICATION_NAME] --output
```

#### **Arguments**

| **Nom** | **Type** | **Description**                    | **Comportement** |
| ------- | -------- | ---------------------------------- | ---------------- |
| `names` | Chaîne   | Nom(s) de la ou des application(s) | Facultatif       |

#### **Option**

| **Alias**          | **Type** | **Description**                                                 | **Valeur par défaut** | **Comportement** |
| ------------------ | -------- | --------------------------------------------------------------- | --------------------- | ---------------- |
| `--output` ou `-o` | Chaîne   | Définit le format de sortie. Valeurs valides : `json`, `table`. | `table`               | Facultatif       |

#### 📌 Exemple

```
wfg application get XMLTODATABASE --output json
```

### `get-parameters`

Affiche les paramètres d'une application.

#### **Utilisation**

```
wfg application get-parameters [APPLICATION_NAME] --output
```

#### **Arguments**

| **Nom** | **Type** | **Description**      | **Comportement** |
| ------- | -------- | -------------------- | ---------------- |
| `name`  | Chaîne   | Nom de l'application | Requis           |

#### **Option**

| **Alias**          | **Type** | **Description**                                                 | **Valeur par défaut** | **Comportement** |
| ------------------ | -------- | --------------------------------------------------------------- | --------------------- | ---------------- |
| `--output` ou `-o` | Chaîne   | Définit le format de sortie. Valeurs valides : `json`, `table`. | `table`               | Facultatif       |

#### 📌 Exemple

```
wfg application get-parameters XMLTODATABASE --output json
```

### `delete`

Supprime une seule application par son nom.

#### **Utilisation**

```
wfg application delete [APPLICATION_NAME]
```

#### **Arguments**

| **Nom** | **Type** | **Description**      | **Comportement** |
| ------- | -------- | -------------------- | ---------------- |
| `name`  | Chaîne   | Nom de l'application | Requis           |

#### 📌 Exemple

```
wfg application delete XMLTODATABASE
```

## `action`

{% hint style="info" %}
Disponible depuis la version 7.17.0 de WorkflowGen.
{% endhint %}

### `get`

Affiche les informations d'action d'une demande ou d'un processus.

#### **Utilisation**

```
wfg action get [requestNumber] --processName --processVersion --status --output
```

#### **Argument**

| **Nom**         | **Type** | **Description**                                                  | **Comportement** |
| --------------- | -------- | ---------------------------------------------------------------- | ---------------- |
| `requestNumber` | Int      | Numéro d'identification de la demande que vous souhaitez obtenir | Facultatif       |

#### **Option**

| **Alias**                  | **Type** | **Description**                                                     | **Valeur par défaut** | **Comportement** |
| -------------------------- | -------- | ------------------------------------------------------------------- | --------------------- | ---------------- |
| `--processName` ou `-p`    | Chaîne   | Nom du processus dont vous souhaitez récupérer les actions          | (aucune)              | Facultatif       |
| `--processVersion` ou `-v` | Int      | Version du processus dont vous souhaitez récupérer les actions      | (aucune)              | Facultatif       |
| `--status` ou `-s`         | Chaîne   | Récupérer les demandes avec un statut spécifié (`OPEN` ou `CLOSED)` | (aucune)              | Facultatif       |
| `--output` ou `-o`         | Chaîne   | Définit le format de sortie. Valeurs valides : `json`, `table`.     | `table`               | Facultatif       |

#### 📌 Exemple

```
wfg action get 1994 -s OPEN -o json
wfg action get -p SIMPLE_REQUEST
```

### `complete`

Effectuer une action pour un processus.

#### Utilisation

```
wfg action complete [activityNumber] [requestNumber] --parameter
```

#### Argument

| **Nom**          | **Type** | **Description**                                                              | **Comportement** |
| ---------------- | -------- | ---------------------------------------------------------------------------- | ---------------- |
| `activityNumber` | Int      | Numéro d'action de l'action que vous souhaitez effectuer                     | Requis           |
| `requestNumber`  | Int      | Numéro d'identification de la demande dont vous souhaitez effectuer l'action | Requis           |

#### Option

| **Alias**             | **Type** | **Description**                                                                                                                                           | **Comportement** |
| --------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `--parameter` ou `-p` | Chaîne   | Votre paramètre d'action complet contient une chaîne au format suivant :`ValueType:ParameterName=Value`. `ValueType` peut être `text`,`numeric` ou `date` | Facultatif       |

#### 📌 Exemple

```
wfg action complete 1 1994 -p text:SUBJECT="My Subject"
```

### `cancel`

Annule une action en cours.

#### Utilisation

```
wfg action cancel [actionNumber] [requestNumber] --force
```

#### Argument

| **Nom**          | **Type** | **Description**                                                            | **Comportement** |
| ---------------- | -------- | -------------------------------------------------------------------------- | ---------------- |
| `activityNumber` | Int      | Numéro d'action de l'action que vous souhaitez annuler                     | Requis           |
| `requestNumber`  | Int      | Numéro d'identification de la demande dont vous souhaitez annuler l'action | Requis           |

#### Option

| **Alias**         | **Type** | **Description**    | **Valeur par défaut** | **Comportement** |
| ----------------- | -------- | ------------------ | --------------------- | ---------------- |
| `--force` ou `-f` | Booléen  | Force l'annulation | `false`               | Facultatif       |

#### 📌 Example

```
wfg action cancel 1 1994 -f
```

## `request`

{% hint style="info" %}
Disponible depuis la version 7.17.0 de WorkflowGen.
{% endhint %}

### `get`

Gère un demande WorkflowGen.

#### **Utilisation**

```
wfg request get [requestNumber] --processName --processVersion --status --output
```

#### **Argument**

| **Nom**         | **Type** | **Description**                                                             | **Comportement** |
| --------------- | -------- | --------------------------------------------------------------------------- | ---------------- |
| `requestNumber` | Chaîne   | Numéro(s) d'identification de la ou des demandes que vous souhaitez obtenir | Facultatif       |

#### **Option**

| **Alias**                  | **Type** | **Description**                                                     | **Valeur par défaut** | **Comportement** |
| -------------------------- | -------- | ------------------------------------------------------------------- | --------------------- | ---------------- |
| `--processName` ou `-p`    | Chaîne   | Nom du processus dont vous souhaitez récupérer les demandes         | (aucune)              | Facultatif       |
| `--processVersion` ou `-v` | Int      | Version du processus dont vous souhaitez récupérer les demandes     | (aucune)              | Facultatif       |
| `--status` ou `-s`         | Chaîne   | Récupérer les demandes avec le statut spécifié (`OPEN` ou `CLOSED)` | (aucune)              | Facultatif       |
| `--output` ou `-o`         | Chaîne   | Définit le format de sortie. Valeurs valides : `json`, `table`.     | `table`               | Facultatif       |

#### 📌 Exemple

```
wfg request get 1994 -s OPEN -o json
wfg request get -p SIMPLE_REQUEST
```

### `create`

Crée une nouvelle demande à partir d'un processus.

#### Utilisation

```
wfg request complete [processName] [processVersion] --parameter
```

#### Argument

| **Nom**          | **Type** | **Description**                                            | **Comportement** |
| ---------------- | -------- | ---------------------------------------------------------- | ---------------- |
| `processName`    | Chaîne   | Nom du processus dont vous souhaitez créer une demande     | Requis           |
| `processVersion` | Int      | Version du processus dont vous souhaitez créer une demande | Requis           |

#### Option

| **Alias**             | **Type** | **Description**                                                                                                                                             | **Comportement** |
| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `--parameter` ou `-p` | `Chaîne` | Votre paramètre d'action complet contient une chaîne au format suivant : `ValueType:ParameterName=Value`. `ValueType` peut être `text`,`numeric` ou `date`. | Facultatif       |

#### 📌 Exemple

```
wfg request complete 1 1994 -p text:SUBJECT="My Subject"
```

### `cancel`

Annule une demande en cours.

#### Utilisation

```
wfg request cancel [requestNumber] --force
```

#### Argument

| **Nom**         | **Type** | **Description**                                 | **Comportement** |
| --------------- | -------- | ----------------------------------------------- | ---------------- |
| `requestNumber` | Int      | Le numéro de demande que vous souhaitez annuler | Requis           |

#### Option

| **Alias**         | **Type** | **Description**    | **Valeur par défaut** | **Comportement** |
| ----------------- | -------- | ------------------ | --------------------- | ---------------- |
| `--force` ou `-f` | Booléen  | Force l'annulation | `false`               | Facultatif       |

#### 📌 Exemple

```
wfg request cancel 1994 -f
```

## `graphql`

La commande `graphql` vous permet d'exécuter une requête GraphQL personnalisée.

{% hint style="info" %}
Disponible depuis la version 7.0.0 de WorkflowGen.
{% endhint %}

#### Utilisation

```
wfg graphql [GRAPHQL_QUERY] -v [VARIABLE1_STRING] -V [VARIABLE2_INT] -V [VARIABLE3_BOOL]
```

```
wfg graphql [GRAPHQL_QUERY] --variableJson [VARIABLES_JSON]
```

#### Arguments

| **Nom**                  | **Type** | **Description**                                                                                                                                                                                                       | **Comportement** |
| ------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `--variable` ou `-v`     | Chaîne   | Entre une variable qui sera lue sous forme de chaîne brute                                                                                                                                                            | Voir ci-dessous  |
| `--variableCast` ou `-V` | Chaîne   | Entre une variable que la CLI tentera de caster dans un type JSON valide                                                                                                                                              | Voir ci-dessous  |
| `--variableJson`         | JSON     | <p>Entre un objet JSON contenant les noms des variables en tant que clés et les valeurs des variables en tant que valeurs de ces clés.</p><p></p><p>📌 <strong>Exemple :</strong> <code>{ "key": "value" }</code></p> | Voir ci-dessous  |

{% hint style="warning" %}
Si la commande `graphql` utilise des variables, vous devez spécifier **soit** `--variable` et `--variableCast`, **soit** `--variableJson`. Vous ne pouvez pas utiliser `--variableJson` avec les deux autres arguments et vice-versa.
{% endhint %}

#### 📌 Exemples

{% tabs %}
{% tab title="PowerShell" %}

```bash
wfg graphql "query { viewer { userName } }"
```

{% endtab %}

{% tab title="Bash" %}

```bash
wfg graphql "query { viewer { userName } }"
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PowerShell" %}

```bash
wfg graphql @'
query ($name: String!, $version: Int!) {
    process(name: $name, version: $version) {
        description
    }
}
'@ -v name=SIMPLE_APPROVAL -V version=1
```

{% endtab %}

{% tab title="Bash" %}

```bash
wfg graphql "$(cat <<QUERY
query (\$name: String!, \$version: Int!) {
        process(name: \$name, version: \$version) {
                description
        }
}
QUERY
)" -v name=SIMPLE_APPROVAL -V version=1
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PowerShell" %}

```bash
wfg graphql @'
query ($name: String!, $version: Int!) {
    process(name: $name, version: $version) {
        description
    }
}
'@ --variableJson ((@{
    name = "SIMPLE_APPROVAL"
    version = 1
} | ConvertTo-Json -Compress) -replace '"', '\"')
```

{% hint style="warning" %}
En raison d'un bogue PowerShell connu au moment de l'écriture (<https://github.com/PowerShell/PowerShell/issues/1995>), les guillemets (`"`) seront supprimés de la chaîne lors de son envoi à un exécutable natif. La solution consiste à ajouter une barre oblique inverse (`\`) avant chaque guillemet ou à utiliser trois guillemets (`"""`).
{% endhint %}
{% endtab %}

{% tab title="Bash" %}

```bash
wfg graphql "$(cat <<QUERY
query (\$name: String!, \$version: Int!) {
    process(name: \$name, version: \$version) {
        description
    }
}
QUERY
)" --variableJson "$(cat <<JSON
{
    "name": "SIMPLE_APPROVAL",
    "version": 1
}
JSON
)"
```

{% endtab %}
{% endtabs %}
