Hello everyone,
I have gotten my issue down to a fairly simple case.
I use the Activiti business process engine from ruby which then calls
back to and callback method. I am using JBundler to require the activiti
jar file. The business process engine loads a class specified in the
process description (in
org/activiti/test/VacationRequestWithListener.bpmn20.xml). I use maven
to build a jar file that satisfies the requirement (in
src/main/java/RubySequenceEventListener.java) which is generated from a
ruby file by jruby --java ruby_sequence_event_listener.rb. From that
.java file I added in:
import org.activiti.engine.delegate.*;
implements ExecutionListener
and
public void notify(DelegateExecution execution) throws Exception
{
System.out.println(“in ruby activity listener”);
}
When I run activiti.rb I get the following output:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
further details.
Number of process definitions: 1
in ruby activity listener
hello, world
Number of process instances: 1
task available: Handle vacation request
vacation request denied
kermit's tasks
task available: Adjust vacation request
What I want is to get back into ruby and I am not sure how to do that. I
am in an instance of a ruby class, but it probably wasn’t constructed
right to call back into the running jruby instance. I thought of using
the scripting container, but I think that that would get me into a
different jruby instance than the one that called the activiti jar file.
If you want to try this setup, I have created a small project on github
with all the necessary files at:
GitHub - boberetezeke/jruby-activiti. After you clone it, then
- create a gemset and switch to it (if you are using rvm)
- gem install jbundler --version 0.5.5
- gem install bundler
- jbundle install
- mvn install
- ruby activiti.rb
Thanks for any help that you can give!
Steve
–
“You must be the change you want to see in the world.” Mahatma Gandhi
blog: http://steve.stewdle.com/blog
twitter: @boberetezeke