-
Notifications
You must be signed in to change notification settings - Fork 47
Store workflow template on server and access it as a general command
Originally, webcommander only provided individual commands. Workflows, a combination of defined commands and parameters, were supposed to be composed and maintained by end users' themselves. It was not convenient to share and reuse workflows to do more complicated tasks.
To solve this problem, workflow templates (in form of JSON files) could now be stored on webcommander server. Each template shows as a general command on the index page. When user clicks on it, it opens the workflow page and shows the commands defined by the template automatically.
- Open a browser and navigate to the workflow page.
- Select "Workflow > Define variables" as the very first command.
- In variableList, define global variables in form of name=value pairs. For all following commands, use variable names to define parameters. That means when another user wants to reuse this workflow, he just needs to modify the first command to change variable values. All other commands could be kept intact.
- Add as many commands as necessary.
- Export the workflow content and save it as a JSON file.
- Edit the JSON file by removing the first line with the code below.
- Save the JSON file in www/workflow/ folder or any sub folder.
[{
"synopsis": "Replace this with the text to display on the index page",
"functionality": "Replace this with tags (separated by comma) so that it could be filtered",
"description": "Replace this with a workflow description"
},
{
Refer to https://github.com/vmware/webcommander/blob/master/www/workflow/sample/upgrade-powershell.json for an example.
Once the JSON file is saved, click "Generate command definition" command on the index page.