Class: Processmaker

Inherits:
Object
  • Object
show all
Defined in:
lib/processmaker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#clientObject

Returns the value of attribute client


6
7
8
# File 'lib/processmaker.rb', line 6

def client
  @client
end

#session_id_tokenObject

Returns the value of attribute session_id_token


6
7
8
# File 'lib/processmaker.rb', line 6

def session_id_token
  @session_id_token
end

Class Method Details

.assign_user_to_department(options = {}) ⇒ Object


102
103
104
105
106
107
108
109
110
# File 'lib/processmaker.rb', line 102

def self.assign_user_to_department(options = {})
	response = @client.call( :assign_user_to_department, message: { 
		sessionId: options[:session_id] || @session_id_token,
		userId: options[:user_id],
		departmentId: options[:department_id],
		manager: options[:manager_id],
	})
	return response.body[:pm_response]
end

.assign_user_to_group(options = {}) ⇒ Object


90
91
92
93
94
95
96
97
# File 'lib/processmaker.rb', line 90

def self.assign_user_to_group(options = {})
	response = @client.call( :assign_user_to_group, message: { 
		sessionId: options[:session_id] || @session_id_token,
		userId: options[:user_id],
		groupId: options[:group_id]
	})
	return response.body[:pm_response]
end

.case_list(options = {}) ⇒ Object

caseList() returns a list of the cases for the logged-in user wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#caseList.28.29


172
173
174
175
176
177
# File 'lib/processmaker.rb', line 172

def self.case_list(options = {})
	response = @client.call( :case_list, message: {
		sessionId: options[:session_id] || @session_id_token,
	})
	return response.body[:case_list_response][:cases]
end

.create_department(options = {}) ⇒ Object


78
79
80
81
82
83
84
85
# File 'lib/processmaker.rb', line 78

def self.create_department(options = {})
	response = @client.call( :create_department, message: { 
		sessionId: options[:session_id] || @session_id_token, 
		name: options[:name],
		parentUID: options[:parent_uid] || ''
	})
	return response.body[:create_department_response]
end

.create_group(options = {}) ⇒ Object


67
68
69
70
71
72
73
# File 'lib/processmaker.rb', line 67

def self.create_group(options = {})
	response = @client.call( :create_group, message: {
		sessionId: options[:session_id] || @session_id_token, 
		name: options[:name]
	})
	return response.body[:create_group_response]
end

.create_user(options = {}) ⇒ Object


51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/processmaker.rb', line 51

def self.create_user(options = {})
	response = @client.call( :create_user, message: { 
		sessionId: options[:session_id] || @session_id_token,
		userId: options[:user_id],
		firstname: options[:first_name],
		lastname: options[:last_name],
		email: options[:email],
		role: options[:role] || 'PROCESSMAKER_OPERATOR',
		password: options[:password]
	})
	return response.body[:create_user_response]
end

.department_list(options = {}) ⇒ Object


31
32
33
34
35
36
# File 'lib/processmaker.rb', line 31

def self.department_list(options = {})
	response = @client.call( :department_list, message: {
		sessionId: options[:session_id] || @session_id_token
	})
	return response.body[:department_list_response][:departments]
end

.execute_trigger(options = {}) ⇒ Object


298
299
300
301
302
303
304
305
306
# File 'lib/processmaker.rb', line 298

def self.execute_trigger(options = {})
	response = @client.call(:execute_trigger, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id],
		triggerIndex: options[:trigger_index],
		delIndex: options[:del_index]
	})
	return response.body[:pm_response]
end

.get_case_info(options = {}) ⇒ Object


192
193
194
195
196
197
198
199
# File 'lib/processmaker.rb', line 192

def self.get_case_info(options = {})
	response = @client.call( :get_case_info, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id],
		delIndex: options[:del_index] || "1"
	})
	return response.body[:get_case_info_response]
end

.input_document_list(options = {}) ⇒ Object

inputDocumentList() returns a list of the uploaded documents for a given case wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#systemInformation.28.29


339
340
341
342
343
344
345
# File 'lib/processmaker.rb', line 339

def self.input_document_list(options = {})
	response = @client.call(:input_document_list, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id]
	})
	return response.body[:input_document_list_response][:documents]
end

.input_document_process_list(options = {}) ⇒ Object

inputDocumentProcessList() returns a list of the Input Document definitions for a given process wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#inputDocumentProcessList.28.29


350
351
352
353
354
355
356
# File 'lib/processmaker.rb', line 350

def self.input_document_process_list(options = {})
	response = @client.call(:input_document_process_list, message: {
		sessionId: options[:session_id] || @session_id_token,
		processId: options[:process_id]
	})
	return response.body[:input_document_process_list_response][:documents]
end

.login(options = {}) ⇒ Object

login() returns a hash with the status_code, message, version and timestamp wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#login.28.29_Web_Service


11
12
13
14
15
16
# File 'lib/processmaker.rb', line 11

def self.(options = {})
	@client = Savon.client(wsdl: options[:wsdl])
	response = @client.call( :login, message: { userid: options[:user_id], password: options[:password] })	
	@session_id_token = response.body[:login_response][:message]
	return response.body[:login_response]
end

.new_case(options = {}) ⇒ Object

newCase() begins a new case under the name of the logged-in user wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#newCase.28.29


204
205
206
207
208
209
210
211
212
213
# File 'lib/processmaker.rb', line 204

def self.new_case(options = {})
	response = @client.call( :new_case, message: {
		sessionId: options[:session_id] || @session_id_token,
		processId: options[:process_id],
		taskId: options[:task_id],
		# TODO: Send variables when starting a case
		variables: options[:variables]
	})
	return response.body[:new_case_response]
end

.new_case_impersonate(options = {}) ⇒ Object

newCaseImpersonate() creates a new case impersonating a user who has the proper privileges to create new cases wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#newCaseImpersonate.28.29


218
219
220
221
222
223
224
225
226
227
# File 'lib/processmaker.rb', line 218

def self.new_case_impersonate(options = {})
	response = @client.call( :new_case_impersonate, message: {
		sessionId: options[:session_id] || @session_id_token,
		processId: options[:process_id],
		taskId: options[:task_id],
		# TODO: Send variables when starting a case
		variables: options[:variables]
	})
	return response.body[:pm_response]
end

.output_document_list(options = {}) ⇒ Object

outputDocumentList() returns a list of the output documents for a given case wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#outputDocumentList.28.29


361
362
363
364
365
366
367
# File 'lib/processmaker.rb', line 361

def self.output_document_list(options = {})
	response = @client.call(:output_document_list, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id]
	})
	return response.body[:output_document_list_response][:documents]
end

.pause_case(options = {}) ⇒ Object


115
116
117
118
119
120
121
122
123
# File 'lib/processmaker.rb', line 115

def self.pause_case(options = {})
	response = @client.call( :pause_case, message: { 
		caseUid: options[:case_uid],
		delIndex: options[:del_index],
		userUid: options[:user_uid],
		unpauseDate: options[:unpause_date],
	})
	return response.body[:pm_response]
end

.process_list(options = {}) ⇒ Object

processList() returns a list of the processes in the current workspace wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#processList.28.29


141
142
143
144
145
146
# File 'lib/processmaker.rb', line 141

def self.process_list(options = {})
	response = @client.call( :process_list, message: {
		sessionId: options[:session_id] || @session_id_token
	})
	return response.body[:process_list_response][:processes]
end

.reassign_case(options = {}) ⇒ Object


232
233
234
235
236
237
238
239
240
241
# File 'lib/processmaker.rb', line 232

def self.reassign_case(options = {})
	response = @client.call( :reassign_case, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id],
		delIndex: options[:del_index],
		userIdSource: options[:user_id_source],
		userIdTarget: options[:user_id_target]
	})
	return response.body[:pm_response]
end

.remove_document(options = {}) ⇒ Object

removeDocument() removes an uploaded or generated document from a case wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#removeDocument.28.29


372
373
374
375
376
377
378
# File 'lib/processmaker.rb', line 372

def self.remove_document(options = {})
	response = @client.call(:remove_document, message: {
		sessionId: options[:session_id] || @session_id_token,
		appDocUid: options[:app_doc_uid]
	})
	return response.body[:pm_response]
end

.role_list(options = {}) ⇒ Object


41
42
43
44
45
46
# File 'lib/processmaker.rb', line 41

def self.role_list(options = {})
	response = @client.call( :role_list, message: {
		sessionId: options[:session_id] || @session_id_token
	})
	return response.body[:role_list_response][:roles]
end

.route_case(options = {}) ⇒ Object


246
247
248
249
250
251
252
253
# File 'lib/processmaker.rb', line 246

def self.route_case(options = {})
	response = @client.call( :route_case, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id],
		delIndex: options[:del_index]
	})
	return response.body[:route_case_response]
end

.send_message(options = {}) ⇒ Object


311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/processmaker.rb', line 311

def self.send_message(options = {})
	response = @client.call(:send_message, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id],
		from: options[:from],
		to: options[:to],
		cc: options[:cc] || "", 
		bcc: options[:bcc] || "",
		subject: options[:subject],
		template: options[:template]
	})
	return response.body[:pm_response]
end

.system_information(options = {}) ⇒ Object

systemInformation() returns information about the WAMP/LAMP stack, the workspace database, the IP number and version of ProcessMaker, and the IP number and version of web browser of the user wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#systemInformation.28.29


329
330
331
332
333
334
# File 'lib/processmaker.rb', line 329

def self.system_information(options = {})
	response = @client.call(:system_information, message: {
		sessionId: options[:session_id] || @session_id_token
	})
	return response.body[:system_information_response]
end

.task_case(options = {}) ⇒ Object

taskCase() returns the current task for a given case wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#taskCase.28.29


161
162
163
164
165
166
167
# File 'lib/processmaker.rb', line 161

def self.task_case(options = {})
	response = @client.call( :task_case, message: {
		sessionId: options[:session_id] || @session_id_token,
		caseId: options[:case_id]
	})
	return response.body[:task_case_response][:task_cases]
end

.task_list(options = {}) ⇒ Object

taskList() returns a list of the tasks to which the logged-in user is assigned wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#taskList.28.29


151
152
153
154
155
156
# File 'lib/processmaker.rb', line 151

def self.task_list(options = {})
	response = @client.call( :task_list, message: {
		sessionId: options[:session_id] || @session_id_token,
	})
	return response.body[:task_list_response][:tasks]
end

.trigger_list(options = {}) ⇒ Object

triggerList() triggerList() returns a list of all the available triggers in a workspace wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#triggerList.28.29


288
289
290
291
292
293
# File 'lib/processmaker.rb', line 288

def self.trigger_list(options = {})
	response = @client.call(:trigger_list, message: {
		sessionId: options[:session_id] || @session_id_token
	})
	return response.body[:trigger_list_response][:triggers]
end

.unassigned_case_list(options = {}) ⇒ Object

unassignedCaseList() returns a list of the unassigned cases which the logged-in user has rights to be assigned to wiki.processmaker.com/index.php/2.0/ProcessMaker_WSDL_Web_Services#unassignedCaseList.28.29


182
183
184
185
186
187
# File 'lib/processmaker.rb', line 182

def self.unassigned_case_list(options = {})
	response = @client.call( :unassigned_case_list, message: {
		sessionId: options[:session_id] || @session_id_token,
	})
	return response.body[:unassigned_case_list_response][:cases]
end

.unpause_case(options = {}) ⇒ Object


128
129
130
131
132
133
134
135
136
# File 'lib/processmaker.rb', line 128

def self.unpause_case(options = {})
	response = @client.call( :unpause_case, message: { 
		caseUid: options[:case_uid],
		delIndex: options[:del_index],
		userUid: options[:user_uid],
		unpauseDate: options[:unpause_date],
	})
	return response.body[:pm_response]
end

.user_list(options = {}) ⇒ Object


21
22
23
24
25
26
# File 'lib/processmaker.rb', line 21

def self.user_list(options = {})
	response = @client.call( :user_list, message: { 
		sessionId: options[:session_id] || @session_id_token
	})
	return response.body[:user_list_response][:users]
end