0
# Copyright (c) 2007-2008, John Mettraux, Tomaso Tosolini OpenWFE.org
0
-# Redistribution and use in source and binary forms, with or without
0
+# Redistribution and use in source and binary forms, with or without
0
# modification, are permitted provided that the following conditions are met:
0
# . Redistributions of source code must retain the above copyright notice, this
0
-# list of conditions and the following disclaimer.
0
-# . Redistributions in binary form must reproduce the above copyright notice,
0
-# this list of conditions and the following disclaimer in the documentation
0
+# list of conditions and the following disclaimer.
0
+# . Redistributions in binary form must reproduce the above copyright notice,
0
+# this list of conditions and the following disclaimer in the documentation
0
# and/or other materials provided with the distribution.
0
# . Neither the name of the "OpenWFE" nor the names of its contributors may be
0
# used to endorse or promote products derived from this software without
0
# specific prior written permission.
0
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0
# POSSIBILITY OF SUCH DAMAGE.
0
# John Mettraux at openwfe.org
0
@@ -84,7 +84,6 @@ module Extras
0
t.column :yattributes, :text
0
# when using compact_workitems, attributes are stored here
0
add_index :workitems, :fei, :unique => true
0
add_index :workitems, :wfid
0
@@ -129,19 +128,19 @@ module Extras
0
# wl = OpenWFE::Extras::Workitem.find_all_by_participant_name("toto")
0
# puts "found #{wl.size} workitems for participant 'toto'"
0
- # These workitems are not OpenWFEru workitems directly. But the conversion
0
+ # These workitems are not OpenWFEru workitems directly. But the conversion
0
- # Note that you probaly won't need to do the conversion by yourself,
0
+ # Note that you probaly won't need to do the conversion by yourself,
0
# except for certain advanced scenarii.
0
# awi = OpenWFE::Extras::Workitem.find_by_participant_name("toto")
0
# # returns the first workitem in the database whose participant
0
# owi = awi.as_owfe_workitem
0
- # # Now we have a copy of the reference as a OpenWFEru
0
+ # # Now we have a copy of the reference as a OpenWFEru
0
# # InFlowWorkItem instance.
0
# awi = OpenWFE::Extras::Workitem.from_owfe_workitem(owi)
0
@@ -192,11 +191,11 @@ module Extras
0
i.store_name = store_name
0
- # This is a field set by the active participant immediately
0
+ # This is a field set by the active participant immediately
0
# before calling this method.
0
# the default behavior is "use field method"
0
if wi.attributes["compact_workitems"]
0
wi.attributes.delete("compact_workitems")
0
@@ -245,7 +244,7 @@ module Extras
0
return self.yattributes if self.yattributes
0
- fields.inject({}) do |r, f|
0
+ fields.inject({}) do |r, f|
0
@@ -258,7 +257,7 @@ module Extras
0
def replace_fields (fhash)
0
self.yattributes = fhash
0
@@ -287,7 +286,7 @@ module Extras
0
# wi.field :customer_name
0
return self.yattributes[key.to_s]
0
@@ -326,7 +325,7 @@ module Extras
0
- alias :oldreply :reply
0
+ alias :oldreply :reply
0
@@ -369,7 +368,7 @@ module Extras
0
# when this is used on compact_workitems, it will not be able to search
0
- # info within the fields, because they aren't used by this kind of
0
+ # info within the fields, because they aren't used by this kind of
0
# workitems. In this case the search will be limited to participant_name
0
def self.search (search_string, storename_list=nil)
0
@@ -381,7 +380,7 @@ module Extras
0
:conditions => conditions(
0
"participant_name", search_string, storename_list),
0
:order => "participant_name")
0
@@ -404,16 +403,16 @@ module Extras
0
# Not really about 'just launched', but rather about finding the first
0
# workitem for a given process instance (wfid) and a participant.
0
- # It deserves its own method because the workitem could be in a
0
+ # It deserves its own method because the workitem could be in a
0
# subprocess, thus escaping the vanilla find_by_wfid_and_participant()
0
def self.find_just_launched (wfid, participant_name)
0
- "wfid LIKE ? AND participant_name = ?",
0
+ "wfid LIKE ? AND participant_name = ?",
0
@@ -450,7 +449,7 @@ module Extras
0
- # A workaround is in place for some classes when then have to get
0
+ # A workaround is in place for some classes when then have to get
0
# serialized. The names of thoses classes are listed in this array.
0
SPECIAL_FIELD_CLASSES = [ 'Time', 'Date', 'DateTime' ]
0
@@ -491,7 +490,7 @@ module Extras
0
if v.is_a?(String) and v.length <= limit
0
elsif SPECIAL_FIELD_CLASSES.include?(v.class.to_s)
0
@@ -607,23 +606,23 @@ module Extras
0
# # give some slack to the engine, it's asynchronous after all
0
# wi = OpenWFE::Extras::Workitem.find_by_participant_name("active0")
0
- # It is possible to save all the workitem data into a single table,
0
+ # It is possible to save all the workitem data into a single table,
0
# the workitems table, without
0
- # splitting info between workitems and fields tables.
0
+ # splitting info between workitems and fields tables.
0
- # You can configure the "compact_workitems" behavior by adding to the
0
+ # You can configure the "compact_workitems" behavior by adding to the
0
# active0 = engine.register_participant(
0
# :active0, OpenWFE::Extras::ActiveParticipant)
0
- # active0.compact_workitems = true
0
+ # active0.compact_workitems = true
0
# This behaviour is determined participant per participant, it's ok to
0
# have a participant instance that compacts will there is another that
0
@@ -641,7 +640,7 @@ module Extras
0
attr :compact_workitems, true
0
- # This is the method called by the OpenWFEru engine to hand a
0
+ # This is the method called by the OpenWFEru engine to hand a
0
# workitem to this participant.
0
@@ -700,7 +699,7 @@ module Extras
0
- # This is the method called by the OpenWFEru engine to hand a
0
+ # This is the method called by the OpenWFEru engine to hand a
0
# workitem to this participant.
Comments
No one has commented yet.