<< Back to previous view |
[QB-2177] QB can't handle a getChildren call for a step that has no children
|
|
Status: | Closed |
Project: | QuickBuild |
Component/s: | None |
Affects Version/s: | 5.1.30 |
Fix Version/s: | None |
Type: | Bug | Priority: | Major |
Reporter: | SH | Assigned To: | Robin Shen |
Resolution: | Fixed | Votes: | 0 |
Remaining Estimate: | Unknown | Time Spent: | Unknown |
Original Estimate: | Unknown | ||
Environment: | Linux, |
Description |
groovy.lang.MissingMethodException: No signature of method: com.pmease.quickbuild.plugin.basis.ScriptStep.getStepChildNames() is applicable for argument types: () values: []
Doing something like "system.getConfigurationManager().get('root').getStep('myStep').getStepChildNames()" fails with the above error when looking to see which steps have children. If the step has children, it works fine. It should just return 0 children. |
Comments |
Comment by Robin Shen [ 12/Sep/14 12:26 AM ] |
The leaf step is a different class than the container step, and method "getChildStepNames()" only exists in container step. To check if the step has any children, first check if it is a container step, then further check if contains any child steps as below:
groovy: def mystep = system.configurationManager.get("root").getStep("mystep"); if ((mystep instanceof com.pmease.quickbuild.stepsupport.CompositeStep) && !mystep.childStepNames.isEmpty()) { // there are child steps } |