activiti-ruby 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README ADDED
@@ -0,0 +1,10 @@
1
+ activiti-ruby by Christophe Desclaux
2
+
3
+ A small Ruby library to interact with an activiti instance over HTTP
4
+
5
+ See examples in the examples/ directory
6
+
7
+ require 'rubygems'
8
+ require 'activiti-ruby'
9
+ instance = ActivitiRuby::Activiti.new 'http://kermit:kermit@localhost:8080/'
10
+ instance.listProcess
@@ -0,0 +1,13 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "activiti-ruby"
3
+ s.version = "0.0.1"
4
+ s.date = "2012-08-08"
5
+ s.summary = "Activiti Ruby library"
6
+ s.email = "descl@zouig.org"
7
+ s.homepage = "https://github.com/descl/activiti-ruby"
8
+ s.description = "A Ruby library to interact with an activiti instance (a BPM engine), see http://activiti.org/"
9
+ s.has_rdoc = true
10
+ s.authors = ['Christophe Desclaux']
11
+ s.files = ["README", "activiti-ruby.gemspec", "lib", "examples", "lib/activiti-ruby.rb", "lib/activiti/activiti_api.rb"]
12
+ s.add_dependency("rest-client", "~> 1.6.7")
13
+ end
@@ -0,0 +1,57 @@
1
+ require 'rest_client'
2
+ require "active_support/core_ext"
3
+
4
+ module ActivitiRuby
5
+ class Activiti
6
+
7
+ def initialize(endpoint)
8
+ @uri = URI.parse endpoint
9
+ end
10
+ def url(user='ADMIN')
11
+ return @uri+"/activiti-rest/service/"
12
+ end
13
+ def listProcess
14
+ RestClient.get url+'process-definitions'
15
+ end
16
+
17
+ def listProcessInstances(processKey)
18
+ RestClient.get url+'process-instances'
19
+ end
20
+ def listGroupUsers(group)
21
+ RestClient.get url+'groups/'+group+'/users'
22
+ end
23
+
24
+ def listJobs
25
+ RestClient.get url+'management/jobs'
26
+ end
27
+
28
+ def instanciateProcess (processKey,user,group)
29
+ RestClient.post url(group)+'process-instance', {'processDefinitionKey' => processKey, 'owner' => user}.to_json
30
+ end
31
+
32
+ def instanceInformations(instanceId)
33
+ RestClient.get url+'processInstance/'+instanceId
34
+ end
35
+
36
+ def taskInformations(taskId)
37
+ RestClient.get url+'task/'+taskId
38
+ end
39
+
40
+ def performTask(taskId,state, params,group)
41
+ RestClient.put url(group)+'task/'+taskId+'/'+state, params.to_json
42
+ end
43
+
44
+ def login(userId,password)
45
+ RestClient.post url+'login', {'userId' => userId, 'password' => password}.to_json, :content_type => 'application/json'
46
+ end
47
+
48
+ def getForm(taskId)
49
+ RestClient.get url+'form/'+taskId+'/properties'
50
+ end
51
+
52
+ def getDiagram(instanceId)
53
+ RestClient.get url+'processInstance/'+instanceId+'/diagram'
54
+ end
55
+
56
+ end
57
+ end
@@ -0,0 +1 @@
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'activiti', 'activiti_api.rb')
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activiti-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Christophe Desclaux
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-08 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rest-client
16
+ requirement: &10354548 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.6.7
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *10354548
25
+ description: A Ruby library to interact with an activiti instance (a BPM engine),
26
+ see http://activiti.org/
27
+ email: descl@zouig.org
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - README
33
+ - activiti-ruby.gemspec
34
+ - lib/activiti-ruby.rb
35
+ - lib/activiti/activiti_api.rb
36
+ homepage: https://github.com/descl/activiti-ruby
37
+ licenses: []
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 1.7.2
57
+ signing_key:
58
+ specification_version: 3
59
+ summary: Activiti Ruby library
60
+ test_files: []