I think it is failing on the call to the generateXML() method - is it 
defined in your job and how is it defined, what parameters does it expect?

BTW, be aware that the Groovy 'Eval' will allow anyone to execute whatever 
Groovy code they would like to put in the input parameter. This line:

def inputMap = Eval.me("$input") 

Your local IT security people may not like this :-)

Have you considered passing the List/Map as a JSON structure on the input? 
Seems safer, unless there is a better way to secure the groovy eval.

--Bill

On Sunday, 26 March 2017 20:06:16 UTC+1, ok999 wrote:
>
> hi, 
>
> Can anyone let me know me, what is wrong here. I have the pipeline script, 
> and i am trying to pass a string parameter when the job is triggered. The 
> parameter will then be converted into a List of maps, so that i can iterate 
> through it. 
>
> Here is what i am trying:
>
>
> String input = "$objectListParameter"  //This is from the job's input 
> String parameter
> println input 
> def inputMap = Eval.me("$input")  
> def objectList=[]     //initialize an empty List
> objectList << inputMap  
> println objectList
> println objectList.getClass()
> //call the method
> generateXML(objectList)  // This is the method marked with @NonCPS
>
>
>
> The input parameter, ($objectListParameter) looks something like this: 
>
> [[name: 'a', file: 'fileA' , objectName: 'wf_A' , objectType: 'workflow', 
> sourceRepository: 'DEV2', folderNames: [srcFolder1: 'TgtFolder1', 
> srcFolder2: 'TgtFolder2']],[ name: 'B' , file: 'fileB' , objectName: 'wf_B' 
> , objectType: 'workflow', sourceRepository: 'DEV2', folderNames: 
> [srcFolder4: 'TgtFolder4', srcFolder3: 'TgtFolder3']]]
>
>
> In the jenkins console Log, this the snippet 
>
>
>
>
>
> [Pipeline] echo[[name: 'a', file: 'fileA' , objectName: 'wf_A' , objectType: 
> 'workflow', sourceRepository: 'DEV2', folderNames: [srcFolder1: 'TgtFolder1', 
> srcFolder2: 'TgtFolder2']],[ name: 'B' , file: 'fileB' , objectName: 'wf_B' , 
> objectType: 'workflow', sourceRepository: 'DEV2', folderNames: [srcFolder4: 
> 'TgtFolder4', srcFolder3: 'TgtFolder3']]][Pipeline] echo[[{name=a, 
> file=fileA, objectName=wf_A, objectType=workflow, sourceRepository=DEV2, 
> folderNames={srcFolder1=TgtFolder1, srcFolder2=TgtFolder2}}, {name=B, 
> file=fileB, objectName=wf_B, objectType=workflow, sourceRepository=DEV2, 
> folderNames={srcFolder4=TgtFolder4, srcFolder3=TgtFolder3}}]][Pipeline] 
> echoclass java.util.ArrayList[Pipeline] }[Pipeline] // node[Pipeline] End of 
> Pipelinehudson.remoting.ProxyException: groovy.lang.MissingMethodException: 
> No signature of method: 
> WorkflowScript$_generateXML_closure1$_closure2$_closure3$_closure4$_closure5$_closure6$_closure9.doCall()
>  is applicable for argument types: (java.util.LinkedHashMap) values: 
> [[srcFolder1:TgtFolder1, srcFolder2:TgtFolder2]]
> Possible solutions: doCall(java.lang.Object, java.lang.Object), findAll(), 
> findAll(), isCase(java.lang.Object), isCase(java.lang.Object)
>       at 
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:286)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
>       at groovy.lang.Closure.call(Closure.java:414)
>       at groovy.lang.Closure.call(Closure.java:430)
>       at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
>       at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
>       at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
>       at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
>       at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ba367247-dca5-43e4-8f8f-b6e4700ce6f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to