Getting Started

Log in to your WorkflowGen server

Before using the WorkflowGen CLI to interact with your WorkflowGen server, you need to log in to it. See the login section for more information.
1
wfg login http://localhost/wfgen -u wfgen_admin -p myPassword -c DEV
Copied!

Managing a project

A project is composed of processes, sub-processes, custom workflow applications, global lists, and webform assets.
A project is based on a manifest file definition (see the Project Manifest section).
Managing a project with the CLI allows you to export or import the content easily.

Create a simple project

In most cases, a WorkflowGen project is composed of processes and sub-processes. The following manifest defines a project with one process and two sub-processes, with one global list:
1
{
2
"version": "1.0",
3
"tag": "1.2.0",
4
"processes":[
5
{
6
"name":"EMPLOYEE_ONBOARDING",
7
"version":1,
8
"folder":"HR"
9
}
10
],
11
"subProcesses":[
12
{
13
"name":"CREATE_AD_ACCOUNT",
14
"version":1,
15
"folder":"IT"
16
},
17
{
18
"name":"CREATE_ERP_ACCESS",
19
"version":1,
20
"folder":"IT"
21
}
22
],
23
"globalLists": [
24
"Country"
25
]
26
}
Copied!
You can use the project init command to build the manifest with the CLI, or write the definition directly in a manifest.json file.
If you add webform assets to your manifest, be sure that you have correctly set the path to the webform folder on the WorkflowGen server.
The webform path is also required if you want to export process code (contained in the Default.aspx file).

Export your project

Once your manifest.json file is correctly defined, you can use the project export command to download all sources' links to your project.
1
wfg project export -p pathToTheFolderWithTheManifest
Copied!
For the manifest definition, you should have a folder structure like the following:
1
| manifest.json
2
| definitions/
3
| globallists/
4
| Country.Xml
5
| subprocesses/
6
| CREATE_AD_ACCOUNTv1.xml
7
| CREATE_ERP_ACCESSv1.xml
8
| processes/
9
| EMPLOYEE_ONBOARDINGv1.xml
10
| src/
11
| processes/
12
| CREATE_AD_ACCOUNT/
13
| V1/
14
| Default.aspx
15
| Default.aspx.cs
16
| CREATE_ERP_ACCESS/
17
| V1/
18
| Default.aspx
19
| Default.aspx.cs
20
| EMPLOYEE_ONBOARDING/
21
| V1/
22
| Default.aspx
23
| Default.aspx.cs
Copied!

Import your project

With the project import command you can import your project into another WorkflowGen server (such as the production server).
1
wfg project import --source pathToYourProjectFolder
Copied!
The CLI will import all definitions into your WorkflowGen application, and will create processes, sub-processes, applications, and global lists, and move webform assets to the webform folder.

Video example

Using a multiple server configuration

The CLI uses contexts to identify which server and user to use to connect to WorkflowGen. You can define more than one configuration, one for each of your WorkflowGen servers.
The login command contains the --context option to give a name to your context.
With the config get-contexts command you can display all contexts defined.
1
wfg config get-contexts
Copied!
Result:
1
-----------------------------------------------------
2
| Current | Context name | Server name | User name |
3
-----------------------------------------------------
4
| | PROD | CG9FDCK57K | ZQPWB00VS3 |
5
-----------------------------------------------------
6
| * | DEV | CB6YHR11DD | ACJTLYG0AZ |
7
-----------------------------------------------------
8
9
Count: 2
Copied!
You can switch to another context with the config use-context command.
1
wfg config use-context PROD
Copied!

Global options

The CLI provides some global options to give you some other information.

help

With the help option, you can get information on how to use a specific command or see which commands are available.
1
wfg --help
Copied!
Result:
1
Usage:
2
wfg [options] [command]
3
4
Options:
5
--debug
6
--verbose
7
--version Show version information
8
-?, -h, --help Show help and usage information
9
10
Commands:
11
login <url>
12
config
13
process
14
project
15
global-list
16
application
17
graphql <query>
Copied!

debug

With the debug option, you can display more logs in your terminal during the command execution.
1
wfg process get --debug
Copied!

verbose

The verbose option is like the debug option, but the CLI will display more logs than it does for debug.
1
wfg process get --verbose
Copied!

version

The version option returns your current WorkflowGen CLI version.
1
wfg --version
Copied!

Enabling tab completion

PowerShell
Bash
    1.
    Install the dotnet-suggest global tool:
    1
    dotnet tool install --global dotnet-suggest
    Copied!
    2.
    Open your PowerShell profile and add the following code to it. You can get the path to your profile path with echo $PROFILE.
    1
    # dotnet suggest shell start
    2
    $availableToComplete = (dotnet-suggest list) | Out-String
    3
    $availableToCompleteArray = $availableToComplete.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries)
    4
    5
    Register-ArgumentCompleter -Native -CommandName $availableToCompleteArray -ScriptBlock {
    6
    param($commandName, $wordToComplete, $cursorPosition)
    7
    $fullpath = (Get-Command $wordToComplete.CommandElements[0]).Source
    8
    9
    $arguments = $wordToComplete.Extent.ToString().Replace('"', '\"')
    10
    dotnet-suggest get -e $fullpath --position $cursorPosition -- "$arguments" | ForEach-Object {
    11
    [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    12
    }
    13
    }
    14
    15
    $env:DOTNET_SUGGEST_SCRIPT_VERSION = "1.0.0"
    16
    # dotnet suggest script end
    Copied!
    1.
    Install the dotnet-suggest global tool:
    1
    dotnet tool install --global dotnet-suggest
    Copied!
    2.
    Open your bash profile (~/.bash_profile) and add the following code to it:
    1
    # dotnet suggest shell complete script start
    2
    _dotnet_bash_complete()
    3
    {
    4
    local fullpath=`type -p ${COMP_WORDS[0]}`
    5
    local escaped_comp_line=$(echo "$COMP_LINE" | sed s/\"/'\\\"'/g)
    6
    local completions=`dotnet-suggest get --executable "${fullpath}" --position ${COMP_POINT} -- "${escaped_comp_line}"`
    7
    8
    if [ "${#COMP_WORDS[@]}" != "2" ]; then
    9
    return
    10
    fi
    11
    12
    local IFS=$'\n'
    13
    local suggestions=($(compgen -W "$completions"))
    14
    15
    if [ "${#suggestions[@]}" == "1" ]; then
    16
    local number="${suggestions[0]/%\ */}"
    17
    COMPREPLY=("$number")
    18
    else
    19
    for i in "${!suggestions[@]}"; do
    20
    suggestions[$i]="$(printf '%*s' "-$COLUMNS" "${suggestions[$i]}")"
    21
    done
    22
    23
    COMPREPLY=("${suggestions[@]}")
    24
    fi
    25
    }
    26
    27
    _dotnet_bash_register_complete()
    28
    {
    29
    local IFS=$'\n'
    30
    complete -F _dotnet_bash_complete `dotnet-suggest list`
    31
    }
    32
    _dotnet_bash_register_complete
    33
    export DOTNET_SUGGEST_SCRIPT_VERSION="1.0.1"
    34
    # dotnet suggest shell complete script end
    Copied!
To use the dotnet-suggest tools, you need to install .NET Core 3.1.
Last modified 1mo ago