[workflow-plugin] How to reference workflow steps in a class?

49 views
Skip to first unread message

Jos Backus

unread,
Feb 18, 2015, 6:18:03 PM2/18/15
to jenkins...@googlegroups.com
Hi,

How does one reference workflow steps like sh and build from inside an instance method? Using them unqualified yields a no method error.

Thanks,
Jos

Baptiste Mathus

unread,
Feb 19, 2015, 3:25:25 AM2/19/15
to jenkins...@googlegroups.com

Should/couldn't you pass this from the base context to your instance method and then do something like ctx.sh in that method (with ctx=this when creating your instance)

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ba4ef6ef-80db-4530-b79a-321d518b66ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jos Backus

unread,
Feb 20, 2015, 12:16:06 AM2/20/15
to jenkins...@googlegroups.com
I tried that as I saw someone else suggest that, but I could not get it to work. Then I found somewhere in the Github docs that this doesn't work, presumably because serializing Groovy classes isn't supported. So I ended up using a closure for the effect I was after, and that worked.

Thanks for trying to help!

Jesse Glick

unread,
Feb 26, 2015, 11:54:09 AM2/26/15
to jenkins...@googlegroups.com
On Wednesday, February 18, 2015 at 6:18:03 PM UTC-5, Jos Backus wrote:
How does one reference workflow steps like sh and build from inside an instance method? Using them unqualified yields a no method error.

Reply all
Reply to author
Forward
0 new messages