activiti-ruby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/activiti-ruby.gemspec +1 -1
- data/lib/activiti/activiti_api.rb +13 -15
- metadata +3 -3
data/activiti-ruby.gemspec
CHANGED
@@ -1,56 +1,54 @@
|
|
1
1
|
require 'rest_client'
|
2
|
+
require 'uri'
|
2
3
|
require "active_support/core_ext"
|
3
4
|
|
4
5
|
module ActivitiRuby
|
5
6
|
class Activiti
|
6
7
|
|
7
8
|
def initialize(endpoint)
|
8
|
-
@uri =
|
9
|
-
end
|
10
|
-
def url(user='ADMIN')
|
11
|
-
return @uri+"/activiti-rest/service/"
|
9
|
+
@uri = endpoint+"/activiti-rest/service/"
|
12
10
|
end
|
13
11
|
def listProcess
|
14
|
-
RestClient.get
|
12
|
+
RestClient.get @uri+'process-definitions'
|
15
13
|
end
|
16
14
|
|
17
15
|
def listProcessInstances(processKey)
|
18
|
-
RestClient.get
|
16
|
+
RestClient.get @uri+'process-instances'
|
19
17
|
end
|
20
18
|
def listGroupUsers(group)
|
21
|
-
RestClient.get
|
19
|
+
RestClient.get @uri+'groups/'+group+'/users'
|
22
20
|
end
|
23
21
|
|
24
22
|
def listJobs
|
25
|
-
RestClient.get
|
23
|
+
RestClient.get @uri+'management/jobs'
|
26
24
|
end
|
27
25
|
|
28
26
|
def instanciateProcess (processKey,user,group)
|
29
|
-
RestClient.post
|
27
|
+
RestClient.post @uri+'process-instance', {'processDefinitionKey' => processKey, 'owner' => user}.to_json
|
30
28
|
end
|
31
29
|
|
32
30
|
def instanceInformations(instanceId)
|
33
|
-
RestClient.get
|
31
|
+
RestClient.get @uri+'processInstance/'+instanceId
|
34
32
|
end
|
35
33
|
|
36
34
|
def taskInformations(taskId)
|
37
|
-
RestClient.get
|
35
|
+
RestClient.get @uri+'task/'+taskId
|
38
36
|
end
|
39
37
|
|
40
38
|
def performTask(taskId,state, params,group)
|
41
|
-
RestClient.put
|
39
|
+
RestClient.put @uri+'task/'+taskId+'/'+state, params.to_json
|
42
40
|
end
|
43
41
|
|
44
42
|
def login(userId,password)
|
45
|
-
RestClient.post
|
43
|
+
RestClient.post @uri+'login', {'userId' => userId, 'password' => password}.to_json, :content_type => 'application/json'
|
46
44
|
end
|
47
45
|
|
48
46
|
def getForm(taskId)
|
49
|
-
RestClient.get
|
47
|
+
RestClient.get @uri+'form/'+taskId+'/properties'
|
50
48
|
end
|
51
49
|
|
52
50
|
def getDiagram(instanceId)
|
53
|
-
RestClient.get
|
51
|
+
RestClient.get @uri+'processInstance/'+instanceId+'/diagram'
|
54
52
|
end
|
55
53
|
|
56
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activiti-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-08-08 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
|
-
requirement: &
|
16
|
+
requirement: &10340268 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 1.6.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10340268
|
25
25
|
description: A Ruby library to interact with an activiti instance (a BPM engine),
|
26
26
|
see http://activiti.org/
|
27
27
|
email: descl@zouig.org
|