# # Copyright (c) 2005-2006, John Mettraux, OpenWFE.org # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # . Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # . Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # . Neither the name of the "OpenWFE" nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # $Id: workitem.rb 3555 2006-11-13 00:47:53Z jmettraux $ # # # "hecho en Costa Rica" # enhanced in Japan # # john.mettraux@openwfe.org # require 'base64' require 'definitions' module OpenWFE # # FlowExpressionId # class FlowExpressionId attr_accessor \ :owfeVersion, \ :engineId, \ :initialEngineId, \ :workflowDefinitionUrl, \ :workflowDefinitionName, \ :workflowDefinitionRevision, \ :workflowInstanceId, \ :expressionName, \ :expressionId # # overrides the classical to_s() # def to_s () return "(fei #{@owfeVersion} #{@engineId}/#{@initialEngineId} #{@workflowDefinitionUrl} #{@workflowDefinitionName} #{@workflowDefinitionRevision} #{@workflowInstanceId} #{@expressionName} #{@expressionId} )" end # # This class method parses a string into a FlowExpressionId instance # def FlowExpressionId.strToFei (string) fei = FlowExpressionId.new() ss = string.split(" ") fei.owfeVersion = ss[2] ssRawEngineId = ss[3].split("/") fei.engineId= ssRawEngineId[0] fei.initialEngineId= ssRawEngineId[1] fei.workflowDefinitionUrl = ss[4] fei.workflowDefinitionName = ss[5] fei.workflowDefinitionRevision = ss[6] fei.workflowInstanceId = ss[7] fei.expressionName = ss[8] fei.expressionId = ss[9] return fei end def hash () return to_s().hash() end def == (other) return false if not other.kind_of?(FlowExpressionId) @owfeVersion == other.owfeVersion and @engineId == other.engineId and @initialEngineId == other.initialEngineId and @workflowDefinitionUrl == other.workflowDefinitionUrl and @workflowDefinitionName == other.workflowDefinitionName and @workflowDefinitionRevision == other.workflowDefinitionRevision and @workflowInstanceId == other.workflowInstanceId and @expressionName == other.expressionName and @expressionId == other.expressionId end def dup n = FlowExpressionId.new n.owfeVersion = @owfeVersion.dup n.engineId = @engineId.dup n.initialEngineId = @initialEngineId.dup n.workflowDefinitionUrl = @workflowDefinitionUrl.dup n.workflowDefinitionName = @workflowDefinitionName.dup n.workflowDefinitionRevision = @workflowDefinitionRevision.dup n.workflowInstanceId = @workflowInstanceId.dup n.expressionName = @expressionName.dup n.expressionId = @expressionId.dup return n end alias eql? == #alias to_debug_s to_s def to_debug_s "#{to_s} (h#{hash}) (i#{object_id})" end end end