How to handle reactive parameters

5 views
Skip to first unread message

Achille MBOUGUENG

unread,
Mar 7, 2022, 11:14:47 AM3/7/22
to BioUno Users
Hi all, 
Please i need a help

In a Jenkinsfile  i have

[
$class : 'org.biouno.unochoice.CascadeChoiceParameter',
name: 'impacted',
description: 'Environnement impactés',
referencedParameters: 'type,cluster,environment',
omitValueField: true,
script: [
$class: 'GroovyScript',
script: [
classpath: [],
sandbox: true,
script : StacksUtils.listTypeImpactedEnvs(type, cluster, environment)
]
],
choiceType: 'PT_CHECKBOX'
], StacksUtils is a groovy class with
static String listTypeImpactedEnvs(String type, String cluster, String environment) {
return """
if(!environment) {
return ['Selectionner']
}
return ${getTypeImpactedEnvs(type, cluster, environment)};
"""
}

private static String getTypeImpactedEnvs(String type, String cluster, String environment) {
List<Object> environments = StacksInfos.listJahiaEnvironments();
return ["None"];
}
None is never returned. Please any idea on how to achieve this ? Tanks Achille

Bruno P. Kinoshita

unread,
Mar 8, 2022, 1:30:18 AM3/8/22
to BioUno Users
Hi Achille,

Everything looks OK to me. I think in the end your function/script will return an array, which is one of the requirements for the parameter to display the list of values.

Here's one thing you can try, though:

- Move the `return ["None"]` code to the other functions.

For example, I would start by replacing the script of the parameter. If that works, then re-write `StacksUtils.listTypeImpactedEnvs` to return `return ["None"]`.

Keep doing that, and eventually you'll find where the problem is. Alternatively, you can also enable the Jenkins logs (in manage jenkins) using the logger value "org.biouno". That should increase the verbosity of the plug-in logs, and you should have more in the Jenkins output and/or in your browser console.

Let us know if that works,

Bruno

--
You received this message because you are subscribed to the Google Groups "BioUno Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biouno-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biouno-users/e566c9a9-1b82-4530-8a78-48c152d027e7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages