Hello
Here is our context:
- Conf_A triggers Conf_B and passes a variable V1 to Conf_B through the triggered step
- Conf_B uses V1 in its build description. Say the description is: "build_B is ${vars.getValue("V1")}"
- With a plugin (Tab plugin), from Conf_A we get the description of Conf_B steps. The problem is that the description is not properly evaluated. At the end we get: "build_B is ". The V1 value is missing.
We guess it's because Conf_A does not know the Context of Conf_B so V1 is unknown.
Here is a part of the code of our plugin:
public ArrayList GetErrors(Build b)
{
GetErrorsInternal(b);
return errors;
}
private void GetErrorsInternal(Build b)
{
for(Step s : b.getSteps())
{
if(s.getClass().getSimpleName().contains("TriggerBuildStep") && s.isFailed())
{
Build TriggeredBuild = Quickbuild.getInstance().getBuildManager().load((Long) s.getRuntime().getCustomData());
GetErrors(TriggeredBuild);
}
else
{
if(s.isFailed() && !s.getErrorMessage().contains("success condition"))
{
String description = s.getDescription(); // problem HERE. Description is not evaluated.
So from build_A, we get description of build's steps that have been triggered.
We tried many things (altering the Context, using "DefaultScriptEngine.instance.evaluate" to evaluate the description from another Context, etc.) but we never managed to get the correct description...
Would you have any suggestion?
Thanks a lot
Mathieu
- solved #2
- replies 2
- views 3056
- stars 0