public
Description: the [OpenWFEru] workflow and BPM engine (ruby)
Homepage: http://openwferu.rubyforge.org
Clone URL: git://github.com/jmettraux/ruote.git
dropped lookup_comma_list_attribute in favour of lookup_array_attribute
jmettraux (author)
Thu May 08 00:53:37 -0700 2008
commit  8417ba8ec3ec49dca00d47d58ef7c6206157ef2d
tree    c5c5f6d969e330876a4aaa90aea3f0bb4c7adb7b
parent  87ccf5ba34cf58325e576e93223bff7e8642d06d
...
1
2
3
 
4
5
6
...
131
132
133
134
 
135
136
137
...
1
2
 
3
4
5
6
...
131
132
133
 
134
135
136
137
0
@@ -1,6 +1,6 @@
0
 #
0
 #--
0
-# Copyright (c) 2007, John Mettraux, OpenWFE.org
0
+# Copyright (c) 2007-2008, John Mettraux, OpenWFE.org
0
 # All rights reserved.
0
 #
0
 # Redistribution and use in source and binary forms, with or without
0
@@ -131,7 +131,7 @@ module OpenWFE
0
             #
0
             def lookup_disallow (workitem)
0
 
0
- lookup_comma_list_attribute(A_DISALLOW, workitem)
0
+ lookup_array_attribute A_DISALLOW, workitem
0
             end
0
     end
0
 
...
447
448
449
450
 
451
452
 
453
454
 
455
456
457
...
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
...
447
448
449
 
450
451
 
452
453
 
454
455
456
457
...
503
504
505
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
507
508
0
@@ -447,11 +447,11 @@ module OpenWFE
0
         # (probably a string) will split it (comma) and return it
0
         # (each element trimmed).
0
         #
0
- def lookup_array_attribute (attname, workitem, default=nil)
0
+ def lookup_array_attribute (attname, workitem, options={})
0
 
0
- v = lookup_attribute attname, workitem
0
+ v = lookup_attribute attname, workitem, options
0
 
0
- return default unless v
0
+ return nil unless v
0
 
0
             return v if v.is_a?(Array)
0
 
0
@@ -503,36 +503,6 @@ module OpenWFE
0
         end
0
 
0
         #
0
- # For an expression like
0
- #
0
- # iterator :on_value => "a, b, c", to-variable => "v0" do
0
- # # ...
0
- # end
0
- #
0
- # this call
0
- #
0
- # lookup_comma_list_attribute(:on_value, wi)
0
- #
0
- # will return
0
- #
0
- # [ 'a', 'b', 'c' ]
0
- #
0
- def lookup_comma_list_attribute (attname, workitem, options={})
0
-
0
- a = lookup_attribute(attname, workitem, options)
0
-
0
- return nil if not a
0
-
0
- result = []
0
- a.split(',').each do |elt|
0
- elt = elt.strip
0
- result << elt if elt.length > 0
0
- end
0
-
0
- result
0
- end
0
-
0
- #
0
         # creates a new environment just for this expression
0
         #
0
         def new_environment (initial_vars=nil)
...
109
110
111
112
 
 
113
114
115
116
117
118
119
120
121
...
109
110
111
 
112
113
114
 
 
 
 
 
115
116
117
0
@@ -109,13 +109,9 @@ module OpenWFE
0
             #
0
             def determine_scheduler_tags
0
 
0
- st = lookup_attribute :scheduler_tags, @applied_workitem
0
+ @scheduler_tags = lookup_array_attribute(
0
+ :scheduler_tags, @applied_workitem) || []
0
 
0
- @scheduler_tags = if st
0
- st.split(",").collect { |s| s.strip }
0
- else
0
- []
0
- end
0
                 @scheduler_tags << self.class.name
0
             end
0
     end

Comments

    No one has commented yet.