Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

[Solved] Disable a configuration using a groovy script #3673

Varal ·
Hi Everyone.
I have a flow that requires me to copy a configuration and disable it for the purpose of further operations.
After I copy the configuration I try to disable it using the following code snippet.


groovy:
dstConf = system.getConfigurationManager().get(vars.getValue("dstConfParent") + "/" + vars.getValue("releaseName"))
dstConf.setDisabled(true)


The dstConfParrent is a configuration which will be the parent of the configuration I am copying and releaseName is the name of the child configuration.
If I execute dstConf.getClass() it returns Configuration so I'm assuming my approach is correct.
This code will not throw any errors or warnings but it will not disable the "play" button in the copied configuration. Am I missunderstanding something here? <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
  • replies 3
  • views 1877
  • stars 0
robinshen ADMIN ·
Please call system.configurationManager.save(dstConf) after changing configuration properties.
Varal ·
Thank you robinshen!
This does work however it has a catch.

If the saving gets trigerred from a QB agent you will get the following error:
com.pmease.quickbuild.persistence.UnsupportedAgentOperationException: This operation is not supported at agent side.


The solution for this is to make sure the step gets executed on the QB main server.
robinshen ADMIN ·
Yes that is correct.