I mainly write in ruby, while java and jruby fields are new to me. This time I need to write a scripting task which propagates process variables to remote REST service. Basically I need to write a script which reads configuration yaml file to instantiate a connection to remote REST service using Faraday gem, and make a POST request.
Yesterday I spent all day to make my hello world script run in script task in test process. It took so long cause I couldn't find any directions how to make activiti run jruby script. Seems it's obvious to java guys, but to me as rubyist it was very unclear. I managed it, picking bits of relevant info over the Internet. Today I spent to figure out how to install and make Faraday gem available to my test script, where to place gems, shall I set special permissions to gem files, etc, and finally I could `require 'faraday'`. And I'm not sure I did it right way. I still can not use bundler, despite it's installed just like faraday:
export GEM_HOME=/var/lib/tomcat6/shared/gems
export GEM_PATH=/var/lib/tomcat6/shared/gems
java -jar jruby-complete-1.7.21.jar -S gem install bundler
My task fails when I put `require 'rubygems'; require 'bundler/setup' in it. But I think I can get along without it.
I found no tutorial how to make activiti use jruby, how to install gems, how to use Gemfile, nor how to write simple scripts which access process variables. Sad, but true, I stuck in every trivial bit of work.
That is why I'd appreciate for any jruby scripting examples.