Example: Manual Steps with Runtime Parameters

ReferenceAutomation

This topic describes manual steps with parameter inputs and how the parameter inputs influence the process flow to take different paths. You can define manual steps in an application process or component process.

In the following example, an application process called Deploy has the following steps. When deployed, this process updates the website for an online store.

  • The first step is a command step to retrieve a .war file that will be deployed to the website.

  • The second step is a manual step to log into a terminal where you can enter CLI commands to update the website.

    If you have admin privileges, you can update the home (parent) page. If you do not have privileges to update the home page, you can update only the product (child) pages.

    Depending on your privileges, the parameter input to the manual step is either pass (you have the privileges to update the home page) or fail (you can only update the product pages).

  • The parameter inputs to the manual step are the preconditions to the third and fourth steps.

    • condition1 is fulfilled if the input to the manual step is pass .

    • condition 2 is fulfilled if the input to the manual step is fail .

      These preconditions determine the step that is executed after the manual step.

  • The next step is either the third or fourth step.

    If the parameter input for the manual step is pass , the process continues to the “Update the home page” step. If the input is fail , the process continues to the “Update a product page” step.

Process CloudBees CD/RO Details

After starting the deployment, the .war file is automatically retrieved in the first step.

In the second step, email notifications are sent to one or more assignees. One of the required assignees performs the manual task, which is to log into a terminal and enter the appropriate CLI commands to set up the website update. After clicking on the link in the email, the assignee goes to the CloudBees CD/RO UI and provides input to the manual process step using the pass_fail_value parameter.

  • If the assignee has admin privileges, the value of the pass_fail_value parameter is pass .

    The process continues to the “Update the home page” step.

  • If the assignee does not have admin privileges, the value is fail . The process continues to the “Update a product page” step.

In the third and fourth steps:

  • The On Error setting is Continue running.

    If the process encounters an error while the web page is being updated, it completes the step with errors and then continues to next step. The default is Stop running, where the process will abort if the process encounters an error.

  • The Run if setting is all (the default). All the preconditions to the step have to be met before the process goes to the next step.

    If any is selected, only one of the conditions has to be met before the process continues running.

Deployment Scenarios

These are possible deployment scenarios.

Assignee has admin privileges and the deployment is completed successfully

The home page is updated in this scenario. When the Deploy application process is deployed to the QA environment, you can view the progress of the deployment in the "Applications / View Run" page.

Clicking opens the Manual dialog box. Clicking in the Parameters row displays the required parameters on the right side of the dialog box.

If you enter pass in the passOrFail field, select Completed as the Outcome, and click OK, the process continues to the Update the home page step.

The parameter value ( pass ) is used in the precondition to determine the next step in the process flow. It is also passed to the next step.

The step to update the home page is successfully completed. Notice that the Update a product page step is skipped.

In the top row, click the action button and select Job Details. The Job Details page displays.

Clicking in the runCommand row takes you to the log file for that step, which displays the parameter value from the manual step that was passed to the "Update the home page" step.

Assignee does not have admin privileges and the deployment is completed successfully

A product page is updated in this scenario. When the Deploy application process is deployed to the QA environment again, you can view the progress of the deployment in the "Applications / View Run" page. When the process reaches the second step, clicking opens the Manual dialog box.

Clicking in the Parameters row displays the required parameters on the right side of the dialog box.

If you enter fail in the passOrFail field, select Completed as the Outcome, and click OK, the process continues to the Update a product page step.

The parameter value ( fail ) is used in the precondition to determine the next step in the process flow. It is also passed to the next step.

In this deployment, both the Deploy process and the step to update product page are completed successfully.

In the top row, click the action button and select Job Details. The Job Details page displays.

Clicking in the runCommand row takes you to the log file for that step, which displays the parameter value from the manual step that was passed to the "Update the home page" step.

Assignee does not have admin privileges and the deployment is completed with errors

A product page is updated in this scenario. When the Deploy application process is deployed to the QA environment again, you can view the progress of the deployment in the "Applications / View Run" page. When the process reaches the second step, clicking opens the Manual dialog box.

Clicking in the Parameters row displays the required parameters on the right side of the dialog box. If you enter fail in the passORFail field, select Failed as the Outcome, and click OK, the process continues to the "Update a product page" step.

The parameter value ( fail ) is used in the precondition to determine the next step in the process flow. It is also passed to the next step.

In this deployment, the step to update the product page is completed successfully even though the Deploy application was completed with errors. The error is in the second step where the outcome is Failed.

In the top row, click the action button and select Job Details. The Job Details page displays.

Clicking in the runCommand row takes you to the log file for that step, which displays the parameter value from the manual step that was passed to the Update the home page step.