jruby_activiti 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -24
- data/lib/generators/jruby_activiti/install_generator.rb +23 -0
- data/lib/generators/jruby_activiti/templates/Jarfile +3 -0
- data/lib/generators/jruby_activiti/templates/activiti.cfg.xml +14 -0
- data/lib/generators/jruby_activiti/templates/initializer.rb +1 -0
- data/lib/jruby_activiti.rb +5 -4
- data/lib/jruby_activiti/version.rb +1 -1
- data/test/base_test.rb +2 -0
- metadata +13 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88fe51b4ed2c04232d92bc1876ca89d8547cb207
|
4
|
+
data.tar.gz: f5d2e57e70c3a010b9c50613890627f9eb47159a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d11d634bd2999bce04da6af15ca66456e61fe734529b1852e2490d1121690f847244a2c8e0f39042062c807c921de580f3d2c537374413876238fa261dee29b
|
7
|
+
data.tar.gz: d87b7de71a35208d3a72291fee532bde2d407368e45b4043a3a84aa3180e292d11b79743b05f58ed14aa74b2b73db0c080a17c58a03b90057973729d1c08e9c4
|
data/README.md
CHANGED
@@ -13,39 +13,26 @@ Add this line to your application's Gemfile:
|
|
13
13
|
gem 'jruby_activiti'
|
14
14
|
```
|
15
15
|
|
16
|
-
|
16
|
+
Run the `bundle install` command to install it.
|
17
17
|
|
18
|
-
|
19
|
-
jar 'org.activiti:activiti-engine', '~> 5.18'
|
20
|
-
jar 'org.slf4j:slf4j-log4j12', '>= 1.7'
|
21
|
-
jar 'com.h2database:h2', '>= 1.4'
|
22
|
-
```
|
18
|
+
After you install and add it to your Gemfile, you need to run the generator:
|
23
19
|
|
24
|
-
And then execute:
|
25
20
|
```
|
26
|
-
|
27
|
-
$ jbundle install
|
21
|
+
rails g jruby_activiti:install
|
28
22
|
```
|
29
23
|
|
30
|
-
|
24
|
+
It will create 3 files, edit the config/activiti.cfg.xml as your need.
|
31
25
|
|
32
|
-
Create activiti config file. `config/activiti.cfg.xml`
|
33
26
|
```
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
|
39
|
-
<property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
|
40
|
-
<property name="jdbcDriver" value="org.h2.Driver" />
|
41
|
-
<property name="jdbcUsername" value="sa" />
|
42
|
-
<property name="jdbcPassword" value="" />
|
43
|
-
</bean>
|
44
|
-
|
45
|
-
</beans>
|
27
|
+
create Jarfile
|
28
|
+
create config/activiti.cfg.xml
|
29
|
+
create config/initializers/jruby_activiti.rb
|
46
30
|
```
|
47
31
|
|
48
|
-
|
32
|
+
And then execute `jbundle install`
|
33
|
+
|
34
|
+
## Usage
|
35
|
+
You can access Activiti directly by using `ActivitiEngine`. For example, in a Rails controller
|
49
36
|
|
50
37
|
```
|
51
38
|
repositoryService = ActivitiEngine.getRepositoryService()
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rails/generators/base'
|
2
|
+
|
3
|
+
module JrubyActiviti
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
|
8
|
+
desc "Creates a initializer and copy config files to your application."
|
9
|
+
|
10
|
+
def create_jarfile
|
11
|
+
copy_file "Jarfile", "Jarfile"
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_config
|
15
|
+
copy_file "activiti.cfg.xml", "config/activiti.cfg.xml"
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_initializer_file
|
19
|
+
copy_file "initializer.rb", "config/initializers/jruby_activiti.rb"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<beans xmlns="http://www.springframework.org/schema/beans"
|
2
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
3
|
+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
4
|
+
|
5
|
+
<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
|
6
|
+
<property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
|
7
|
+
<property name="jdbcDriver" value="org.h2.Driver" />
|
8
|
+
<property name="jdbcUsername" value="sa" />
|
9
|
+
<property name="jdbcPassword" value="" />
|
10
|
+
|
11
|
+
<property name="databaseSchemaUpdate" value="true" />
|
12
|
+
</bean>
|
13
|
+
|
14
|
+
</beans>
|
@@ -0,0 +1 @@
|
|
1
|
+
ActivitiEngine = JrubyActiviti.get_engine
|
data/lib/jruby_activiti.rb
CHANGED
@@ -4,10 +4,11 @@ require "jbundler"
|
|
4
4
|
Bundler.require "activiti-engine"
|
5
5
|
|
6
6
|
ActivitiConfigPath ||= "config/activiti.cfg.xml"
|
7
|
-
configuration = Java::OrgActivitiEngine::ProcessEngineConfiguration.
|
8
|
-
createProcessEngineConfigurationFromResource(ActivitiConfigPath)
|
9
|
-
ActivitiEngine = configuration.buildProcessEngine
|
10
7
|
|
11
8
|
module JrubyActiviti
|
12
|
-
|
9
|
+
def self.get_engine
|
10
|
+
configuration = Java::OrgActivitiEngine::ProcessEngineConfiguration.
|
11
|
+
createProcessEngineConfigurationFromResource(ActivitiConfigPath)
|
12
|
+
configuration.buildProcessEngine
|
13
|
+
end
|
13
14
|
end
|
data/test/base_test.rb
CHANGED
metadata
CHANGED
@@ -1,38 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby_activiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- richfisher
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: minitest
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '5.8'
|
20
|
-
|
19
|
+
name: minitest
|
21
20
|
prerelease: false
|
21
|
+
type: :development
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: jbundler
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '0.9'
|
34
|
-
|
33
|
+
name: jbundler
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
@@ -54,6 +54,10 @@ files:
|
|
54
54
|
- README.md
|
55
55
|
- Rakefile
|
56
56
|
- jruby_activiti.gemspec
|
57
|
+
- lib/generators/jruby_activiti/install_generator.rb
|
58
|
+
- lib/generators/jruby_activiti/templates/Jarfile
|
59
|
+
- lib/generators/jruby_activiti/templates/activiti.cfg.xml
|
60
|
+
- lib/generators/jruby_activiti/templates/initializer.rb
|
57
61
|
- lib/jruby_activiti.rb
|
58
62
|
- lib/jruby_activiti/version.rb
|
59
63
|
- test/VacationRequest.bpmn20.xml
|
@@ -64,7 +68,7 @@ homepage: https://github.com/richfisher/jruby_activiti
|
|
64
68
|
licenses:
|
65
69
|
- MIT
|
66
70
|
metadata: {}
|
67
|
-
post_install_message:
|
71
|
+
post_install_message:
|
68
72
|
rdoc_options: []
|
69
73
|
require_paths:
|
70
74
|
- lib
|
@@ -79,9 +83,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
83
|
- !ruby/object:Gem::Version
|
80
84
|
version: '0'
|
81
85
|
requirements: []
|
82
|
-
rubyforge_project:
|
86
|
+
rubyforge_project:
|
83
87
|
rubygems_version: 2.4.8
|
84
|
-
signing_key:
|
88
|
+
signing_key:
|
85
89
|
specification_version: 4
|
86
90
|
summary: Interact with Activiti BPM in JRuby, https://github.com/richfisher/jruby_activiti
|
87
91
|
test_files:
|