Executing a Workflow Using the Command Line Interface

You can execute workflows using an XML file.

Note: Workflows must be deployed before they can be executed. For instructions on deploying a workflow, see Deploying a Workflow.

Procedure

  1. Download the execute_workflow.xml file to the computer from where you will run the command.

  2. Run the qlogin command to log on to the CommServe computer.

  3. From software_installation_directory/Base type the following command after substituting the parameter values:

    qoperation execute -af execute_workflow.xml -associations/clientName workflow_engine -workflowName workflow_name -workflowJobOptions "<inputs><input_name>input_value</input_name></inputs>"

Examples

  • Demo_CheckReadiness workflow - Type the following to check the readiness of all clients in the "Laptop Clients" client computer group:

    qoperation execute -af execute_workflow.xml -associations/clientName workflow_engine -workflowName Demo_CheckReadiness -workflowJobOptions "<inputs><ClientGroupName>Laptop Clients</ClientGroupName></inputs>"

    where workflow_engine is the name of the workflow engine.

  • Demo - Client Group Policy workflow - Type the following to update the storage policy for all file system subclients in the "Laptop Clients" client computer group:

    qoperation execute -af execute_workflow.xml -associations/clientName workflow_engine -workflowName "Demo - Client Group Policy" -workflowJobOptions "<inputs><clientGroup>Laptop Clients</clientGroup><storagePolicy>SP_001</storagePolicy></inputs>"

    where workflow_engine is the name of the workflow engine.

  • A workflow that requires an encrypted input such as a password:

    qoperation execute -af execute_workflow.xml -associations/clientName workflow_engine -workflowName "New User" -workflowJobOptions "<inputs><userName>jdoe</userName><userEmail>jdoe@mycompany.com</userEmail><userPassword reencrypt="true">Y2hhbmdlbWU</userPassword></inputs>"

    where workflow_engine is the name of the workflow engine.

Available Command Parameters

The following table displays the XML parameters that need to be provided before running the qoperation command:

Parameter

Description of Parameter Values

clientName

The name of the workflow engine. To use the workflow engine with the latest deployed version of the workflow, use the clientId parameter.

clientId

The option to use the workflow engine with the latest deployed version of the workflow.

Valid value is 0.

workflowName

The name of the workflow.

workflowJobOptions

The value of the workflow input needed to execute the workflow. If the workflow contains an encrypted input do the following:

  • Encode the input value using Base64 encoding

  • Add reencrypt="true" to the input as an attribute

    For example: <inputs><password reencrypt="true">YmFzZV82NF9lbmNvZGVkX3ZhbHVl</password></inputs>

    Defining Inputs in the XML File

    If you define the inputs in the XML file, add an element for each input, for example:

    <workflowJobOptions> <inputs> <input_name_1>input_value</input_name_1> <input_name_2>input_value</input_name_2> <input_name_3>input_value</input_name_3> <input_name_N>input_value</input_name_N> <input_name_S reencrypt="true">encoded_input_value</input_name_S> </inputs> </workflowJobOptions>

    where:

  • input_name_1 to input_name_N are the workflow inputs

  • input_value is the value for the workflow input defined as the element

  • input_name_S is the encrypted workflow input

  • encoded_input_value is the Base64 encoded value for the workflow input defined as the element

Loading...