KBEC-00360 - Using Context-Relative Shortcuts to Properties on Pipelines and related objects

Summary

Shortcuts in ElectricFlow provide convenient runtime access to a property without knowing the exact name of the object that owns the property. Starting with ElectricFlow versions 7.0.2 and 7.2, pipeline-specific shortcuts to property paths that provide convenient runtime access include:

  • myPipelineRuntime
  • myStageRuntime
  • myTaskRuntime
  • myGateRuntime

These shortcuts can be used to configure a stage or task to run conditionally. They can be also used in the evaluation condition of an automated gate rule. Here are some sample JavaScript expressions depicting usage of these shortcuts.

Check the outcome of a task in the current stage

$[/javascript myStageRuntime.tasks.task1.outcome == "success"]

Where:

“task1” is the name of the task for which you want the outcome.

Check the outcome of a task in a different stage

$[/javascript myPipelineRuntime.stages.dev.tasks.task1.outcome == "success"]

Where:

“dev” is the stage name.

“task1” is the name of the task for which you want the outcome.

Get the application deployment details from a previous task in the same stage

$[/javascript myStageRuntime.tasks.task1.subapplication]
$[/javascript myStageRuntime.tasks.task1.environmentName]

Where:

 “task1” is the name of the task invoking the application process.

Activate a gate rule only if a previous gate rule was successful

$[/javascript myGateRuntime.tasks["run tests"].outcome ==" success"]

Where:

 “run tests” is the name of the gate rule.

 *Note the variation in syntax when a task name contains a space.

Get the status of a gate rule while in a stage task

$[/javascript myPipelineRuntime.stages.dev.gates.PRE.tasks.task1.outcome]
$[/javascript myPipelineRuntime.stages.dev.gates.POST.tasks.task1.outcome]

Where:

“dev” is the stage name.

“task1” is the name of the task for which you want the status.

“PRE” and “POST” are the gate types.

Access a property created on a job started by a task

$[/javascript myPipelineRuntime.stages.dev.tasks.task1.job.propertyName]

Where:

“dev” is the stage name.

“task1” is the name of the task invoking the procedure or process.

Access a property created on a workflow started by a task

$[/javascript myPipelineRuntime.stages.dev.tasks.task1.workflow.propertyName]

Where:

“dev” is the stage name.

“task1” is the name of the task that invokes the workflow.

Set an evidence property in a condition-based automated gate rule

$[/javascript
        setProperty("/myTaskRuntime/evidence", "test value")
        true;
]

The evidence property appears as a comment after the task has completed.

Set an evidence property in a procedure-based automated gate rule

ectool setProperty "/myTaskRuntime/evidence" --value "test value"
Have more questions? Submit a request

Comments

Powered by Zendesk