KBEC-00365 - Precondition Examples & Use cases

Summary

Difference between runcondition and precondition. Examples of how precondition can be used.

Solution

Runcondition checks specified condition and step will be run or skip depending if condition is true or false.

Precondition will wait for condition to become true.

Example and Explanation: Usage of precondition in parallel steps.

In this example step1 is configured without precondition and to run in parallel.

Step2 is configured without precondition and in parallel, when it is completed it sets property “step2Completed” - ectool setProperty /myJob/step2Completed complete

Step3 is configured with precondition and in parallel. In precondition it checks for “step2Completed” property before run and waits for it to become “true” (more detailed interpretation of TRUE or FALSE can be found in documentation)

After running such configuration we will see next:

Once dependent conditions will be met step3 will start running.

 

Additional Examples: 

Use case

JavaScript condition

Nested property check(at first evaluates if NewEnvironment is ready and after check for precondition property)

$[/javascript (getProperty("/myProject/NewEnvironment") == "True") ? myJob.InstallerCompleted : " " ]

Simple property check

$[/javascript getProperty("/myJob/status")=="complete"]

 

 

 

Applies to

  • Product versions: 4.2 and higher
Have more questions? Submit a request

Comments

Powered by Zendesk