Example: Manual step with runtime parameters

5 minute readReferenceAutomation

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.

Update step
Figure 1. Update 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.

When you reject a manual task or process step at runtime, if you pass at least one parameter, validation requires you to pass values for all required parameters. If you do not pass a parameter, validation does not occur, even when parameters are required.

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.

    Application process step
    Figure 2. Application process step

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.

Application view run
Figure 3. Application view run

Clicking Manual opens the Manual dialog box. Clicking View details 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.

Update home page step
Figure 4. Update 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.

Update page skipped
Figure 5. Update page skipped

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

Job details
Figure 6. Job details

Clicking Log 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.

Manual step
Figure 7. Manual 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 Manual opens the Manual dialog box.

Clicking View details 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.

Completed outcome
Figure 8. Completed outcome
Job details
Figure 9. Job details

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.

Successful process step
Figure 10. Successful process step

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

no privileges job details success.png
Figure 11. Job details

Clicking Log 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.

Successful parameter value
Figure 12. Successful parameter value

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 Manual opens the Manual dialog box.

Clicking View details 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.

Failed outcome
Figure 13. Failed outcome
Fail parameter value
Figure 14. Fail parameter value

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.

Completed with errors
Figure 15. Completed with errors

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

Clicking Log 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.

Parameter value from manual step
Figure 16. Parameter value from manual step