BF API: Cron.updateBuildEnvEntryValue exception
I hope someone can help...
When running the following code, the cron.updateBuildEnvEntryValue throws an exception if the second argument is anything but a literal string. The uncommented line of cron.updateBuildEnvEntryValue where the second argument is a String variable, causes the exception to be thrown (below the code snippet). The commented line (with literal "myClusterName") does not cause exception, and I see the correct value when looking at the Schedule in BuildForge. From the Javadocs, it seems any validly formed String should satisfy the requirement for the second argument, so not sure why a String variable with non-zero length value is not considered a 'valid value' Cron cron; com.buildforge.services.common.api.APIException: A valid Value must be specified. at com.buildforge.services.client.api.APIClientConnection.call(APIClientConnection.java:607) at com.buildforge.services.client.dbo.Cron.updateBuildEnvEntryValue(Cron.java:221) at com.buildforge.services.client.dbo.Cron.updateBuildEnvEntryValue(Cron.java:201) at com.myorg.BFDeploy.setWebSphereEnvVars(BFDeploy.java) at com.myorg.BFDeploy.doDeploy(BFDeploy.java) at com.myorg.BFDeploy.main(BFDeploy.java:495) Any help is greatly appreciated! Regards, |
2 answers
Is the build env entry in question a pulldown variable (i.e.: an enumerated choice variable)? The code path I can see that would give you that error comes from an attempt to set a variable to a value that is not part of its options. I presume your magic "myClusterName" value IS part of the choice list for that variable, and thus why that value works while others do not.
-steve I hope someone can help... |
Is the build env entry in question a pulldown variable (i.e.: an enumerated choice variable)? Yes, it is a pulldown and was behaving exactly as you described. I have corrected what I was passing as the value, and now I no longer get the Exception. A million 'thank yous'! Regards, Ron |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.