Coder Social home page Coder Social logo

hinagiku / jruby_activiti Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richfisher/jruby_activiti

0.0 2.0 0.0 1.44 MB

Integrate Activiti BPM in JRuby/Rails, including Activiti Engine, Modeler and Diagram Viewer.

License: MIT License

Ruby 0.55% Java 2.23% HTML 4.97% JavaScript 89.52% CSS 2.73%

jruby_activiti's Introduction

JrubyActiviti

Integrate Activiti BPM in JRuby/Rails, including Activiti Engine, Modeler and Diagram Viewer.

Online demo: https://jruby-activiti-demo.herokuapp.com/activiti

Test Environment

JRuby-9.0.4.0, Activiti-5.19.0

Installation

Edit your application's Gemfile, add gem 'jruby_activiti', and must remove gem 'therubyrhino' line.

Run the bundle install command to install it.

You need to run the generator:

rails g jruby_activiti:install

It will create 4 files, edit the log4j.properties, config/activiti.cfg.xml as your need.

create  Jarfile
create  config/log4j.properties
create  config/activiti.cfg.xml
create  config/initializers/jruby_activiti.rb
route   mount JrubyActiviti::Web => '/activiti' if defined?(JrubyActiviti)

Add db jar in Jarfile. Example: jar 'com.h2database:h2', '>= 1.4'

And then execute jbundle install

Usage

You can access Activiti directly by using Activiti. For example, in a Rails controller

# Activiti::Engine
# Activiti::RepositoryService
# Activiti::RuntimeService
# Activiti::TaskService
# Activiti::ManagementService
# Activiti::IdentityService
# Activiti::HistoryService
# Activiti::FormService

Activiti::RepositoryService.createDeployment().
  addClasspathResource("config/your_bpm_xml_file.bpmn20.xml").
  deploy()

Enable Activiti Modeler and Diagram Viewer in Rails

visit localhost:3000/activiti

Modeler /activiti/modeler.html?modelId=your_model_id

View Process Definition in Diagram Viewer /activiti/diagram-viewer/index.html?processDefinitionId=v1

View Process Instance in Diagram Viewer /activiti/diagram-viewer/index.html?processDefinitionId=v1&processInstanceId=v2

Known Issues

  1. NoMethodError: undefined method `useMozillaStackStyle' for Java::OrgMozillaJavascript::RhinoException:Class

org.activiti:activiti-modeler includes org.apache.xmlgraphics:batik-transcoder, that depends on outdated org.mozilla:rhino, which conflicts with rubygem therubyrhino. So you must to install nodejs in your machine and comment gem 'therubyrhino' in Gemfile.

Contributing

  1. Fork it ( https://github.com/richfisher/jruby_activiti/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.