x
login Signup

How to set Runcondition of a step to "0" at run time

Does this .perl script is right to achieve the required change

 my $ec = new ElectricCommander;
 
 my $run= $ec->getStep ("$proj", "$proc",
                                     "$stepName")->findnodes("//Run Condition");
 
 
 $ec->modifyStep ("$proj", "$proc", "$stepName",
                               {run=> "0",
                               }

avatar image By geetha.a 0 asked Dec 13, 2018 at 05:56 PM
more ▼
(comments are locked)
10|750 characters needed characters left

3 answers: sort voted first

The run condition API field is "condition", not "run". What you have means that the next time the procedure is run, the step in question will be skipped. Is that what you are trying to accomplish?

avatar image By gregm 2k answered Dec 13, 2018 at 06:58 PM
more ▼
(comments are locked)
10|750 characters needed characters left

As Greg mentioned, the name of the attribute to change is "condition" not "run"

Also, you don't really need the first command as you don't do anything with the result.

What is your exact use case? Are you trying to disable that step for a long time or is it something you may want to change on a regular basis? Maybe using a checkbox parameter to enable/disable the step at runtime is a better venue.

avatar image By lrochette 5.9k answered Dec 13, 2018 at 07:19 PM
more ▼
(comments are locked)
avatar image geetha.a Dec 13, 2018 at 07:29 PM

Thank you Rochette and Greg.

I need this to be set permanently. Since I can't delete this step across all 1000+ procs individually , I just want to disable this step.

Thanks, Geetha

10|750 characters needed characters left

you could loop very easily across projects and procedures using our API to delete or disable a step

Here is an outline of a DSL script (tested but the delete step is commneted for saety):

getProjects().each {proj -> if (! proj.pluginName) {

 def pName=proj.projectName
 println "Processing $pName"
   getProcedures(projectName: pName).each { proc ->
     def procName=proc.procedureName
       println "   Processing procedure $procName"
       getSteps(projectName: pName, procedureName: procName).each { st->
         def stName=st.stepName
         println "       Processing step $stName"
         if (stName.equals("my step to delete")) {
           println "deleteStep(projectName: $pName, procedureName: $procName, stepName: $stName"
           //deleteStep(projectName: pName, procedureName: procName, stepName: stName
         }
     }
 }

} }

avatar image By lrochette 5.9k answered Dec 13, 2018 at 08:52 PM
more ▼
(comments are locked)
10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question


Topics:

x1007
x35
x31

asked: Dec 13, 2018 at 05:56 PM

Seen: 52 times

Last Updated: Dec 14, 2018 at 06:41 AM

Related Questions