public
Description: Tempo is a set of runtime components that support human workflow within an service-oriented architecture (SOA)
Homepage: http://tempo.intalio.org
Clone URL: git://github.com/intalio/tempo.git
tempo / rsc / samples / delete_tasks.rb
100755 30 lines (23 sloc) 1.018 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env ruby
load File.dirname(File.expand_path("#{$0}"))+"/lib/sample_tms_client.rb"
 
# create a new tms client
tms_client = SampleTMSClient.new
tms_client.fake_delete = true
 
# sample to delete task by query
# those task have to be accessible by the authenticated user, since the query use the getAvailableTask method on the server
# tms_client.delete_all "PATask", "", false
 
 
# ids = ["9edef9aa63f0e40d:51bb29f8:11fe8f338b8:-7fbf114.48.183.2115602"]
# delete by ids
# task don't have to be accessible by the user, but the user needs to have the rights to delete tasks
# tms_client.delete_by_ids ids
 
# delete all the tasks and their attachments, using ids from the array below
# ids = ["9edef9aa63f0e40d:51bb29f8:11fe8f338b8:-7fbf114.48.183.2115602"]
# ids.each do |id|
# tms_client delete_task(id)
# end
 
 
# to retrieve tasks in mysql, generate a query like:
#
# SELECT id FROM tempo_task t where creation_date < '2009-03-07'
#
# require "active_support"
# puts (Time.now - 3.months).strftime("%Y-%M-%d")